os/graphics/egl/egltest/endpointtestsuite/automated/tsrc/egltest_endpointnotification.cpp
Update contrib.
1 // Copyright (c) 2009 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.
17 @internalComponent - Internal Symbian test code
20 #include "egltest_endpointnotification.h"
22 static const TTestCase KNotifcationPositiveCases[] =
26 CASETITLE("Functional: Positive: eglRequestNotification basic test."),
27 SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
29 { EInitializeCase, 0, EGL_SUCCESS },
30 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
31 { ECreateEndpointCase, 0, EGL_SUCCESS },
32 { ERequestNotificationCase, 0, EGL_SUCCESS },
33 { ECancelNotificationCase, 0, EGL_SUCCESS },
34 { EDestroyEndpointCase, 0, EGL_SUCCESS },
35 { ETerminateCase, 0, EGL_SUCCESS },
41 CASETITLE("Functional: Positive: eglRequestNotification with submitupdate."),
42 SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
44 { EInitializeCase, 0, EGL_SUCCESS },
45 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
46 { ECreateEndpointCase, 0, EGL_SUCCESS },
47 { ERequestNotificationCase, 0, EGL_SUCCESS },
48 { EDrawContentCase, 0, EGL_SUCCESS },
49 { EContentUpdateCase, 0, EGL_SUCCESS },
50 { EWaitForNotificationCase, 0, KErrNone, 0, 0, 100000 },
51 { ECancelNotificationCase, 0, EGL_SUCCESS },
52 { EDestroyEndpointCase, 0, EGL_SUCCESS },
53 { ETerminateCase, 0, EGL_SUCCESS },
59 CASETITLE("Functional: Positive: eglRequestNotification with no submitupdate."),
60 SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
62 { EInitializeCase, 0, EGL_SUCCESS },
63 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
64 { ECreateEndpointCase, 0, EGL_SUCCESS },
65 { ERequestNotificationCase, 0, EGL_SUCCESS },
66 { EWaitForNotificationCase, EExpectError, KErrTimedOut, 0, 0, 100000 },
67 { ECancelNotificationCase, 0, EGL_SUCCESS },
68 { EDestroyEndpointCase, 0, EGL_SUCCESS },
69 { ETerminateCase, 0, EGL_SUCCESS },
75 CASETITLE("Functional: Positive: eglRequestNotification with submitupdate first."),
76 SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
78 { EInitializeCase, 0, EGL_SUCCESS },
79 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
80 { ECreateEndpointCase, 0, EGL_SUCCESS },
81 { EDrawContentCase, 0, EGL_SUCCESS },
82 { EContentUpdateCase, 0, EGL_SUCCESS },
83 { ERequestNotificationCase, 0, EGL_SUCCESS },
84 { EWaitForNotificationCase, 0, KErrNone, 0, 0, 100000 },
85 { ECancelNotificationCase, 0, EGL_SUCCESS },
86 { EDestroyEndpointCase, 0, EGL_SUCCESS },
87 { ETerminateCase, 0, EGL_SUCCESS },
93 CASETITLE("Functional: Positive: eglRequestNotification with multiple endpoints."),
94 SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
96 { EInitializeCase, 0, EGL_SUCCESS },
97 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
98 { ECreateSurfaceCase, 0, EGL_SUCCESS, 1, EStandardSurface },
99 { ECreateEndpointCase, 0, EGL_SUCCESS, 0, 0 },
100 { ECreateEndpointCase, 0, EGL_SUCCESS, 1, 1},
101 { EDrawContentCase, 0, EGL_SUCCESS, 0, 0 },
102 { EContentUpdateCase, 0, EGL_SUCCESS, 0, 0 },
103 { ERequestNotificationCase, 0, EGL_SUCCESS, 0, 0 },
104 { ERequestNotificationCase, 0, EGL_SUCCESS, 1, 1 },
105 { EWaitForNotificationCase, 0, KErrNone, 0, 0, 100000 },
106 { EWaitForNotificationCase, EExpectError, KErrTimedOut, 1, 1, 100000 },
107 { EDestroyEndpointCase, 0, EGL_SUCCESS, 0, 0 },
108 { EDestroyEndpointCase, 0, EGL_SUCCESS, 1, 1 },
109 { ETerminateCase, 0, EGL_SUCCESS },
115 CASETITLE("Functional: Positive: Three endpoints, varying async notifications."),
116 SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
118 { EInitializeCase, 0, EGL_SUCCESS },
119 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
120 { ECreateSurfaceCase, 0, EGL_SUCCESS, 1, EStandardSurface },
121 { ECreateSurfaceCase, 0, EGL_SUCCESS, 2, EStandardSurface },
122 { ECreateEndpointCase, 0, EGL_SUCCESS, 0, 0 },
123 { ECreateEndpointCase, 0, EGL_SUCCESS, 1, 1},
124 { ECreateEndpointCase, 0, EGL_SUCCESS, 2, 2},
125 { ERequestNotificationCase, 0, EGL_SUCCESS, 0, 0 },
126 { ERequestNotificationCase, 0, EGL_SUCCESS, 1, 1 },
127 { ERequestNotificationCase, 0, EGL_SUCCESS, 2, 2 },
128 { EDrawContentCase, 0, EGL_SUCCESS, 1, 1 },
129 { EContentUpdateCase, 0, EGL_SUCCESS, 1, 1 },
130 { EWaitForNotificationCase, 0, KErrNone, 1, 1, 100000 },
131 { EWaitForNotificationCase, EExpectError, KErrTimedOut, 0, 0, 100000 },
132 { EWaitForNotificationCase, EExpectError, KErrTimedOut, 2, 2, 100000 },
133 { EDrawContentCase, 0, EGL_SUCCESS, 2, 2 },
134 { EContentUpdateCase, 0, EGL_SUCCESS, 2, 2 },
135 { EWaitForNotificationCase, 0, KErrNone, 2, 2, 100000 },
136 { EWaitForNotificationCase, EExpectError, KErrTimedOut, 0, 0, 100000 },
137 { EWaitForNotificationCase, EExpectError, KErrTimedOut, 1, 1, 100000 },
138 { ECancelNotificationCase, 0, EGL_SUCCESS, 0, 0 },
139 { EWaitForNotificationCase, EExpectError, KErrCancel, 0, 0, 10000 },
140 { EDestroyEndpointCase, 0, EGL_SUCCESS, 0, 0 },
141 { EDestroyEndpointCase, 0, EGL_SUCCESS, 1, 1 },
142 { EDestroyEndpointCase, 0, EGL_SUCCESS, 2, 2 },
143 { ETerminateCase, 0, EGL_SUCCESS },
149 CASETITLE("Functional: Positive: Multiple eglRequestNotification with no acquire."),
150 SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
152 { EInitializeCase, 0, EGL_SUCCESS },
153 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
154 { ECreateEndpointCase, 0, EGL_SUCCESS },
155 { EDrawContentCase, 0, EGL_SUCCESS },
156 { EContentUpdateCase, 0, EGL_SUCCESS },
157 { ERequestNotificationCase, 0, EGL_SUCCESS },
158 { EWaitForNotificationCase, 0, KErrNone, 0, 0, 100000 },
159 { ERequestNotificationCase, 0, EGL_SUCCESS },
160 { EWaitForNotificationCase, 0, KErrNone, 0, 0, 100000 },
161 { EDestroyEndpointCase, 0, EGL_SUCCESS },
162 { ETerminateCase, 0, EGL_SUCCESS },
168 CASETITLE("Functional: Positive: Notifications need submitupdate after acquire."),
169 SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
171 { EInitializeCase, 0, EGL_SUCCESS },
172 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
173 { ECreateEndpointCase, 0, EGL_SUCCESS },
174 { EDrawContentCase, 0, EGL_SUCCESS },
175 { EContentUpdateCase, 0, EGL_SUCCESS },
176 { ERequestNotificationCase, 0, EGL_SUCCESS },
177 { EWaitForNotificationCase, 0, KErrNone, 0, 0, 100000 },
178 { EBeginStreamingCase, 0, EGL_SUCCESS },
179 { EAcquireImageCase, 0, EGL_SUCCESS },
180 { ERequestNotificationCase, 0, EGL_SUCCESS },
181 { EWaitForNotificationCase, EExpectError, KErrTimedOut,0, 0, 100000 },
182 { EContentUpdateCase, ENoSync, EGL_SUCCESS },
183 { EWaitForNotificationCase, 0, KErrNone, 0, 0, 100000 },
184 { EDestroyEndpointCase, 0, EGL_SUCCESS },
185 { ETerminateCase, 0, EGL_SUCCESS },
191 CASETITLE("Functional: Positive: Destroy Endpoint acts as eglCancelNotificationNOK."),
192 SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
194 { EInitializeCase, 0, EGL_SUCCESS },
195 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
196 { ECreateEndpointCase, 0, EGL_SUCCESS },
197 { ERequestNotificationCase, 0, EGL_SUCCESS },
198 { EDestroyEndpointCase, 0, EGL_SUCCESS },
199 { EWaitForNotificationCase, EExpectError, KErrCancel, 0, 0, 100000 },
200 { ETerminateCase, 0, EGL_SUCCESS },
206 CASETITLE("Functional: Positive: eglCancelNotificationNOK completes with KErrCancel."),
207 SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
209 { EInitializeCase, 0, EGL_SUCCESS },
210 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
211 { ECreateEndpointCase, 0, EGL_SUCCESS },
212 { ERequestNotificationCase, 0, EGL_SUCCESS },
213 { ECancelNotificationCase, 0, EGL_SUCCESS },
214 { EWaitForNotificationCase, EExpectError, KErrCancel, 0, 0, 100000 },
215 { EDestroyEndpointCase, 0, EGL_SUCCESS },
216 { ETerminateCase, 0, EGL_SUCCESS },
222 CASETITLE("Functional: Positive: eglCancelNotificationNOK works after notification completed."),
223 SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
225 { EInitializeCase, 0, EGL_SUCCESS },
226 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
227 { ECreateEndpointCase, 0, EGL_SUCCESS },
228 { ERequestNotificationCase, 0, EGL_SUCCESS },
229 { EContentUpdateCase, 0, EGL_SUCCESS },
230 { EWaitForNotificationCase, 0, KErrNone, 0, 0, 100000 },
231 { ECancelNotificationCase, 0, EGL_SUCCESS },
232 { EWaitForNotificationCase, EExpectError, KErrTimedOut,0, 0, 100000 },
233 { EDestroyEndpointCase, 0, EGL_SUCCESS },
234 { ETerminateCase, 0, EGL_SUCCESS },
240 static const TTestCase KNotifcationNegativeCases[] =
244 CASETITLE("Functional: Negative: eglRequestNotification bad parameter test."),
245 SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
247 { EInitializeCase, 0, EGL_SUCCESS },
248 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
249 { ECreateEndpointCase, 0, EGL_SUCCESS },
251 { ERequestNotificationCase, EUseBadDisplay, EGL_BAD_DISPLAY },
252 { ERequestNotificationCase, EUseBadDisplay | EUseBadEndpoint, EGL_BAD_DISPLAY },
253 { ERequestNotificationCase, EUseBadDisplay | EUseBadSync, EGL_BAD_DISPLAY },
254 { ERequestNotificationCase, EUseBadDisplay | EUseBadEndpoint | EUseBadSync, EGL_BAD_DISPLAY },
255 { ERequestNotificationCase, EUseBadEndpoint, EGL_BAD_ENDPOINT_NOK },
256 { ERequestNotificationCase, EUseBadSync, EGL_BAD_PARAMETER },
257 { EDestroyEndpointCase, 0, EGL_SUCCESS },
258 { ETerminateCase, 0, EGL_SUCCESS },
264 CASETITLE("Functional: Negative: eglCancelNotification bad parameter test."),
265 SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
267 { EInitializeCase, 0, EGL_SUCCESS },
268 { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface },
269 { ECreateEndpointCase, 0, EGL_SUCCESS },
271 { ECancelNotificationCase, EUseBadDisplay, EGL_BAD_DISPLAY },
272 { ECancelNotificationCase, EUseBadDisplay | EUseBadEndpoint, EGL_BAD_DISPLAY },
273 { ECancelNotificationCase, EUseBadEndpoint, EGL_BAD_ENDPOINT_NOK },
274 { EDestroyEndpointCase, 0, EGL_SUCCESS },
275 { ETerminateCase, 0, EGL_SUCCESS },
283 static const TTestCases KTestCases[] =
285 TestCase(KNotifcationPositiveCases),
286 TestCase(KNotifcationNegativeCases),
289 const TInt KNumberTestCases = sizeof(KTestCases) / sizeof(KTestCases[0]);
291 CEglTest_LocalTestStep_EndpointNotification::CEglTest_LocalTestStep_EndpointNotification():
292 CEgltest_Local_Engine(KTestCases, KNumberTestCases)