os/graphics/egl/egltest/endpointtestsuite/automated/tsrc/egltest_endpointstreaming_local.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/egl/egltest/endpointtestsuite/automated/tsrc/egltest_endpointstreaming_local.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,321 @@
     1.4 +// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +
    1.16 +
    1.17 +/**
    1.18 + @file
    1.19 + @test
    1.20 + @internalComponent - Internal Symbian test code
    1.21 +*/
    1.22 +
    1.23 +#include "egltest_endpointstreaming.h"
    1.24 +
    1.25 +
    1.26 +/**
    1.27 +@SYMTestCaseID GRAPHICS-EGL-04xx
    1.28 +
    1.29 +@SYMTestPriority 1
    1.30 +
    1.31 +@SYMPREQ 2670
    1.32 +
    1.33 +@SYMREQ
    1.34 +
    1.35 +@SYMTestCaseDesc
    1.36 +Test the behaviour of eglEndpointBeginStreamingNOK and eglEndpointEndStreamingNOK with and
    1.37 +without bad parameters.
    1.38 +
    1.39 +@SYMTestActions
    1.40 +Create a number of surfaces
    1.41 +For each test case in a loop
    1.42 +    *   start the test in the remote windows server side to create endpoints
    1.43 +    *   in the client side call a surface update on any surface which should have the ready
    1.44 +        attribute set
    1.45 +    *   Send commands with parameters to the windows server process test render stage to
    1.46 +        begin/end streaming on an end point. These parameters include any error codes which
    1.47 +        is expected.
    1.48 +    *   Log any failures
    1.49 +If the procedure was successful release all the resources and check the heap for memory leaks.
    1.50 +No memory or handle leaks.
    1.51 +
    1.52 +@SYMTestExpectedResults
    1.53 +If the function fails, the return value is undefined and an error is generated.
    1.54 +If dpy is not the handle of a valid EGLDisplay object, the error EGL_BAD_DISPLAY is
    1.55 +generated for both BeginSreaming and EndStraming
    1.56 +If endpoint is not a valid EGLEndpointNOK object, the error EGL_BAD_ENDPOINT_NOK is
    1.57 +generated for both BeginStreaming and EndStraming.
    1.58 +If the endpoint is not ready,EGL_BAD_ACCESS is generated for calling BeginStreaming.
    1.59 +*/
    1.60 +
    1.61 +
    1.62 +static const TTestCase KStreamingPositiveCases[] =
    1.63 +{
    1.64 +    {
    1.65 +        TESTIDS("545A, 546A"),
    1.66 +        CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Begin and Endstreaming only"),
    1.67 +        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
    1.68 +        {
    1.69 +        { EInitializeCase,      0,              EGL_SUCCESS },
    1.70 +        { ECreateSurfaceCase,   0,              EGL_SUCCESS, 0, EStandardSurface },
    1.71 +        { ECreateEndpointCase,  0,              EGL_SUCCESS },
    1.72 +        { EDrawContentCase,     0,              EGL_SUCCESS },
    1.73 +        { EContentUpdateCase,   0,              EGL_SUCCESS },
    1.74 +        { EBeginStreamingCase,  0,              EGL_SUCCESS },
    1.75 +        { EEndStreamingCase,    0,              EGL_SUCCESS },
    1.76 +        { EDestroyEndpointCase, 0,              EGL_SUCCESS },
    1.77 +        { ETerminateCase,       0,              EGL_SUCCESS },
    1.78 +        { EFinishedCase }
    1.79 +        },
    1.80 +    },
    1.81 +    {
    1.82 +        TESTIDS("545B, 546B"),
    1.83 +        CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Begin, twice, then Endstreaming"),
    1.84 +        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
    1.85 +        {
    1.86 +        { EInitializeCase,      0,              EGL_SUCCESS },
    1.87 +        { ECreateSurfaceCase,   0,              EGL_SUCCESS, 0, EStandardSurface },
    1.88 +        { ECreateEndpointCase,  0,              EGL_SUCCESS },
    1.89 +        { EDrawContentCase,     0,              EGL_SUCCESS },
    1.90 +        { EContentUpdateCase,   0,              EGL_SUCCESS },
    1.91 +        { EBeginStreamingCase,  0,              EGL_SUCCESS },
    1.92 +        { EBeginStreamingCase,  0,              EGL_SUCCESS },
    1.93 +        { EEndStreamingCase,    0,              EGL_SUCCESS },
    1.94 +        { EDestroyEndpointCase, 0,              EGL_SUCCESS },
    1.95 +        { ETerminateCase,       0,              EGL_SUCCESS },
    1.96 +        { EFinishedCase }
    1.97 +        },
    1.98 +    },
    1.99 +    {
   1.100 +        TESTIDS("545C, 546C"),
   1.101 +        CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Begin then Endstreaming twice"),
   1.102 +        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
   1.103 +        {
   1.104 +        { EInitializeCase,      0,              EGL_SUCCESS },
   1.105 +        { ECreateSurfaceCase,   0,              EGL_SUCCESS, 0, EStandardSurface },
   1.106 +        { ECreateEndpointCase,  0,              EGL_SUCCESS },
   1.107 +        { EDrawContentCase,     0,              EGL_SUCCESS },
   1.108 +        { EContentUpdateCase,   0,              EGL_SUCCESS },
   1.109 +        { EBeginStreamingCase,  0,              EGL_SUCCESS },
   1.110 +        { EEndStreamingCase,    0,              EGL_SUCCESS },
   1.111 +        { EEndStreamingCase,    0,              EGL_SUCCESS },
   1.112 +        { EDestroyEndpointCase, 0,              EGL_SUCCESS },
   1.113 +        { ETerminateCase,       0,              EGL_SUCCESS },
   1.114 +        { EFinishedCase }
   1.115 +        },
   1.116 +    },
   1.117 +    // Now check that we can and can't acquire images when in or out of a streaming block.
   1.118 +    {
   1.119 +        TESTIDS("545D, 546D"),
   1.120 +        CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Beginstreaming, acquire, endstreaming"),
   1.121 +        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
   1.122 +        {
   1.123 +        { EInitializeCase,      0,              EGL_SUCCESS },
   1.124 +        { ECreateSurfaceCase,   0,              EGL_SUCCESS, 0, EStandardSurface },
   1.125 +        { ECreateEndpointCase,  0,              EGL_SUCCESS },
   1.126 +        { EDrawContentCase,     0,              EGL_SUCCESS },
   1.127 +        { EContentUpdateCase,   0,              EGL_SUCCESS },
   1.128 +        { EBeginStreamingCase,  0,              EGL_SUCCESS },
   1.129 +        { EAcquireImageCase,    0,              EGL_SUCCESS },
   1.130 +        { ECompareImageCase,    0,              EGL_SUCCESS },
   1.131 +        { EEndStreamingCase,    0,              EGL_SUCCESS },
   1.132 +        { EDestroyEndpointCase, 0,              EGL_SUCCESS },
   1.133 +        { ETerminateCase,       0,              EGL_SUCCESS },
   1.134 +        { EFinishedCase }
   1.135 +        },
   1.136 +    },
   1.137 +    {
   1.138 +        TESTIDS("545E, 546E"),
   1.139 +        CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Beginstreaming, endstreaming, acquire"),
   1.140 +        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
   1.141 +        {
   1.142 +        { EInitializeCase,      0,              EGL_SUCCESS },
   1.143 +        { ECreateSurfaceCase,   0,              EGL_SUCCESS, 0, EStandardSurface },
   1.144 +        { ECreateEndpointCase,  0,              EGL_SUCCESS },
   1.145 +        { EDrawContentCase,     0,              EGL_SUCCESS },
   1.146 +        { EContentUpdateCase,   0,              EGL_SUCCESS },
   1.147 +        { EBeginStreamingCase,  0,              EGL_SUCCESS },
   1.148 +        { EEndStreamingCase,    0,              EGL_SUCCESS },
   1.149 +        { EAcquireImageCase,    EExpectError,   EGL_BAD_ACCESS },
   1.150 +        { EDestroyEndpointCase, 0,              EGL_SUCCESS },
   1.151 +        { ETerminateCase,       0,              EGL_SUCCESS },
   1.152 +        { EFinishedCase }
   1.153 +        },
   1.154 +    },
   1.155 +    {
   1.156 +        TESTIDS("545F, 546F"),
   1.157 +        CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Beginstreaming twice, endstreaming, acquire"),
   1.158 +        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
   1.159 +        {
   1.160 +        { EInitializeCase,      0,              EGL_SUCCESS },
   1.161 +        { ECreateSurfaceCase,   0,              EGL_SUCCESS, 0, EStandardSurface },
   1.162 +        { ECreateEndpointCase,  0,              EGL_SUCCESS },
   1.163 +        { EDrawContentCase,     0,              EGL_SUCCESS },
   1.164 +        { EContentUpdateCase,   0,              EGL_SUCCESS },
   1.165 +        { EBeginStreamingCase,  0,              EGL_SUCCESS },
   1.166 +        { EBeginStreamingCase,  0,              EGL_SUCCESS },
   1.167 +        { EEndStreamingCase,    0,              EGL_SUCCESS },
   1.168 +        { EAcquireImageCase,    EExpectError,   EGL_BAD_ACCESS },
   1.169 +        { EDestroyEndpointCase, 0,              EGL_SUCCESS },
   1.170 +        { ETerminateCase,       0,              EGL_SUCCESS },
   1.171 +        { EFinishedCase }
   1.172 +        },
   1.173 +    },
   1.174 +    {
   1.175 +        TESTIDS("545G, 546G"),
   1.176 +        CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Beginstreaming, endstreaming twice, beginstreaming, acquire"),
   1.177 +        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
   1.178 +        {
   1.179 +        { EInitializeCase,      0,              EGL_SUCCESS },
   1.180 +        { ECreateSurfaceCase,   0,              EGL_SUCCESS, 0, EStandardSurface },
   1.181 +        { ECreateEndpointCase,  0,              EGL_SUCCESS },
   1.182 +        { EDrawContentCase,     0,              EGL_SUCCESS },
   1.183 +        { EContentUpdateCase,   0,              EGL_SUCCESS },
   1.184 +        { EBeginStreamingCase,  0,              EGL_SUCCESS },
   1.185 +        { EEndStreamingCase,    0,              EGL_SUCCESS },
   1.186 +        { EEndStreamingCase,    0,              EGL_SUCCESS },
   1.187 +        { EDrawContentCase,     0,              EGL_SUCCESS },
   1.188 +        { EContentUpdateCase,   0,              EGL_SUCCESS },
   1.189 +        { EBeginStreamingCase,  0,              EGL_SUCCESS },
   1.190 +        { EAcquireImageCase,    0,              EGL_SUCCESS },
   1.191 +        { ECompareImageCase,    0,              EGL_SUCCESS },
   1.192 +        { EEndStreamingCase,    0,              EGL_SUCCESS },
   1.193 +        { EDestroyEndpointCase, 0,              EGL_SUCCESS },
   1.194 +        { ETerminateCase,       0,              EGL_SUCCESS },
   1.195 +        { EFinishedCase }
   1.196 +        },
   1.197 +    },
   1.198 +    {
   1.199 +        TESTIDS("545H, 546H"),
   1.200 +        CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Beginstreaming, destroy, create, acquire (not ready)"),
   1.201 +        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
   1.202 +        {
   1.203 +        { EInitializeCase,      0,              EGL_SUCCESS },
   1.204 +        { ECreateSurfaceCase,   0,              EGL_SUCCESS, 0, EStandardSurface },
   1.205 +        { ECreateEndpointCase,  0,              EGL_SUCCESS },
   1.206 +        { EDrawContentCase,     0,              EGL_SUCCESS },
   1.207 +        { EContentUpdateCase,   0,              EGL_SUCCESS },
   1.208 +        { EBeginStreamingCase,  0,              EGL_SUCCESS },
   1.209 +        { EDestroyEndpointCase, 0,              EGL_SUCCESS },
   1.210 +        { ECreateEndpointCase,  0,              EGL_SUCCESS },
   1.211 +        // We should get bad access, as the endpoint is not ready!
   1.212 +        { EAcquireImageCase,    EExpectError,   EGL_BAD_ACCESS },
   1.213 +        { EEndStreamingCase,    0,              EGL_SUCCESS },
   1.214 +        { EDestroyEndpointCase, 0,              EGL_SUCCESS },
   1.215 +        { ETerminateCase,       0,              EGL_SUCCESS },
   1.216 +        { EFinishedCase }
   1.217 +        },
   1.218 +    },
   1.219 +    {
   1.220 +        TESTIDS("545I, 546I"),
   1.221 +        CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Beginstreaming, destroy, create, acquire (ready)"),
   1.222 +        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
   1.223 +        {
   1.224 +        { EInitializeCase,      0,              EGL_SUCCESS },
   1.225 +        { ECreateSurfaceCase,   0,              EGL_SUCCESS, 0, EStandardSurface },
   1.226 +        { ECreateEndpointCase,  0,              EGL_SUCCESS },
   1.227 +        { EDrawContentCase,     0,              EGL_SUCCESS },
   1.228 +        { EContentUpdateCase,   0,              EGL_SUCCESS },
   1.229 +        { EBeginStreamingCase,  0,              EGL_SUCCESS },
   1.230 +        { EDestroyEndpointCase, 0,              EGL_SUCCESS },
   1.231 +        { ECreateEndpointCase,  0,              EGL_SUCCESS },
   1.232 +        { EDrawContentCase,     0,              EGL_SUCCESS },
   1.233 +        { EContentUpdateCase,   0,              EGL_SUCCESS },
   1.234 +        // We should get bad access, as the endpoint is not in a streaming block!
   1.235 +        { EAcquireImageCase,    EExpectError,   EGL_BAD_ACCESS },
   1.236 +        { EEndStreamingCase,    0,              EGL_SUCCESS },
   1.237 +        { EDestroyEndpointCase, 0,              EGL_SUCCESS },
   1.238 +        { ETerminateCase,       0,              EGL_SUCCESS },
   1.239 +        { EFinishedCase }
   1.240 +        },
   1.241 +    },
   1.242 +};
   1.243 +
   1.244 +static const TTestCase KStreamingBadParameterCases[] =
   1.245 +{
   1.246 +    {
   1.247 +        TESTIDS("553A"),
   1.248 +        CASETITLE("Functional: Negative: eglEndpointBeginStreamingNOK with Bad Parameters: Test eglEndpointBeginStreaming bad parameter variations"),
   1.249 +        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
   1.250 +        {
   1.251 +        { EInitializeCase,      0,              EGL_SUCCESS },
   1.252 +        { ECreateSurfaceCase,   0,              EGL_SUCCESS, 0, EStandardSurface },
   1.253 +        { ECreateEndpointCase,  0,              EGL_SUCCESS },
   1.254 +        { EDrawContentCase,     0,              EGL_SUCCESS },
   1.255 +        { EContentUpdateCase,   0,              EGL_SUCCESS },
   1.256 +        // Bad display on it's own.
   1.257 +        { EBeginStreamingCase,  EUseBadDisplay, EGL_BAD_DISPLAY },
   1.258 +        // Bad display should be priority over the bad endpoint
   1.259 +        { EBeginStreamingCase,  EUseBadDisplay | EUseBadEndpoint, EGL_BAD_DISPLAY },
   1.260 +        // Bad endpoint should result in "BAD_ENDPOINT" error.
   1.261 +        { EBeginStreamingCase,  EUseBadEndpoint, EGL_BAD_ENDPOINT_NOK },
   1.262 +        { EEndStreamingCase,    0,              EGL_SUCCESS },
   1.263 +        { EDestroyEndpointCase, 0,              EGL_SUCCESS },
   1.264 +        { ETerminateCase,       0,              EGL_SUCCESS },
   1.265 +        { EFinishedCase }
   1.266 +        },
   1.267 +    },
   1.268 +    {
   1.269 +        TESTIDS("554A"),
   1.270 +        CASETITLE("Functional: Negative: eglEndpointEndStreamingNOK with Bad Parameters: Test eglEndpointEndStreaming bad parameter variations"),
   1.271 +        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
   1.272 +        {
   1.273 +        { EInitializeCase,      0,              EGL_SUCCESS },
   1.274 +        { ECreateSurfaceCase,   0,              EGL_SUCCESS, 0, EStandardSurface },
   1.275 +        { ECreateEndpointCase,  0,              EGL_SUCCESS },
   1.276 +        { EDrawContentCase,     0,              EGL_SUCCESS },
   1.277 +        { EContentUpdateCase,   0,              EGL_SUCCESS },
   1.278 +        // Bad display on it's own.
   1.279 +        { EEndStreamingCase,    EUseBadDisplay, EGL_BAD_DISPLAY },
   1.280 +        // Bad display should be priority over the bad endpoint
   1.281 +        { EEndStreamingCase,    EUseBadDisplay | EUseBadEndpoint, EGL_BAD_DISPLAY },
   1.282 +        { EEndStreamingCase,    EUseBadEndpoint, EGL_BAD_ENDPOINT_NOK },
   1.283 +        { EEndStreamingCase,    0,              EGL_SUCCESS },
   1.284 +        { EDestroyEndpointCase, 0,              EGL_SUCCESS },
   1.285 +        { ETerminateCase,       0,              EGL_SUCCESS },
   1.286 +        { EFinishedCase }
   1.287 +        },
   1.288 +    },
   1.289 +};
   1.290 +
   1.291 +static const TTestCase KStreamingNegativeCases[] =
   1.292 +{
   1.293 +    {
   1.294 +        TESTIDS("553B"),
   1.295 +        CASETITLE("Functional: Negative: eglEndpointBeginStreamingNOK with Bad Parameters: eglEndpointBeginStreaming with no contentupdate"),
   1.296 +        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
   1.297 +        {
   1.298 +        { EInitializeCase,      0,              EGL_SUCCESS },
   1.299 +        { ECreateSurfaceCase,   0,              EGL_SUCCESS, 0, EStandardSurface },
   1.300 +        { ECreateEndpointCase,  0,              EGL_SUCCESS },
   1.301 +        { EBeginStreamingCase,  EExpectError,   EGL_BAD_ACCESS },
   1.302 +        { EDrawContentCase,     0,              EGL_SUCCESS },
   1.303 +        { EContentUpdateCase,   0,              EGL_SUCCESS },
   1.304 +        { EBeginStreamingCase,  0,              EGL_SUCCESS },
   1.305 +        { EDestroyEndpointCase, 0,              EGL_SUCCESS },
   1.306 +        { ETerminateCase,       0,              EGL_SUCCESS },
   1.307 +        { EFinishedCase }
   1.308 +        },
   1.309 +    },
   1.310 +};
   1.311 +
   1.312 +static const TTestCases KTestCases[] =
   1.313 +{
   1.314 +    TestCase(KStreamingPositiveCases),
   1.315 +    TestCase(KStreamingBadParameterCases),
   1.316 +    TestCase(KStreamingNegativeCases),
   1.317 +};
   1.318 +
   1.319 +const TInt KNumberTestCases = sizeof(KTestCases) / sizeof(KTestCases[0]);
   1.320 +
   1.321 +CEglTest_LocalTestStep_EndpointStreaming::CEglTest_LocalTestStep_EndpointStreaming():
   1.322 +    CEgltest_Local_Engine(KTestCases, KNumberTestCases)
   1.323 +    {
   1.324 +    }