os/graphics/egl/egltest/endpointtestsuite/automated/tsrc/egltest_endpointimage_local.cpp
First public contribution.
1 // Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
19 @internalComponent - Internal Symbian test code
22 #include "egltest_endpointimage.h"
25 static const TTestCase KImagePositiveCases[] =
29 CASETITLE("Functional: Positive: Image content preservation with single update"),
30 // TODO: Add video- and viewfinder surfaces.
31 SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
33 { EInitializeCase, 0, EGL_SUCCESS },
34 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
35 { ECreateEndpointCase, 0, EGL_SUCCESS },
36 { EDrawContentCase, 0, EGL_SUCCESS },
37 { EContentUpdateCase, 0, EGL_SUCCESS },
38 { EBeginStreamingCase, 0, EGL_SUCCESS },
40 { EAcquireImageCase, 0, EGL_SUCCESS },
41 { ECompareImageCase, 0, EGL_SUCCESS },
42 { EReleaseImageCase, 0, EGL_SUCCESS },
44 { EAcquireImageCase, 0, EGL_SUCCESS },
45 { ECompareImageCase, 0, EGL_SUCCESS },
46 { EReleaseImageCase, 0, EGL_SUCCESS },
48 { EAcquireImageCase, 0, EGL_SUCCESS },
49 { ECompareImageCase, 0, EGL_SUCCESS },
50 { EReleaseImageCase, 0, EGL_SUCCESS },
52 { EAcquireImageCase, 0, EGL_SUCCESS },
53 { ECompareImageCase, 0, EGL_SUCCESS },
54 { EReleaseImageCase, 0, EGL_SUCCESS },
56 { EEndStreamingCase, 0, EGL_SUCCESS },
57 { EDestroyEndpointCase, 0, EGL_SUCCESS },
58 { ETerminateCase, 0, EGL_SUCCESS },
64 CASETITLE("Functional: Positive: Image content preservation with multiple updates"),
65 // TODO: Add video- and viewfinder surfaces.
66 SurfaceTypes3(ESurfTypeRaw, ESurfTypeRawSingleBuffered, ESurfTypeEglWindow),
68 { EInitializeCase, 0, EGL_SUCCESS },
69 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
70 { ECreateEndpointCase, 0, EGL_SUCCESS },
71 // Draw and compare four times.
72 { EDrawContentCase, 0, EGL_SUCCESS },
73 { EContentUpdateCase, 0, EGL_SUCCESS },
74 { EBeginStreamingCase, 0, EGL_SUCCESS },
75 { EAcquireImageCase, 0, EGL_SUCCESS },
76 { ECompareImageCase, 0, EGL_SUCCESS },
77 { EReleaseImageCase, 0, EGL_SUCCESS },
79 { EDrawContentCase, 0, EGL_SUCCESS, 0, 1 },
80 { EContentUpdateCase, 0, EGL_SUCCESS },
81 { EAcquireImageCase, 0, EGL_SUCCESS },
82 { ECompareImageCase, 0, EGL_SUCCESS, 0, 1 },
83 { EReleaseImageCase, 0, EGL_SUCCESS },
85 { EDrawContentCase, 0, EGL_SUCCESS },
86 { EContentUpdateCase, 0, EGL_SUCCESS },
87 { EAcquireImageCase, 0, EGL_SUCCESS },
88 { ECompareImageCase, 0, EGL_SUCCESS },
89 { EReleaseImageCase, 0, EGL_SUCCESS },
91 { EDrawContentCase, 0, EGL_SUCCESS, 0, 1 },
92 { EContentUpdateCase, 0, EGL_SUCCESS },
93 { EAcquireImageCase, 0, EGL_SUCCESS },
94 { ECompareImageCase, 0, EGL_SUCCESS, 0, 1 },
95 { EReleaseImageCase, 0, EGL_SUCCESS },
97 { EEndStreamingCase, 0, EGL_SUCCESS },
98 { EDestroyEndpointCase, 0, EGL_SUCCESS },
99 { ETerminateCase, 0, EGL_SUCCESS },
105 CASETITLE("Functional: Positive: Image content preservation in multiple endpoints with single update"),
106 // TODO: Add video- and viewfinder surfaces.
107 SurfaceTypes3(ESurfTypeRaw, ESurfTypeRawSingleBuffered, ESurfTypeEglWindow),
109 { EInitializeCase, 0, EGL_SUCCESS },
110 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
111 { ECreateSurfaceCase, 0, EGL_SUCCESS, 1, EStandardSurface },
112 { ECreateEndpointCase, 0, EGL_SUCCESS, 0, 0 },
113 { ECreateEndpointCase, 0, EGL_SUCCESS, 1, 1 },
114 // Draw and compare four times.
115 { EDrawContentCase, 0, EGL_SUCCESS, 0, 0 },
116 { EDrawContentCase, 0, EGL_SUCCESS, 1, 1 },
117 { EContentUpdateCase, 0, EGL_SUCCESS, 0 },
118 { EContentUpdateCase, 0, EGL_SUCCESS, 1 },
119 { EBeginStreamingCase, 0, EGL_SUCCESS, 0 },
120 { EBeginStreamingCase, 0, EGL_SUCCESS, 1 },
122 { EAcquireImageCase, 0, EGL_SUCCESS, 0, 0 },
123 { EAcquireImageCase, 0, EGL_SUCCESS, 1, 1 },
124 { ECompareImageCase, 0, EGL_SUCCESS, 0, 0},
125 { ECompareImageCase, 0, EGL_SUCCESS, 1, 1 },
126 { EReleaseImageCase, 0, EGL_SUCCESS, 0, 0 },
127 { EReleaseImageCase, 0, EGL_SUCCESS, 1, 1 },
129 { EAcquireImageCase, 0, EGL_SUCCESS, 0, 0 },
130 { EAcquireImageCase, 0, EGL_SUCCESS, 1, 1 },
131 { ECompareImageCase, 0, EGL_SUCCESS, 0, 0},
132 { ECompareImageCase, 0, EGL_SUCCESS, 1, 1 },
133 { EReleaseImageCase, 0, EGL_SUCCESS, 0, 0 },
134 { EReleaseImageCase, 0, EGL_SUCCESS, 1, 1 },
136 { EAcquireImageCase, 0, EGL_SUCCESS, 1, 1 },
137 { EAcquireImageCase, 0, EGL_SUCCESS, 0, 0 },
138 { ECompareImageCase, 0, EGL_SUCCESS, 1, 1 },
139 { ECompareImageCase, 0, EGL_SUCCESS, 0, 0 },
140 { EReleaseImageCase, 0, EGL_SUCCESS, 1, 1 },
141 { EReleaseImageCase, 0, EGL_SUCCESS, 0, 0 },
143 { EAcquireImageCase, 0, EGL_SUCCESS, 0, 0 },
144 { EAcquireImageCase, 0, EGL_SUCCESS, 1, 1 },
145 { ECompareImageCase, 0, EGL_SUCCESS, 1, 1 },
146 { ECompareImageCase, 0, EGL_SUCCESS, 0, 0},
147 { EReleaseImageCase, 0, EGL_SUCCESS, 0, 0 },
148 { EReleaseImageCase, 0, EGL_SUCCESS, 1, 1 },
150 { EEndStreamingCase, 0, EGL_SUCCESS, 0 },
151 { EEndStreamingCase, 0, EGL_SUCCESS, 1 },
152 { EDestroyEndpointCase, 0, EGL_SUCCESS, 0 },
153 { EDestroyEndpointCase, 0, EGL_SUCCESS, 1 },
154 { ETerminateCase, 0, EGL_SUCCESS },
160 CASETITLE("Functional: Positive: Image content preservation in multiple endpoints with multiple updates"),
161 // TODO: Add video- and viewfinder surfaces.
162 SurfaceTypes3(ESurfTypeRaw, ESurfTypeRawSingleBuffered, ESurfTypeEglWindow),
164 { EInitializeCase, 0, EGL_SUCCESS },
165 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
166 { ECreateSurfaceCase, 0, EGL_SUCCESS, 1, EStandardSurface },
167 { ECreateEndpointCase, 0, EGL_SUCCESS, 0, 0 },
168 { ECreateEndpointCase, 0, EGL_SUCCESS, 1, 1 },
169 // Draw and compare four times.
170 { EDrawContentCase, 0, EGL_SUCCESS, 0, 0 },
171 { EDrawContentCase, 0, EGL_SUCCESS, 1, 1 },
172 { EContentUpdateCase, 0, EGL_SUCCESS, 0 },
173 { EContentUpdateCase, 0, EGL_SUCCESS, 1 },
174 { EBeginStreamingCase, 0, EGL_SUCCESS, 0 },
175 { EBeginStreamingCase, 0, EGL_SUCCESS, 1 },
176 { EAcquireImageCase, 0, EGL_SUCCESS, 0, 0 },
177 { EAcquireImageCase, 0, EGL_SUCCESS, 1, 1 },
178 { ECompareImageCase, 0, EGL_SUCCESS, 0, 0},
179 { ECompareImageCase, 0, EGL_SUCCESS, 1, 1 },
180 { EReleaseImageCase, 0, EGL_SUCCESS, 0, 0 },
181 { EReleaseImageCase, 0, EGL_SUCCESS, 1, 1 },
183 { EDrawContentCase, 0, EGL_SUCCESS, 0, 2 },
184 { EDrawContentCase, 0, EGL_SUCCESS, 1, 3 },
185 { EContentUpdateCase, 0, EGL_SUCCESS, 0 },
186 { EContentUpdateCase, 0, EGL_SUCCESS, 1 },
187 { EBeginStreamingCase, 0, EGL_SUCCESS, 0 },
188 { EBeginStreamingCase, 0, EGL_SUCCESS, 1 },
189 { EAcquireImageCase, 0, EGL_SUCCESS, 0, 0 },
190 { EAcquireImageCase, 0, EGL_SUCCESS, 1, 1 },
191 { ECompareImageCase, 0, EGL_SUCCESS, 0, 2},
192 { ECompareImageCase, 0, EGL_SUCCESS, 1, 3 },
193 { EReleaseImageCase, 0, EGL_SUCCESS, 0, 0 },
194 { EReleaseImageCase, 0, EGL_SUCCESS, 1, 1 },
196 { EDrawContentCase, 0, EGL_SUCCESS, 0, 0 },
197 { EDrawContentCase, 0, EGL_SUCCESS, 1, 1 },
198 { EContentUpdateCase, 0, EGL_SUCCESS, 0 },
199 { EContentUpdateCase, 0, EGL_SUCCESS, 1 },
200 { EBeginStreamingCase, 0, EGL_SUCCESS, 0 },
201 { EBeginStreamingCase, 0, EGL_SUCCESS, 1 },
202 { EAcquireImageCase, 0, EGL_SUCCESS, 0, 0 },
203 { EAcquireImageCase, 0, EGL_SUCCESS, 1, 1 },
204 { ECompareImageCase, 0, EGL_SUCCESS, 0, 0},
205 { ECompareImageCase, 0, EGL_SUCCESS, 1, 1 },
206 { EReleaseImageCase, 0, EGL_SUCCESS, 0, 0 },
207 { EReleaseImageCase, 0, EGL_SUCCESS, 1, 1 },
209 { EEndStreamingCase, 0, EGL_SUCCESS, 0 },
210 { EEndStreamingCase, 0, EGL_SUCCESS, 1 },
211 { EDestroyEndpointCase, 0, EGL_SUCCESS, 0 },
212 { EDestroyEndpointCase, 0, EGL_SUCCESS, 1 },
213 { ETerminateCase, 0, EGL_SUCCESS },
217 //569 tests cause a panic
220 CASETITLE("Functional: Positive: VGImage handle remains valid after EGLImage goes out of scope"),
221 // TODO: Add video- and viewfinder surfaces.
222 SurfaceTypes3(ESurfTypeRaw, ESurfTypeRawSingleBuffered, ESurfTypeEglWindow),
224 { EInitializeCase, 0, EGL_SUCCESS },
225 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
226 { ECreateEndpointCase, 0, EGL_SUCCESS },
227 { EDrawContentCase, 0, EGL_SUCCESS },
228 { EContentUpdateCase, 0, EGL_SUCCESS },
229 { EBeginStreamingCase, 0, EGL_SUCCESS },
230 { EAcquireImageCase, 0, EGL_SUCCESS },
231 { ECreateVgImageCase, 0, EGL_SUCCESS },
232 { EReleaseImageCase, 0, EGL_SUCCESS },
233 { EEndStreamingCase, 0, EGL_SUCCESS },
234 { EDestroyEndpointCase, 0, EGL_SUCCESS },
235 { ETestVgImageValidCase, 0, EGL_SUCCESS },
236 { EDestroyVgImageCase, 0, EGL_SUCCESS },
237 { ECreateVgImageCase, EExpectError, VG_BAD_HANDLE_ERROR },
238 { ETerminateCase, 0, EGL_SUCCESS },
244 CASETITLE("Functional: Positive: VGImage handle remains valid after EGLImage goes out of scope"),
245 // TODO: Add video- and viewfinder surfaces.
246 SurfaceTypes3(ESurfTypeRaw, ESurfTypeRawSingleBuffered, ESurfTypeEglWindow),
248 { EInitializeCase, 0, EGL_SUCCESS },
249 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
250 { ECreateEndpointCase, 0, EGL_SUCCESS },
251 { EDrawContentCase, 0, EGL_SUCCESS },
252 { EContentUpdateCase, 0, EGL_SUCCESS },
253 { EBeginStreamingCase, 0, EGL_SUCCESS },
254 { EAcquireImageCase, 0, EGL_SUCCESS },
255 { ECreateVgImageCase, 0, EGL_SUCCESS },
256 { EReleaseImageCase, 0, EGL_SUCCESS },
257 { ETestVgImageValidCase, 0, EGL_SUCCESS },
258 { EDestroyVgImageCase, 0, EGL_SUCCESS },
259 { EEndStreamingCase, 0, EGL_SUCCESS },
260 { EDestroyEndpointCase, 0, EGL_SUCCESS },
261 { ECreateVgImageCase, EExpectError, VG_BAD_HANDLE_ERROR },
262 { ETerminateCase, 0, EGL_SUCCESS },
268 CASETITLE("Functional: Positive: VGImage handle remains valid after EGLImage goes out of scope"),
269 // TODO: Add video- and viewfinder surfaces.
270 SurfaceTypes3(ESurfTypeRaw, ESurfTypeRawSingleBuffered, ESurfTypeEglWindow),
272 { EInitializeCase, 0, EGL_SUCCESS },
273 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
274 { ECreateEndpointCase, 0, EGL_SUCCESS },
275 { EDrawContentCase, 0, EGL_SUCCESS },
276 { EContentUpdateCase, 0, EGL_SUCCESS },
277 { EBeginStreamingCase, 0, EGL_SUCCESS },
278 { EAcquireImageCase, 0, EGL_SUCCESS },
279 { ECreateVgImageCase, 0, EGL_SUCCESS },
280 { EReleaseImageCase, 0, EGL_SUCCESS },
281 { EEndStreamingCase, 0, EGL_SUCCESS },
282 { ETestVgImageValidCase, 0, EGL_SUCCESS },
283 { EDestroyVgImageCase, 0, EGL_SUCCESS },
284 { EDestroyEndpointCase, 0, EGL_SUCCESS },
285 { ECreateVgImageCase, EExpectError, VG_BAD_HANDLE_ERROR },
286 { ETerminateCase, 0, EGL_SUCCESS },
292 CASETITLE("Functional: Positive: VGImage handle remains valid after EGLImage goes out of scope with two VG images"),
293 // TODO: Add video- and viewfinder surfaces.
294 SurfaceTypes3(ESurfTypeRaw, ESurfTypeRawSingleBuffered, ESurfTypeEglWindow),
296 { EInitializeCase, 0, EGL_SUCCESS },
297 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
298 { ECreateEndpointCase, 0, EGL_SUCCESS },
299 { EDrawContentCase, 0, EGL_SUCCESS },
300 { EContentUpdateCase, 0, EGL_SUCCESS },
301 { EBeginStreamingCase, 0, EGL_SUCCESS },
302 { EAcquireImageCase, 0, EGL_SUCCESS },
303 { ECreateVgImageCase, 0, EGL_SUCCESS },
304 { EReleaseImageCase, 0, EGL_SUCCESS },
305 { EDrawContentCase, 0, EGL_SUCCESS, 0, 1 },
306 { EContentUpdateCase, 0, EGL_SUCCESS },
307 { EAcquireImageCase, 0, EGL_SUCCESS },
308 { ECreateVgImageCase, 0, EGL_SUCCESS, 0, 1 },
309 { EEndStreamingCase, 0, EGL_SUCCESS },
310 { ETestVgImageValidCase, 0, EGL_SUCCESS },
311 { ETestVgImageValidCase, 0, EGL_SUCCESS, 0, 1 },
312 { EDestroyVgImageCase, 0, EGL_SUCCESS },
313 { EDestroyVgImageCase, 0, EGL_SUCCESS, 0, 1 },
314 { EDestroyEndpointCase, 0, EGL_SUCCESS },
315 { ECreateVgImageCase, EExpectError, VG_BAD_HANDLE_ERROR },
316 { ETerminateCase, 0, EGL_SUCCESS },
322 CASETITLE("Functional: Positive: VGImage handle remains valid after EGLImage goes out of scope with two VG images"),
323 // TODO: Add video- and viewfinder surfaces.
324 SurfaceTypes3(ESurfTypeRaw, ESurfTypeRawSingleBuffered, ESurfTypeEglWindow),
326 { EInitializeCase, 0, EGL_SUCCESS },
327 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
328 { ECreateEndpointCase, 0, EGL_SUCCESS },
329 { EDrawContentCase, 0, EGL_SUCCESS },
330 { EContentUpdateCase, 0, EGL_SUCCESS },
331 { EBeginStreamingCase, 0, EGL_SUCCESS },
332 { EAcquireImageCase, 0, EGL_SUCCESS },
333 { ECreateVgImageCase, 0, EGL_SUCCESS },
334 { EReleaseImageCase, 0, EGL_SUCCESS },
335 { EDrawContentCase, 0, EGL_SUCCESS, 0, 1 },
336 { EContentUpdateCase, 0, EGL_SUCCESS },
337 { EAcquireImageCase, 0, EGL_SUCCESS },
338 { ECreateVgImageCase, 0, EGL_SUCCESS, 0, 1 },
339 { EEndStreamingCase, 0, EGL_SUCCESS },
340 { EDestroyEndpointCase, 0, EGL_SUCCESS },
341 { ETestVgImageValidCase, 0, EGL_SUCCESS },
342 { ETestVgImageValidCase, 0, EGL_SUCCESS, 0, 1 },
343 { EDestroyVgImageCase, 0, EGL_SUCCESS },
344 { EDestroyVgImageCase, 0, EGL_SUCCESS, 0, 1 },
345 { ECreateVgImageCase, EExpectError, VG_BAD_HANDLE_ERROR },
346 { ETerminateCase, 0, EGL_SUCCESS },
352 CASETITLE("Functional: Positive: VGImage handle remains valid after EGLImage goes out of scope with two VG images"),
353 // TODO: Add video- and viewfinder surfaces.
354 SurfaceTypes3(ESurfTypeRaw, ESurfTypeRawSingleBuffered, ESurfTypeEglWindow),
356 { EInitializeCase, 0, EGL_SUCCESS },
357 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
358 { ECreateEndpointCase, 0, EGL_SUCCESS },
359 { EDrawContentCase, 0, EGL_SUCCESS },
360 { EContentUpdateCase, 0, EGL_SUCCESS },
361 { EBeginStreamingCase, 0, EGL_SUCCESS },
362 { EAcquireImageCase, 0, EGL_SUCCESS },
363 { ECreateVgImageCase, 0, EGL_SUCCESS },
364 { EReleaseImageCase, 0, EGL_SUCCESS },
365 { EDrawContentCase, 0, EGL_SUCCESS, 0, 1 },
366 { EContentUpdateCase, 0, EGL_SUCCESS },
367 { EAcquireImageCase, 0, EGL_SUCCESS },
368 { ECreateVgImageCase, 0, EGL_SUCCESS, 0, 1 },
369 { EEndStreamingCase, 0, EGL_SUCCESS },
370 { ETestVgImageValidCase, 0, EGL_SUCCESS },
371 { EDestroyVgImageCase, 0, EGL_SUCCESS },
372 { EDestroyEndpointCase, 0, EGL_SUCCESS },
373 { ETestVgImageValidCase, 0, EGL_SUCCESS, 0, 1 },
374 { EDestroyVgImageCase, 0, EGL_SUCCESS, 0, 1 },
375 { ECreateVgImageCase, EExpectError, VG_BAD_HANDLE_ERROR },
376 { ETerminateCase, 0, EGL_SUCCESS },
382 CASETITLE("Functional: Positive: Acquired EGLImage is not corrupted by submitting new content to surface"),
383 // TODO: Add triple buffered, video- and viewfinder surfaces.
384 SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
386 { EInitializeCase, 0, EGL_SUCCESS },
387 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
388 { ECreateEndpointCase, 0, EGL_SUCCESS },
389 { EDrawContentCase, 0, EGL_SUCCESS },
390 { EContentUpdateCase, 0, EGL_SUCCESS },
391 { EBeginStreamingCase, 0, EGL_SUCCESS },
392 { EAcquireImageCase, 0, EGL_SUCCESS },
393 { ECompareImageCase, 0, EGL_SUCCESS },
394 { EDrawContentCase, 0, EGL_SUCCESS, 0, 1 },
395 { EContentUpdateCase, ENoSync, EGL_SUCCESS },
396 { ECompareImageCase, 0, EGL_SUCCESS },
397 { EReleaseImageCase, 0, EGL_SUCCESS },
398 { EAcquireImageCase, 0, EGL_SUCCESS },
399 { ECompareImageCase, 0, EGL_SUCCESS, 0, 1 },
400 { EReleaseImageCase, 0, EGL_SUCCESS },
402 { EEndStreamingCase, 0, EGL_SUCCESS, 0 },
403 { EDestroyEndpointCase, 0, EGL_SUCCESS, 0 },
404 { ETerminateCase, 0, EGL_SUCCESS },
411 static const TTestCases KTestCases[] =
413 TestCase(KImagePositiveCases),
416 const TInt KNumberTestCases = sizeof(KTestCases) / sizeof(KTestCases[0]);
419 CEglTest_LocalTestStep_EndpointImage::CEglTest_LocalTestStep_EndpointImage():
420 CEgltest_Local_Engine(KTestCases, KNumberTestCases)
425 // Class for lifetime testing - we need to create another process and use endpoints from that process...
426 _LIT(KEglEndpointLifetimeExe, "eglendpointlifetimetesthelper.exe");
429 CEglTest_LocalTestStep_EndpointImageLifetime::CEglTest_LocalTestStep_EndpointImageLifetime()
430 : CLocalTestStepBase(ETestUidEndpointEngine) // We use the engine to do the remote side functionality.
434 void CEglTest_LocalTestStep_EndpointImageLifetime::DoPreambleL()
436 //Register the test id.
437 _LIT(KTestId, "568");
438 RegisterTestIdsL(KTestId);
439 SetCurrentTestIds(KTestId);
441 TInt err= iProcessResultInQueue.CreateGlobal(KResultProcessQueueName, 5);
442 User::LeaveIfError(err);
443 err = iProcessParamsOutQueue.CreateGlobal(KParamsProcessQueueName, 1);
444 User::LeaveIfError(err);
448 void CEglTest_LocalTestStep_EndpointImageLifetime::DoPostambleL()
450 iProcessResultInQueue.Close();
451 iProcessParamsOutQueue.Close();
454 CEglTest_LocalTestStep_EndpointImageLifetime::~CEglTest_LocalTestStep_EndpointImageLifetime()
456 iProcessResultInQueue.Close();
457 iProcessParamsOutQueue.Close();
460 void CEglTest_LocalTestStep_EndpointImageLifetime::RunScript(
461 const TEngineTestCase *aTestCases,
462 TRemoteTestParams ¶ms)
464 for(TInt i = 0; aTestCases[i].iCase != EFinishedCase; i++)
466 params.iEndpointEngine.iEngineTestCase = aTestCases[i];
467 RunRemoteTestCase(aTestCases[i].iCase, params);
471 void CEglTest_LocalTestStep_EndpointImageLifetime::EndpointLifetimeTestL(TSurfaceType aSurfaceType, TInt aExitType)
473 // Create an external process that creates a surface.
474 TInt err = iProcessStatus.iProcess.Create(KEglEndpointLifetimeExe, KNullDesC);
475 User::LeaveIfError(err);
476 iProcessStatus.iProcess.Logon(iProcessStatus.iStatus);
477 iProcessStatus.iProcess.Resume();
480 iProcessResultInQueue.SendBlocking(aSurfaceType);
483 iProcessParamsOutQueue.ReceiveBlocking(id);
484 // Now perform a bit of engine stuff...
486 TRemoteTestParams params = {};
488 params.iEndpointEngine.iSurfaceParams.iSurfaceId = id;
490 static const TEngineTestCase createEndpointSteps[] =
492 { EInitializeCase, 0, EGL_SUCCESS },
493 { ECreateEndpointCase, 0, EGL_SUCCESS },
494 { EFinishedCase, 0, EGL_SUCCESS },
497 RunScript(createEndpointSteps, params);
499 // Now that we have an endpoint, we can continue the other process.
500 iProcessResultInQueue.SendBlocking(aExitType);
502 User::WaitForRequest(iProcessStatus.iStatus);
504 INFO_PRINTF2(_L("External Process finished with status = %d"), iProcessStatus.iStatus.Int());
506 // Check the endpoint content.
507 static const TEngineTestCase checkEndpointSteps[] =
509 { EBeginStreamingCase, 0, EGL_SUCCESS },
510 { EAcquireImageCase, 0, EGL_SUCCESS },
511 { ECompareImageCase, 0, EGL_SUCCESS },
512 { EReleaseImageCase, 0, EGL_SUCCESS },
513 { EDestroyEndpointCase, 0, EGL_SUCCESS },
514 { EFinishedCase, 0, EGL_SUCCESS },
517 RunScript(checkEndpointSteps, params);
520 TVerdict CEglTest_LocalTestStep_EndpointImageLifetime::doTestStepL()
522 static const TRemoteTestParams nullParams = {};
523 StartRemoteTestStep(nullParams);
525 TSurfaceType surfaceTypes[] = { ESurfTypeEglWindow, ESurfTypeRaw, ESurfTypeRawSingleBuffered };
526 for(TInt i = 0; i < sizeof(surfaceTypes) / sizeof(surfaceTypes[0]); i++)
528 TSurfaceType sType = surfaceTypes[i];
529 EndpointLifetimeTestL(sType, EEndpointLifetimeNormalExit);
530 EndpointLifetimeTestL(sType, EEnfpointLifetimePanicExit);
533 EndRemoteTestStep(nullParams);
534 INFO_PRINTF1(_L("Lifetime test finished"));
535 return TestStepResult();