os/graphics/egl/egltest/endpointtestsuite/automated/tsrc/egltest_endpointimage_local.cpp
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/egl/egltest/endpointtestsuite/automated/tsrc/egltest_endpointimage_local.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,536 @@
1.4 +// Copyright (c) 2009-2010 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 +// Description:
1.17 +//
1.18 +
1.19 +/**
1.20 + @file
1.21 + @test
1.22 + @internalComponent - Internal Symbian test code
1.23 +*/
1.24 +
1.25 +#include "egltest_endpointimage.h"
1.26 +
1.27 +
1.28 +static const TTestCase KImagePositiveCases[] =
1.29 +{
1.30 + {
1.31 + TESTIDS("565A"),
1.32 + CASETITLE("Functional: Positive: Image content preservation with single update"),
1.33 + // TODO: Add video- and viewfinder surfaces.
1.34 + SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
1.35 + {
1.36 + { EInitializeCase, 0, EGL_SUCCESS },
1.37 + { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
1.38 + { ECreateEndpointCase, 0, EGL_SUCCESS },
1.39 + { EDrawContentCase, 0, EGL_SUCCESS },
1.40 + { EContentUpdateCase, 0, EGL_SUCCESS },
1.41 + { EBeginStreamingCase, 0, EGL_SUCCESS },
1.42 +
1.43 + { EAcquireImageCase, 0, EGL_SUCCESS },
1.44 + { ECompareImageCase, 0, EGL_SUCCESS },
1.45 + { EReleaseImageCase, 0, EGL_SUCCESS },
1.46 +
1.47 + { EAcquireImageCase, 0, EGL_SUCCESS },
1.48 + { ECompareImageCase, 0, EGL_SUCCESS },
1.49 + { EReleaseImageCase, 0, EGL_SUCCESS },
1.50 +
1.51 + { EAcquireImageCase, 0, EGL_SUCCESS },
1.52 + { ECompareImageCase, 0, EGL_SUCCESS },
1.53 + { EReleaseImageCase, 0, EGL_SUCCESS },
1.54 +
1.55 + { EAcquireImageCase, 0, EGL_SUCCESS },
1.56 + { ECompareImageCase, 0, EGL_SUCCESS },
1.57 + { EReleaseImageCase, 0, EGL_SUCCESS },
1.58 +
1.59 + { EEndStreamingCase, 0, EGL_SUCCESS },
1.60 + { EDestroyEndpointCase, 0, EGL_SUCCESS },
1.61 + { ETerminateCase, 0, EGL_SUCCESS },
1.62 + { EFinishedCase }
1.63 + },
1.64 + },
1.65 + {
1.66 + TESTIDS("566A"),
1.67 + CASETITLE("Functional: Positive: Image content preservation with multiple updates"),
1.68 + // TODO: Add video- and viewfinder surfaces.
1.69 + SurfaceTypes3(ESurfTypeRaw, ESurfTypeRawSingleBuffered, ESurfTypeEglWindow),
1.70 + {
1.71 + { EInitializeCase, 0, EGL_SUCCESS },
1.72 + { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
1.73 + { ECreateEndpointCase, 0, EGL_SUCCESS },
1.74 + // Draw and compare four times.
1.75 + { EDrawContentCase, 0, EGL_SUCCESS },
1.76 + { EContentUpdateCase, 0, EGL_SUCCESS },
1.77 + { EBeginStreamingCase, 0, EGL_SUCCESS },
1.78 + { EAcquireImageCase, 0, EGL_SUCCESS },
1.79 + { ECompareImageCase, 0, EGL_SUCCESS },
1.80 + { EReleaseImageCase, 0, EGL_SUCCESS },
1.81 +
1.82 + { EDrawContentCase, 0, EGL_SUCCESS, 0, 1 },
1.83 + { EContentUpdateCase, 0, EGL_SUCCESS },
1.84 + { EAcquireImageCase, 0, EGL_SUCCESS },
1.85 + { ECompareImageCase, 0, EGL_SUCCESS, 0, 1 },
1.86 + { EReleaseImageCase, 0, EGL_SUCCESS },
1.87 +
1.88 + { EDrawContentCase, 0, EGL_SUCCESS },
1.89 + { EContentUpdateCase, 0, EGL_SUCCESS },
1.90 + { EAcquireImageCase, 0, EGL_SUCCESS },
1.91 + { ECompareImageCase, 0, EGL_SUCCESS },
1.92 + { EReleaseImageCase, 0, EGL_SUCCESS },
1.93 +
1.94 + { EDrawContentCase, 0, EGL_SUCCESS, 0, 1 },
1.95 + { EContentUpdateCase, 0, EGL_SUCCESS },
1.96 + { EAcquireImageCase, 0, EGL_SUCCESS },
1.97 + { ECompareImageCase, 0, EGL_SUCCESS, 0, 1 },
1.98 + { EReleaseImageCase, 0, EGL_SUCCESS },
1.99 +
1.100 + { EEndStreamingCase, 0, EGL_SUCCESS },
1.101 + { EDestroyEndpointCase, 0, EGL_SUCCESS },
1.102 + { ETerminateCase, 0, EGL_SUCCESS },
1.103 + { EFinishedCase }
1.104 + },
1.105 + },
1.106 + {
1.107 + TESTIDS("567A"),
1.108 + CASETITLE("Functional: Positive: Image content preservation in multiple endpoints with single update"),
1.109 + // TODO: Add video- and viewfinder surfaces.
1.110 + SurfaceTypes3(ESurfTypeRaw, ESurfTypeRawSingleBuffered, ESurfTypeEglWindow),
1.111 + {
1.112 + { EInitializeCase, 0, EGL_SUCCESS },
1.113 + { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
1.114 + { ECreateSurfaceCase, 0, EGL_SUCCESS, 1, EStandardSurface },
1.115 + { ECreateEndpointCase, 0, EGL_SUCCESS, 0, 0 },
1.116 + { ECreateEndpointCase, 0, EGL_SUCCESS, 1, 1 },
1.117 + // Draw and compare four times.
1.118 + { EDrawContentCase, 0, EGL_SUCCESS, 0, 0 },
1.119 + { EDrawContentCase, 0, EGL_SUCCESS, 1, 1 },
1.120 + { EContentUpdateCase, 0, EGL_SUCCESS, 0 },
1.121 + { EContentUpdateCase, 0, EGL_SUCCESS, 1 },
1.122 + { EBeginStreamingCase, 0, EGL_SUCCESS, 0 },
1.123 + { EBeginStreamingCase, 0, EGL_SUCCESS, 1 },
1.124 +
1.125 + { EAcquireImageCase, 0, EGL_SUCCESS, 0, 0 },
1.126 + { EAcquireImageCase, 0, EGL_SUCCESS, 1, 1 },
1.127 + { ECompareImageCase, 0, EGL_SUCCESS, 0, 0},
1.128 + { ECompareImageCase, 0, EGL_SUCCESS, 1, 1 },
1.129 + { EReleaseImageCase, 0, EGL_SUCCESS, 0, 0 },
1.130 + { EReleaseImageCase, 0, EGL_SUCCESS, 1, 1 },
1.131 +
1.132 + { EAcquireImageCase, 0, EGL_SUCCESS, 0, 0 },
1.133 + { EAcquireImageCase, 0, EGL_SUCCESS, 1, 1 },
1.134 + { ECompareImageCase, 0, EGL_SUCCESS, 0, 0},
1.135 + { ECompareImageCase, 0, EGL_SUCCESS, 1, 1 },
1.136 + { EReleaseImageCase, 0, EGL_SUCCESS, 0, 0 },
1.137 + { EReleaseImageCase, 0, EGL_SUCCESS, 1, 1 },
1.138 +
1.139 + { EAcquireImageCase, 0, EGL_SUCCESS, 1, 1 },
1.140 + { EAcquireImageCase, 0, EGL_SUCCESS, 0, 0 },
1.141 + { ECompareImageCase, 0, EGL_SUCCESS, 1, 1 },
1.142 + { ECompareImageCase, 0, EGL_SUCCESS, 0, 0 },
1.143 + { EReleaseImageCase, 0, EGL_SUCCESS, 1, 1 },
1.144 + { EReleaseImageCase, 0, EGL_SUCCESS, 0, 0 },
1.145 +
1.146 + { EAcquireImageCase, 0, EGL_SUCCESS, 0, 0 },
1.147 + { EAcquireImageCase, 0, EGL_SUCCESS, 1, 1 },
1.148 + { ECompareImageCase, 0, EGL_SUCCESS, 1, 1 },
1.149 + { ECompareImageCase, 0, EGL_SUCCESS, 0, 0},
1.150 + { EReleaseImageCase, 0, EGL_SUCCESS, 0, 0 },
1.151 + { EReleaseImageCase, 0, EGL_SUCCESS, 1, 1 },
1.152 +
1.153 + { EEndStreamingCase, 0, EGL_SUCCESS, 0 },
1.154 + { EEndStreamingCase, 0, EGL_SUCCESS, 1 },
1.155 + { EDestroyEndpointCase, 0, EGL_SUCCESS, 0 },
1.156 + { EDestroyEndpointCase, 0, EGL_SUCCESS, 1 },
1.157 + { ETerminateCase, 0, EGL_SUCCESS },
1.158 + { EFinishedCase }
1.159 + },
1.160 + },
1.161 + {
1.162 + TESTIDS("567B"),
1.163 + CASETITLE("Functional: Positive: Image content preservation in multiple endpoints with multiple updates"),
1.164 + // TODO: Add video- and viewfinder surfaces.
1.165 + SurfaceTypes3(ESurfTypeRaw, ESurfTypeRawSingleBuffered, ESurfTypeEglWindow),
1.166 + {
1.167 + { EInitializeCase, 0, EGL_SUCCESS },
1.168 + { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
1.169 + { ECreateSurfaceCase, 0, EGL_SUCCESS, 1, EStandardSurface },
1.170 + { ECreateEndpointCase, 0, EGL_SUCCESS, 0, 0 },
1.171 + { ECreateEndpointCase, 0, EGL_SUCCESS, 1, 1 },
1.172 + // Draw and compare four times.
1.173 + { EDrawContentCase, 0, EGL_SUCCESS, 0, 0 },
1.174 + { EDrawContentCase, 0, EGL_SUCCESS, 1, 1 },
1.175 + { EContentUpdateCase, 0, EGL_SUCCESS, 0 },
1.176 + { EContentUpdateCase, 0, EGL_SUCCESS, 1 },
1.177 + { EBeginStreamingCase, 0, EGL_SUCCESS, 0 },
1.178 + { EBeginStreamingCase, 0, EGL_SUCCESS, 1 },
1.179 + { EAcquireImageCase, 0, EGL_SUCCESS, 0, 0 },
1.180 + { EAcquireImageCase, 0, EGL_SUCCESS, 1, 1 },
1.181 + { ECompareImageCase, 0, EGL_SUCCESS, 0, 0},
1.182 + { ECompareImageCase, 0, EGL_SUCCESS, 1, 1 },
1.183 + { EReleaseImageCase, 0, EGL_SUCCESS, 0, 0 },
1.184 + { EReleaseImageCase, 0, EGL_SUCCESS, 1, 1 },
1.185 +
1.186 + { EDrawContentCase, 0, EGL_SUCCESS, 0, 2 },
1.187 + { EDrawContentCase, 0, EGL_SUCCESS, 1, 3 },
1.188 + { EContentUpdateCase, 0, EGL_SUCCESS, 0 },
1.189 + { EContentUpdateCase, 0, EGL_SUCCESS, 1 },
1.190 + { EBeginStreamingCase, 0, EGL_SUCCESS, 0 },
1.191 + { EBeginStreamingCase, 0, EGL_SUCCESS, 1 },
1.192 + { EAcquireImageCase, 0, EGL_SUCCESS, 0, 0 },
1.193 + { EAcquireImageCase, 0, EGL_SUCCESS, 1, 1 },
1.194 + { ECompareImageCase, 0, EGL_SUCCESS, 0, 2},
1.195 + { ECompareImageCase, 0, EGL_SUCCESS, 1, 3 },
1.196 + { EReleaseImageCase, 0, EGL_SUCCESS, 0, 0 },
1.197 + { EReleaseImageCase, 0, EGL_SUCCESS, 1, 1 },
1.198 +
1.199 + { EDrawContentCase, 0, EGL_SUCCESS, 0, 0 },
1.200 + { EDrawContentCase, 0, EGL_SUCCESS, 1, 1 },
1.201 + { EContentUpdateCase, 0, EGL_SUCCESS, 0 },
1.202 + { EContentUpdateCase, 0, EGL_SUCCESS, 1 },
1.203 + { EBeginStreamingCase, 0, EGL_SUCCESS, 0 },
1.204 + { EBeginStreamingCase, 0, EGL_SUCCESS, 1 },
1.205 + { EAcquireImageCase, 0, EGL_SUCCESS, 0, 0 },
1.206 + { EAcquireImageCase, 0, EGL_SUCCESS, 1, 1 },
1.207 + { ECompareImageCase, 0, EGL_SUCCESS, 0, 0},
1.208 + { ECompareImageCase, 0, EGL_SUCCESS, 1, 1 },
1.209 + { EReleaseImageCase, 0, EGL_SUCCESS, 0, 0 },
1.210 + { EReleaseImageCase, 0, EGL_SUCCESS, 1, 1 },
1.211 +
1.212 + { EEndStreamingCase, 0, EGL_SUCCESS, 0 },
1.213 + { EEndStreamingCase, 0, EGL_SUCCESS, 1 },
1.214 + { EDestroyEndpointCase, 0, EGL_SUCCESS, 0 },
1.215 + { EDestroyEndpointCase, 0, EGL_SUCCESS, 1 },
1.216 + { ETerminateCase, 0, EGL_SUCCESS },
1.217 + { EFinishedCase }
1.218 + },
1.219 + },
1.220 + //569 tests cause a panic
1.221 + {
1.222 + TESTIDS("569A"),
1.223 + CASETITLE("Functional: Positive: VGImage handle remains valid after EGLImage goes out of scope"),
1.224 + // TODO: Add video- and viewfinder surfaces.
1.225 + SurfaceTypes3(ESurfTypeRaw, ESurfTypeRawSingleBuffered, ESurfTypeEglWindow),
1.226 + {
1.227 + { EInitializeCase, 0, EGL_SUCCESS },
1.228 + { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
1.229 + { ECreateEndpointCase, 0, EGL_SUCCESS },
1.230 + { EDrawContentCase, 0, EGL_SUCCESS },
1.231 + { EContentUpdateCase, 0, EGL_SUCCESS },
1.232 + { EBeginStreamingCase, 0, EGL_SUCCESS },
1.233 + { EAcquireImageCase, 0, EGL_SUCCESS },
1.234 + { ECreateVgImageCase, 0, EGL_SUCCESS },
1.235 + { EReleaseImageCase, 0, EGL_SUCCESS },
1.236 + { EEndStreamingCase, 0, EGL_SUCCESS },
1.237 + { EDestroyEndpointCase, 0, EGL_SUCCESS },
1.238 + { ETestVgImageValidCase, 0, EGL_SUCCESS },
1.239 + { EDestroyVgImageCase, 0, EGL_SUCCESS },
1.240 + { ECreateVgImageCase, EExpectError, VG_BAD_HANDLE_ERROR },
1.241 + { ETerminateCase, 0, EGL_SUCCESS },
1.242 + { EFinishedCase }
1.243 + }
1.244 + },
1.245 + {
1.246 + TESTIDS("569B"),
1.247 + CASETITLE("Functional: Positive: VGImage handle remains valid after EGLImage goes out of scope"),
1.248 + // TODO: Add video- and viewfinder surfaces.
1.249 + SurfaceTypes3(ESurfTypeRaw, ESurfTypeRawSingleBuffered, ESurfTypeEglWindow),
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 + { EBeginStreamingCase, 0, EGL_SUCCESS },
1.257 + { EAcquireImageCase, 0, EGL_SUCCESS },
1.258 + { ECreateVgImageCase, 0, EGL_SUCCESS },
1.259 + { EReleaseImageCase, 0, EGL_SUCCESS },
1.260 + { ETestVgImageValidCase, 0, EGL_SUCCESS },
1.261 + { EDestroyVgImageCase, 0, EGL_SUCCESS },
1.262 + { EEndStreamingCase, 0, EGL_SUCCESS },
1.263 + { EDestroyEndpointCase, 0, EGL_SUCCESS },
1.264 + { ECreateVgImageCase, EExpectError, VG_BAD_HANDLE_ERROR },
1.265 + { ETerminateCase, 0, EGL_SUCCESS },
1.266 + { EFinishedCase }
1.267 + }
1.268 + },
1.269 + {
1.270 + TESTIDS("569C"),
1.271 + CASETITLE("Functional: Positive: VGImage handle remains valid after EGLImage goes out of scope"),
1.272 + // TODO: Add video- and viewfinder surfaces.
1.273 + SurfaceTypes3(ESurfTypeRaw, ESurfTypeRawSingleBuffered, ESurfTypeEglWindow),
1.274 + {
1.275 + { EInitializeCase, 0, EGL_SUCCESS },
1.276 + { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
1.277 + { ECreateEndpointCase, 0, EGL_SUCCESS },
1.278 + { EDrawContentCase, 0, EGL_SUCCESS },
1.279 + { EContentUpdateCase, 0, EGL_SUCCESS },
1.280 + { EBeginStreamingCase, 0, EGL_SUCCESS },
1.281 + { EAcquireImageCase, 0, EGL_SUCCESS },
1.282 + { ECreateVgImageCase, 0, EGL_SUCCESS },
1.283 + { EReleaseImageCase, 0, EGL_SUCCESS },
1.284 + { EEndStreamingCase, 0, EGL_SUCCESS },
1.285 + { ETestVgImageValidCase, 0, EGL_SUCCESS },
1.286 + { EDestroyVgImageCase, 0, EGL_SUCCESS },
1.287 + { EDestroyEndpointCase, 0, EGL_SUCCESS },
1.288 + { ECreateVgImageCase, EExpectError, VG_BAD_HANDLE_ERROR },
1.289 + { ETerminateCase, 0, EGL_SUCCESS },
1.290 + { EFinishedCase }
1.291 + }
1.292 + },
1.293 + {
1.294 + TESTIDS("569D"),
1.295 + CASETITLE("Functional: Positive: VGImage handle remains valid after EGLImage goes out of scope with two VG images"),
1.296 + // TODO: Add video- and viewfinder surfaces.
1.297 + SurfaceTypes3(ESurfTypeRaw, ESurfTypeRawSingleBuffered, ESurfTypeEglWindow),
1.298 + {
1.299 + { EInitializeCase, 0, EGL_SUCCESS },
1.300 + { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
1.301 + { ECreateEndpointCase, 0, EGL_SUCCESS },
1.302 + { EDrawContentCase, 0, EGL_SUCCESS },
1.303 + { EContentUpdateCase, 0, EGL_SUCCESS },
1.304 + { EBeginStreamingCase, 0, EGL_SUCCESS },
1.305 + { EAcquireImageCase, 0, EGL_SUCCESS },
1.306 + { ECreateVgImageCase, 0, EGL_SUCCESS },
1.307 + { EReleaseImageCase, 0, EGL_SUCCESS },
1.308 + { EDrawContentCase, 0, EGL_SUCCESS, 0, 1 },
1.309 + { EContentUpdateCase, 0, EGL_SUCCESS },
1.310 + { EAcquireImageCase, 0, EGL_SUCCESS },
1.311 + { ECreateVgImageCase, 0, EGL_SUCCESS, 0, 1 },
1.312 + { EEndStreamingCase, 0, EGL_SUCCESS },
1.313 + { ETestVgImageValidCase, 0, EGL_SUCCESS },
1.314 + { ETestVgImageValidCase, 0, EGL_SUCCESS, 0, 1 },
1.315 + { EDestroyVgImageCase, 0, EGL_SUCCESS },
1.316 + { EDestroyVgImageCase, 0, EGL_SUCCESS, 0, 1 },
1.317 + { EDestroyEndpointCase, 0, EGL_SUCCESS },
1.318 + { ECreateVgImageCase, EExpectError, VG_BAD_HANDLE_ERROR },
1.319 + { ETerminateCase, 0, EGL_SUCCESS },
1.320 + { EFinishedCase }
1.321 + }
1.322 + },
1.323 + {
1.324 + TESTIDS("569E"),
1.325 + CASETITLE("Functional: Positive: VGImage handle remains valid after EGLImage goes out of scope with two VG images"),
1.326 + // TODO: Add video- and viewfinder surfaces.
1.327 + SurfaceTypes3(ESurfTypeRaw, ESurfTypeRawSingleBuffered, ESurfTypeEglWindow),
1.328 + {
1.329 + { EInitializeCase, 0, EGL_SUCCESS },
1.330 + { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
1.331 + { ECreateEndpointCase, 0, EGL_SUCCESS },
1.332 + { EDrawContentCase, 0, EGL_SUCCESS },
1.333 + { EContentUpdateCase, 0, EGL_SUCCESS },
1.334 + { EBeginStreamingCase, 0, EGL_SUCCESS },
1.335 + { EAcquireImageCase, 0, EGL_SUCCESS },
1.336 + { ECreateVgImageCase, 0, EGL_SUCCESS },
1.337 + { EReleaseImageCase, 0, EGL_SUCCESS },
1.338 + { EDrawContentCase, 0, EGL_SUCCESS, 0, 1 },
1.339 + { EContentUpdateCase, 0, EGL_SUCCESS },
1.340 + { EAcquireImageCase, 0, EGL_SUCCESS },
1.341 + { ECreateVgImageCase, 0, EGL_SUCCESS, 0, 1 },
1.342 + { EEndStreamingCase, 0, EGL_SUCCESS },
1.343 + { EDestroyEndpointCase, 0, EGL_SUCCESS },
1.344 + { ETestVgImageValidCase, 0, EGL_SUCCESS },
1.345 + { ETestVgImageValidCase, 0, EGL_SUCCESS, 0, 1 },
1.346 + { EDestroyVgImageCase, 0, EGL_SUCCESS },
1.347 + { EDestroyVgImageCase, 0, EGL_SUCCESS, 0, 1 },
1.348 + { ECreateVgImageCase, EExpectError, VG_BAD_HANDLE_ERROR },
1.349 + { ETerminateCase, 0, EGL_SUCCESS },
1.350 + { EFinishedCase }
1.351 + }
1.352 + },
1.353 + {
1.354 + TESTIDS("569F"),
1.355 + CASETITLE("Functional: Positive: VGImage handle remains valid after EGLImage goes out of scope with two VG images"),
1.356 + // TODO: Add video- and viewfinder surfaces.
1.357 + SurfaceTypes3(ESurfTypeRaw, ESurfTypeRawSingleBuffered, ESurfTypeEglWindow),
1.358 + {
1.359 + { EInitializeCase, 0, EGL_SUCCESS },
1.360 + { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
1.361 + { ECreateEndpointCase, 0, EGL_SUCCESS },
1.362 + { EDrawContentCase, 0, EGL_SUCCESS },
1.363 + { EContentUpdateCase, 0, EGL_SUCCESS },
1.364 + { EBeginStreamingCase, 0, EGL_SUCCESS },
1.365 + { EAcquireImageCase, 0, EGL_SUCCESS },
1.366 + { ECreateVgImageCase, 0, EGL_SUCCESS },
1.367 + { EReleaseImageCase, 0, EGL_SUCCESS },
1.368 + { EDrawContentCase, 0, EGL_SUCCESS, 0, 1 },
1.369 + { EContentUpdateCase, 0, EGL_SUCCESS },
1.370 + { EAcquireImageCase, 0, EGL_SUCCESS },
1.371 + { ECreateVgImageCase, 0, EGL_SUCCESS, 0, 1 },
1.372 + { EEndStreamingCase, 0, EGL_SUCCESS },
1.373 + { ETestVgImageValidCase, 0, EGL_SUCCESS },
1.374 + { EDestroyVgImageCase, 0, EGL_SUCCESS },
1.375 + { EDestroyEndpointCase, 0, EGL_SUCCESS },
1.376 + { ETestVgImageValidCase, 0, EGL_SUCCESS, 0, 1 },
1.377 + { EDestroyVgImageCase, 0, EGL_SUCCESS, 0, 1 },
1.378 + { ECreateVgImageCase, EExpectError, VG_BAD_HANDLE_ERROR },
1.379 + { ETerminateCase, 0, EGL_SUCCESS },
1.380 + { EFinishedCase }
1.381 + }
1.382 + },
1.383 + {
1.384 + TESTIDS("570"),
1.385 + CASETITLE("Functional: Positive: Acquired EGLImage is not corrupted by submitting new content to surface"),
1.386 + // TODO: Add triple buffered, video- and viewfinder surfaces.
1.387 + SurfaceTypes2(ESurfTypeRaw, ESurfTypeEglWindow),
1.388 + {
1.389 + { EInitializeCase, 0, EGL_SUCCESS },
1.390 + { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
1.391 + { ECreateEndpointCase, 0, EGL_SUCCESS },
1.392 + { EDrawContentCase, 0, EGL_SUCCESS },
1.393 + { EContentUpdateCase, 0, EGL_SUCCESS },
1.394 + { EBeginStreamingCase, 0, EGL_SUCCESS },
1.395 + { EAcquireImageCase, 0, EGL_SUCCESS },
1.396 + { ECompareImageCase, 0, EGL_SUCCESS },
1.397 + { EDrawContentCase, 0, EGL_SUCCESS, 0, 1 },
1.398 + { EContentUpdateCase, ENoSync, EGL_SUCCESS },
1.399 + { ECompareImageCase, 0, EGL_SUCCESS },
1.400 + { EReleaseImageCase, 0, EGL_SUCCESS },
1.401 + { EAcquireImageCase, 0, EGL_SUCCESS },
1.402 + { ECompareImageCase, 0, EGL_SUCCESS, 0, 1 },
1.403 + { EReleaseImageCase, 0, EGL_SUCCESS },
1.404 +
1.405 + { EEndStreamingCase, 0, EGL_SUCCESS, 0 },
1.406 + { EDestroyEndpointCase, 0, EGL_SUCCESS, 0 },
1.407 + { ETerminateCase, 0, EGL_SUCCESS },
1.408 + { EFinishedCase }
1.409 + },
1.410 + },
1.411 +};
1.412 +
1.413 +
1.414 +static const TTestCases KTestCases[] =
1.415 +{
1.416 + TestCase(KImagePositiveCases),
1.417 +};
1.418 +
1.419 +const TInt KNumberTestCases = sizeof(KTestCases) / sizeof(KTestCases[0]);
1.420 +
1.421 +
1.422 +CEglTest_LocalTestStep_EndpointImage::CEglTest_LocalTestStep_EndpointImage():
1.423 + CEgltest_Local_Engine(KTestCases, KNumberTestCases)
1.424 + {
1.425 + }
1.426 +
1.427 +
1.428 +// Class for lifetime testing - we need to create another process and use endpoints from that process...
1.429 +_LIT(KEglEndpointLifetimeExe, "eglendpointlifetimetesthelper.exe");
1.430 +
1.431 +
1.432 +CEglTest_LocalTestStep_EndpointImageLifetime::CEglTest_LocalTestStep_EndpointImageLifetime()
1.433 +: CLocalTestStepBase(ETestUidEndpointEngine) // We use the engine to do the remote side functionality.
1.434 + {
1.435 + }
1.436 +
1.437 +void CEglTest_LocalTestStep_EndpointImageLifetime::DoPreambleL()
1.438 + {
1.439 + //Register the test id.
1.440 + _LIT(KTestId, "568");
1.441 + RegisterTestIdsL(KTestId);
1.442 + SetCurrentTestIds(KTestId);
1.443 +
1.444 + TInt err= iProcessResultInQueue.CreateGlobal(KResultProcessQueueName, 5);
1.445 + User::LeaveIfError(err);
1.446 + err = iProcessParamsOutQueue.CreateGlobal(KParamsProcessQueueName, 1);
1.447 + User::LeaveIfError(err);
1.448 + }
1.449 +
1.450 +
1.451 +void CEglTest_LocalTestStep_EndpointImageLifetime::DoPostambleL()
1.452 + {
1.453 + iProcessResultInQueue.Close();
1.454 + iProcessParamsOutQueue.Close();
1.455 + }
1.456 +
1.457 +CEglTest_LocalTestStep_EndpointImageLifetime::~CEglTest_LocalTestStep_EndpointImageLifetime()
1.458 + {
1.459 + iProcessResultInQueue.Close();
1.460 + iProcessParamsOutQueue.Close();
1.461 + }
1.462 +
1.463 +void CEglTest_LocalTestStep_EndpointImageLifetime::RunScript(
1.464 + const TEngineTestCase *aTestCases,
1.465 + TRemoteTestParams ¶ms)
1.466 + {
1.467 + for(TInt i = 0; aTestCases[i].iCase != EFinishedCase; i++)
1.468 + {
1.469 + params.iEndpointEngine.iEngineTestCase = aTestCases[i];
1.470 + RunRemoteTestCase(aTestCases[i].iCase, params);
1.471 + }
1.472 + }
1.473 +
1.474 +void CEglTest_LocalTestStep_EndpointImageLifetime::EndpointLifetimeTestL(TSurfaceType aSurfaceType, TInt aExitType)
1.475 + {
1.476 + // Create an external process that creates a surface.
1.477 + TInt err = iProcessStatus.iProcess.Create(KEglEndpointLifetimeExe, KNullDesC);
1.478 + User::LeaveIfError(err);
1.479 + iProcessStatus.iProcess.Logon(iProcessStatus.iStatus);
1.480 + iProcessStatus.iProcess.Resume();
1.481 +
1.482 +
1.483 + iProcessResultInQueue.SendBlocking(aSurfaceType);
1.484 +
1.485 + TSurfaceId id;
1.486 + iProcessParamsOutQueue.ReceiveBlocking(id);
1.487 + // Now perform a bit of engine stuff...
1.488 +
1.489 + TRemoteTestParams params = {};
1.490 +
1.491 + params.iEndpointEngine.iSurfaceParams.iSurfaceId = id;
1.492 +
1.493 + static const TEngineTestCase createEndpointSteps[] =
1.494 + {
1.495 + { EInitializeCase, 0, EGL_SUCCESS },
1.496 + { ECreateEndpointCase, 0, EGL_SUCCESS },
1.497 + { EFinishedCase, 0, EGL_SUCCESS },
1.498 + };
1.499 +
1.500 + RunScript(createEndpointSteps, params);
1.501 +
1.502 + // Now that we have an endpoint, we can continue the other process.
1.503 + iProcessResultInQueue.SendBlocking(aExitType);
1.504 +
1.505 + User::WaitForRequest(iProcessStatus.iStatus);
1.506 +
1.507 + INFO_PRINTF2(_L("External Process finished with status = %d"), iProcessStatus.iStatus.Int());
1.508 +
1.509 + // Check the endpoint content.
1.510 + static const TEngineTestCase checkEndpointSteps[] =
1.511 + {
1.512 + { EBeginStreamingCase, 0, EGL_SUCCESS },
1.513 + { EAcquireImageCase, 0, EGL_SUCCESS },
1.514 + { ECompareImageCase, 0, EGL_SUCCESS },
1.515 + { EReleaseImageCase, 0, EGL_SUCCESS },
1.516 + { EDestroyEndpointCase, 0, EGL_SUCCESS },
1.517 + { EFinishedCase, 0, EGL_SUCCESS },
1.518 + };
1.519 +
1.520 + RunScript(checkEndpointSteps, params);
1.521 + }
1.522 +
1.523 +TVerdict CEglTest_LocalTestStep_EndpointImageLifetime::doTestStepL()
1.524 + {
1.525 + static const TRemoteTestParams nullParams = {};
1.526 + StartRemoteTestStep(nullParams);
1.527 +
1.528 + TSurfaceType surfaceTypes[] = { ESurfTypeEglWindow, ESurfTypeRaw, ESurfTypeRawSingleBuffered };
1.529 + for(TInt i = 0; i < sizeof(surfaceTypes) / sizeof(surfaceTypes[0]); i++)
1.530 + {
1.531 + TSurfaceType sType = surfaceTypes[i];
1.532 + EndpointLifetimeTestL(sType, EEndpointLifetimeNormalExit);
1.533 + EndpointLifetimeTestL(sType, EEnfpointLifetimePanicExit);
1.534 + }
1.535 +
1.536 + EndRemoteTestStep(nullParams);
1.537 + INFO_PRINTF1(_L("Lifetime test finished"));
1.538 + return TestStepResult();
1.539 + }