os/graphics/egl/egltest/endpointtestsuite/automated/tsrc/egltest_endpointimage_local.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 /**
    17  @file
    18  @test
    19  @internalComponent - Internal Symbian test code
    20 */
    21 
    22 #include "egltest_endpointimage.h"
    23 
    24 
    25 static const TTestCase KImagePositiveCases[] =
    26 {
    27     {
    28         TESTIDS("565A"),
    29         CASETITLE("Functional: Positive: Image content preservation with single update"),
    30         // TODO: Add video- and viewfinder surfaces.
    31         SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
    32         {
    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 },
    39 
    40         { EAcquireImageCase,    0, EGL_SUCCESS },
    41         { ECompareImageCase,    0, EGL_SUCCESS },
    42         { EReleaseImageCase,    0, EGL_SUCCESS },
    43 
    44         { EAcquireImageCase,    0, EGL_SUCCESS },
    45         { ECompareImageCase,    0, EGL_SUCCESS },
    46         { EReleaseImageCase,    0, EGL_SUCCESS },
    47 
    48         { EAcquireImageCase,    0, EGL_SUCCESS },
    49         { ECompareImageCase,    0, EGL_SUCCESS },
    50         { EReleaseImageCase,    0, EGL_SUCCESS },
    51 
    52         { EAcquireImageCase,    0, EGL_SUCCESS },
    53         { ECompareImageCase,    0, EGL_SUCCESS },
    54         { EReleaseImageCase,    0, EGL_SUCCESS },
    55 
    56         { EEndStreamingCase,    0, EGL_SUCCESS },
    57         { EDestroyEndpointCase, 0, EGL_SUCCESS },
    58         { ETerminateCase,       0, EGL_SUCCESS },
    59         { EFinishedCase }
    60         },
    61     },
    62     {
    63         TESTIDS("566A"),
    64         CASETITLE("Functional: Positive: Image content preservation with multiple updates"),
    65         // TODO: Add video- and viewfinder surfaces.
    66         SurfaceTypes3(ESurfTypeRaw, ESurfTypeRawSingleBuffered, ESurfTypeEglWindow),
    67         {
    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 },
    78 
    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 },
    84 
    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 },
    90 
    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 },
    96 
    97         { EEndStreamingCase,    0, EGL_SUCCESS },
    98         { EDestroyEndpointCase, 0, EGL_SUCCESS },
    99         { ETerminateCase,       0, EGL_SUCCESS },
   100         { EFinishedCase }
   101         },
   102     },
   103     {
   104         TESTIDS("567A"),
   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),
   108         {
   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 },
   121 
   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 },
   128 
   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 },
   135 
   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 },
   142 
   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 },
   149 
   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 },
   155         { EFinishedCase }
   156         },
   157     },
   158     {
   159         TESTIDS("567B"),
   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),
   163         {
   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 },
   182 
   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 },
   195 
   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 },
   208 
   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 },
   214         { EFinishedCase }
   215         },
   216     },
   217 	//569 tests cause a panic
   218     {
   219         TESTIDS("569A"),
   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),
   223         {
   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 },
   239         { EFinishedCase }
   240         }
   241     },
   242     {
   243         TESTIDS("569B"),
   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),
   247         {
   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 },
   263         { EFinishedCase }
   264         }
   265     },
   266     {
   267         TESTIDS("569C"),
   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),
   271         {
   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 },
   287         { EFinishedCase }
   288         }
   289     },
   290     {
   291         TESTIDS("569D"),
   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),
   295         {
   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 },
   317         { EFinishedCase }
   318         }
   319     },
   320     {
   321         TESTIDS("569E"),
   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),
   325         {
   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 },
   347         { EFinishedCase }
   348         }
   349     },
   350     {
   351         TESTIDS("569F"),
   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),
   355         {
   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 },
   377         { EFinishedCase }
   378         }
   379     },
   380     {
   381         TESTIDS("570"),
   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),
   385         {
   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 },
   401 
   402         { EEndStreamingCase,    0, EGL_SUCCESS, 0 },
   403         { EDestroyEndpointCase, 0, EGL_SUCCESS, 0 },
   404         { ETerminateCase,       0, EGL_SUCCESS },
   405         { EFinishedCase }
   406         },
   407     },
   408 };
   409 
   410 
   411 static const TTestCases KTestCases[] =
   412 {
   413         TestCase(KImagePositiveCases),
   414 };
   415 
   416 const TInt KNumberTestCases = sizeof(KTestCases) / sizeof(KTestCases[0]);
   417 
   418 
   419 CEglTest_LocalTestStep_EndpointImage::CEglTest_LocalTestStep_EndpointImage():
   420     CEgltest_Local_Engine(KTestCases, KNumberTestCases)
   421     {
   422     }
   423 
   424 
   425 // Class for lifetime testing - we need to create another process and use endpoints from that process...
   426 _LIT(KEglEndpointLifetimeExe, "eglendpointlifetimetesthelper.exe");
   427 
   428 
   429 CEglTest_LocalTestStep_EndpointImageLifetime::CEglTest_LocalTestStep_EndpointImageLifetime()
   430 : CLocalTestStepBase(ETestUidEndpointEngine)  // We use the engine to do the remote side functionality.
   431     {
   432     }
   433 
   434 void CEglTest_LocalTestStep_EndpointImageLifetime::DoPreambleL()
   435     {
   436     //Register the test id.
   437     _LIT(KTestId, "568");
   438     RegisterTestIdsL(KTestId);
   439     SetCurrentTestIds(KTestId);
   440     
   441     TInt err= iProcessResultInQueue.CreateGlobal(KResultProcessQueueName, 5);
   442     User::LeaveIfError(err);
   443     err = iProcessParamsOutQueue.CreateGlobal(KParamsProcessQueueName, 1);
   444     User::LeaveIfError(err);
   445     }
   446 
   447 
   448 void CEglTest_LocalTestStep_EndpointImageLifetime::DoPostambleL()
   449     {
   450     iProcessResultInQueue.Close();
   451     iProcessParamsOutQueue.Close();
   452     }
   453 
   454 CEglTest_LocalTestStep_EndpointImageLifetime::~CEglTest_LocalTestStep_EndpointImageLifetime()
   455     {
   456     iProcessResultInQueue.Close();
   457     iProcessParamsOutQueue.Close();
   458     }
   459 
   460 void CEglTest_LocalTestStep_EndpointImageLifetime::RunScript(
   461         const TEngineTestCase *aTestCases,
   462         TRemoteTestParams &params)
   463     {
   464     for(TInt i = 0; aTestCases[i].iCase != EFinishedCase; i++)
   465         {
   466         params.iEndpointEngine.iEngineTestCase = aTestCases[i];
   467         RunRemoteTestCase(aTestCases[i].iCase, params);
   468         }
   469     }
   470 
   471 void CEglTest_LocalTestStep_EndpointImageLifetime::EndpointLifetimeTestL(TSurfaceType aSurfaceType, TInt aExitType)
   472     {
   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();
   478 
   479 
   480     iProcessResultInQueue.SendBlocking(aSurfaceType);
   481 
   482     TSurfaceId id;
   483     iProcessParamsOutQueue.ReceiveBlocking(id);
   484     // Now perform a bit of engine stuff...
   485 
   486     TRemoteTestParams params = {};
   487 
   488     params.iEndpointEngine.iSurfaceParams.iSurfaceId = id;
   489 
   490     static const TEngineTestCase createEndpointSteps[] =
   491     {
   492         { EInitializeCase,     0, EGL_SUCCESS },
   493         { ECreateEndpointCase, 0, EGL_SUCCESS },
   494         { EFinishedCase,       0, EGL_SUCCESS },
   495     };
   496 
   497     RunScript(createEndpointSteps, params);
   498 
   499     // Now that we have an endpoint, we can continue the other process.
   500     iProcessResultInQueue.SendBlocking(aExitType);
   501 
   502     User::WaitForRequest(iProcessStatus.iStatus);
   503 
   504     INFO_PRINTF2(_L("External Process finished with status = %d"), iProcessStatus.iStatus.Int());
   505 
   506     // Check the endpoint content.
   507     static const TEngineTestCase checkEndpointSteps[] =
   508     {
   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 },
   515     };
   516 
   517     RunScript(checkEndpointSteps, params);
   518     }
   519 
   520 TVerdict CEglTest_LocalTestStep_EndpointImageLifetime::doTestStepL()
   521     {
   522     static const TRemoteTestParams nullParams = {};
   523     StartRemoteTestStep(nullParams);
   524 
   525     TSurfaceType surfaceTypes[] = { ESurfTypeEglWindow, ESurfTypeRaw, ESurfTypeRawSingleBuffered };
   526     for(TInt i = 0; i < sizeof(surfaceTypes) / sizeof(surfaceTypes[0]); i++)
   527         {
   528         TSurfaceType sType = surfaceTypes[i];
   529         EndpointLifetimeTestL(sType, EEndpointLifetimeNormalExit);
   530         EndpointLifetimeTestL(sType, EEnfpointLifetimePanicExit);
   531         }
   532 
   533     EndRemoteTestStep(nullParams);
   534     INFO_PRINTF1(_L("Lifetime test finished"));
   535     return TestStepResult();
   536     }