os/graphics/egl/egltest/endpointtestsuite/automated/tsrc/egltest_endpointnotification.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
sl@0
    13
sl@0
    14
/**
sl@0
    15
 @file
sl@0
    16
 @test
sl@0
    17
 @internalComponent - Internal Symbian test code
sl@0
    18
*/
sl@0
    19
sl@0
    20
#include "egltest_endpointnotification.h"
sl@0
    21
sl@0
    22
static const TTestCase KNotifcationPositiveCases[] =
sl@0
    23
{
sl@0
    24
    {
sl@0
    25
        TESTIDS("559,561"),
sl@0
    26
        CASETITLE("Functional: Positive: eglRequestNotification basic test."),
sl@0
    27
        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
sl@0
    28
        {
sl@0
    29
        { EInitializeCase,      0,              EGL_SUCCESS },
sl@0
    30
        { ECreateSurfaceCase,   0,              EGL_SUCCESS, 0, EStandardSurface },
sl@0
    31
        { ECreateEndpointCase,  0,              EGL_SUCCESS },
sl@0
    32
        { ERequestNotificationCase, 0,          EGL_SUCCESS },
sl@0
    33
        { ECancelNotificationCase, 0,           EGL_SUCCESS },
sl@0
    34
        { EDestroyEndpointCase, 0,              EGL_SUCCESS },
sl@0
    35
        { ETerminateCase,       0,              EGL_SUCCESS },
sl@0
    36
        { EFinishedCase }
sl@0
    37
        },
sl@0
    38
    },
sl@0
    39
    {
sl@0
    40
        TESTIDS("604"),
sl@0
    41
        CASETITLE("Functional: Positive: eglRequestNotification with submitupdate."),
sl@0
    42
        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
sl@0
    43
        {
sl@0
    44
        { EInitializeCase,          0,              EGL_SUCCESS },
sl@0
    45
        { ECreateSurfaceCase,       0,              EGL_SUCCESS, 0, EStandardSurface },
sl@0
    46
        { ECreateEndpointCase,      0,              EGL_SUCCESS },
sl@0
    47
        { ERequestNotificationCase, 0,              EGL_SUCCESS },
sl@0
    48
        { EDrawContentCase,         0,              EGL_SUCCESS },
sl@0
    49
        { EContentUpdateCase,       0,              EGL_SUCCESS },
sl@0
    50
        { EWaitForNotificationCase, 0,              KErrNone,    0, 0, 100000 },
sl@0
    51
        { ECancelNotificationCase,  0,              EGL_SUCCESS },
sl@0
    52
        { EDestroyEndpointCase,     0,              EGL_SUCCESS },
sl@0
    53
        { ETerminateCase,           0,              EGL_SUCCESS },
sl@0
    54
        { EFinishedCase }
sl@0
    55
        },
sl@0
    56
    },
sl@0
    57
    {
sl@0
    58
        TESTIDS("605"),
sl@0
    59
        CASETITLE("Functional: Positive: eglRequestNotification with no submitupdate."),
sl@0
    60
        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
sl@0
    61
        {
sl@0
    62
        { EInitializeCase,          0,              EGL_SUCCESS },
sl@0
    63
        { ECreateSurfaceCase,       0,              EGL_SUCCESS,  0, EStandardSurface },
sl@0
    64
        { ECreateEndpointCase,      0,              EGL_SUCCESS },
sl@0
    65
        { ERequestNotificationCase, 0,              EGL_SUCCESS },
sl@0
    66
        { EWaitForNotificationCase, EExpectError,   KErrTimedOut, 0, 0, 100000 },
sl@0
    67
        { ECancelNotificationCase,  0,              EGL_SUCCESS },
sl@0
    68
        { EDestroyEndpointCase,     0,              EGL_SUCCESS },
sl@0
    69
        { ETerminateCase,           0,              EGL_SUCCESS },
sl@0
    70
        { EFinishedCase }
sl@0
    71
        },
sl@0
    72
    },
sl@0
    73
    {
sl@0
    74
        TESTIDS("606"),
sl@0
    75
        CASETITLE("Functional: Positive: eglRequestNotification with submitupdate first."),
sl@0
    76
        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
sl@0
    77
        {
sl@0
    78
        { EInitializeCase,          0,              EGL_SUCCESS },
sl@0
    79
        { ECreateSurfaceCase,       0,              EGL_SUCCESS, 0, EStandardSurface },
sl@0
    80
        { ECreateEndpointCase,      0,              EGL_SUCCESS },
sl@0
    81
        { EDrawContentCase,         0,              EGL_SUCCESS },
sl@0
    82
        { EContentUpdateCase,       0,              EGL_SUCCESS },
sl@0
    83
        { ERequestNotificationCase, 0,              EGL_SUCCESS },
sl@0
    84
        { EWaitForNotificationCase, 0,              KErrNone,    0, 0, 100000 },
sl@0
    85
        { ECancelNotificationCase,  0,              EGL_SUCCESS },
sl@0
    86
        { EDestroyEndpointCase,     0,              EGL_SUCCESS },
sl@0
    87
        { ETerminateCase,           0,              EGL_SUCCESS },
sl@0
    88
        { EFinishedCase }
sl@0
    89
        },
sl@0
    90
    },
sl@0
    91
    {
sl@0
    92
        TESTIDS("607A"),
sl@0
    93
        CASETITLE("Functional: Positive: eglRequestNotification with multiple endpoints."),
sl@0
    94
        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
sl@0
    95
        {
sl@0
    96
        { EInitializeCase,          0,              EGL_SUCCESS },
sl@0
    97
        { ECreateSurfaceCase,       0,              EGL_SUCCESS,  0, EStandardSurface },
sl@0
    98
        { ECreateSurfaceCase,       0,              EGL_SUCCESS,  1, EStandardSurface },
sl@0
    99
        { ECreateEndpointCase,      0,              EGL_SUCCESS,  0, 0 },
sl@0
   100
        { ECreateEndpointCase,      0,              EGL_SUCCESS,  1, 1},
sl@0
   101
        { EDrawContentCase,         0,              EGL_SUCCESS,  0, 0 },
sl@0
   102
        { EContentUpdateCase,       0,              EGL_SUCCESS,  0, 0 },
sl@0
   103
        { ERequestNotificationCase, 0,              EGL_SUCCESS,  0, 0 },
sl@0
   104
        { ERequestNotificationCase, 0,              EGL_SUCCESS,  1, 1 },
sl@0
   105
        { EWaitForNotificationCase, 0,              KErrNone,     0, 0, 100000 },
sl@0
   106
        { EWaitForNotificationCase, EExpectError,   KErrTimedOut, 1, 1, 100000 },
sl@0
   107
        { EDestroyEndpointCase,     0,              EGL_SUCCESS,  0, 0 },
sl@0
   108
        { EDestroyEndpointCase,     0,              EGL_SUCCESS,  1, 1 },
sl@0
   109
        { ETerminateCase,           0,              EGL_SUCCESS },
sl@0
   110
        { EFinishedCase }
sl@0
   111
        },
sl@0
   112
    },
sl@0
   113
    {
sl@0
   114
        TESTIDS("607B"),
sl@0
   115
        CASETITLE("Functional: Positive: Three endpoints, varying async notifications."),
sl@0
   116
        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
sl@0
   117
        {
sl@0
   118
        { EInitializeCase,          0,              EGL_SUCCESS },
sl@0
   119
        { ECreateSurfaceCase,       0,              EGL_SUCCESS,  0, EStandardSurface },
sl@0
   120
        { ECreateSurfaceCase,       0,              EGL_SUCCESS,  1, EStandardSurface },
sl@0
   121
        { ECreateSurfaceCase,       0,              EGL_SUCCESS,  2, EStandardSurface },
sl@0
   122
        { ECreateEndpointCase,      0,              EGL_SUCCESS,  0, 0 },
sl@0
   123
        { ECreateEndpointCase,      0,              EGL_SUCCESS,  1, 1},
sl@0
   124
        { ECreateEndpointCase,      0,              EGL_SUCCESS,  2, 2},
sl@0
   125
        { ERequestNotificationCase, 0,              EGL_SUCCESS,  0, 0 },
sl@0
   126
        { ERequestNotificationCase, 0,              EGL_SUCCESS,  1, 1 },
sl@0
   127
        { ERequestNotificationCase, 0,              EGL_SUCCESS,  2, 2 },
sl@0
   128
        { EDrawContentCase,         0,              EGL_SUCCESS,  1, 1 },
sl@0
   129
        { EContentUpdateCase,       0,              EGL_SUCCESS,  1, 1 },
sl@0
   130
        { EWaitForNotificationCase, 0,              KErrNone,     1, 1, 100000 },
sl@0
   131
        { EWaitForNotificationCase, EExpectError,   KErrTimedOut, 0, 0, 100000 },
sl@0
   132
        { EWaitForNotificationCase, EExpectError,   KErrTimedOut, 2, 2, 100000 },
sl@0
   133
        { EDrawContentCase,         0,              EGL_SUCCESS,  2, 2 },
sl@0
   134
        { EContentUpdateCase,       0,              EGL_SUCCESS,  2, 2 },
sl@0
   135
        { EWaitForNotificationCase, 0,              KErrNone,     2, 2, 100000 },
sl@0
   136
        { EWaitForNotificationCase, EExpectError,   KErrTimedOut, 0, 0, 100000 },
sl@0
   137
        { EWaitForNotificationCase, EExpectError,   KErrTimedOut, 1, 1, 100000 },
sl@0
   138
        { ECancelNotificationCase,  0,              EGL_SUCCESS,  0, 0 },
sl@0
   139
        { EWaitForNotificationCase, EExpectError,   KErrCancel,   0, 0, 10000 },
sl@0
   140
        { EDestroyEndpointCase,     0,              EGL_SUCCESS,  0, 0 },
sl@0
   141
        { EDestroyEndpointCase,     0,              EGL_SUCCESS,  1, 1 },
sl@0
   142
        { EDestroyEndpointCase,     0,              EGL_SUCCESS,  2, 2 },
sl@0
   143
        { ETerminateCase,           0,              EGL_SUCCESS },
sl@0
   144
        { EFinishedCase }
sl@0
   145
        },
sl@0
   146
    },
sl@0
   147
    {
sl@0
   148
        TESTIDS("608"),
sl@0
   149
        CASETITLE("Functional: Positive: Multiple eglRequestNotification with no acquire."),
sl@0
   150
        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
sl@0
   151
        {
sl@0
   152
        { EInitializeCase,          0,              EGL_SUCCESS },
sl@0
   153
        { ECreateSurfaceCase,       0,              EGL_SUCCESS, 0, EStandardSurface },
sl@0
   154
        { ECreateEndpointCase,      0,              EGL_SUCCESS },
sl@0
   155
        { EDrawContentCase,         0,              EGL_SUCCESS },
sl@0
   156
        { EContentUpdateCase,       0,              EGL_SUCCESS },
sl@0
   157
        { ERequestNotificationCase, 0,              EGL_SUCCESS },
sl@0
   158
        { EWaitForNotificationCase, 0,              KErrNone,    0, 0, 100000 },
sl@0
   159
        { ERequestNotificationCase, 0,              EGL_SUCCESS },
sl@0
   160
        { EWaitForNotificationCase, 0,              KErrNone,    0, 0, 100000 },
sl@0
   161
        { EDestroyEndpointCase,     0,              EGL_SUCCESS },
sl@0
   162
        { ETerminateCase,           0,              EGL_SUCCESS },
sl@0
   163
        { EFinishedCase }
sl@0
   164
        },
sl@0
   165
    },
sl@0
   166
    {
sl@0
   167
        TESTIDS("609"),
sl@0
   168
        CASETITLE("Functional: Positive: Notifications need submitupdate after acquire."),
sl@0
   169
        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
sl@0
   170
        {
sl@0
   171
        { EInitializeCase,          0,              EGL_SUCCESS },
sl@0
   172
        { ECreateSurfaceCase,       0,              EGL_SUCCESS, 0, EStandardSurface },
sl@0
   173
        { ECreateEndpointCase,      0,              EGL_SUCCESS },
sl@0
   174
        { EDrawContentCase,         0,              EGL_SUCCESS },
sl@0
   175
        { EContentUpdateCase,       0,              EGL_SUCCESS },
sl@0
   176
        { ERequestNotificationCase, 0,              EGL_SUCCESS },
sl@0
   177
        { EWaitForNotificationCase, 0,              KErrNone,   0, 0, 100000 },
sl@0
   178
        { EBeginStreamingCase,      0,              EGL_SUCCESS },
sl@0
   179
        { EAcquireImageCase,        0,              EGL_SUCCESS },
sl@0
   180
        { ERequestNotificationCase, 0,              EGL_SUCCESS },
sl@0
   181
        { EWaitForNotificationCase, EExpectError,   KErrTimedOut,0, 0, 100000 },
sl@0
   182
        { EContentUpdateCase,       ENoSync,        EGL_SUCCESS },
sl@0
   183
        { EWaitForNotificationCase, 0,              KErrNone,    0, 0, 100000 },
sl@0
   184
        { EDestroyEndpointCase,     0,              EGL_SUCCESS },
sl@0
   185
        { ETerminateCase,           0,              EGL_SUCCESS },
sl@0
   186
        { EFinishedCase }
sl@0
   187
        },
sl@0
   188
    },
sl@0
   189
    {
sl@0
   190
        TESTIDS("610"),
sl@0
   191
        CASETITLE("Functional: Positive: Destroy Endpoint acts as eglCancelNotificationNOK."),
sl@0
   192
        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
sl@0
   193
        {
sl@0
   194
        { EInitializeCase,          0,              EGL_SUCCESS },
sl@0
   195
        { ECreateSurfaceCase,       0,              EGL_SUCCESS, 0, EStandardSurface },
sl@0
   196
        { ECreateEndpointCase,      0,              EGL_SUCCESS },
sl@0
   197
        { ERequestNotificationCase, 0,              EGL_SUCCESS },
sl@0
   198
        { EDestroyEndpointCase,     0,              EGL_SUCCESS },
sl@0
   199
        { EWaitForNotificationCase, EExpectError,   KErrCancel, 0, 0, 100000 },
sl@0
   200
        { ETerminateCase,           0,              EGL_SUCCESS },
sl@0
   201
        { EFinishedCase }
sl@0
   202
        },
sl@0
   203
    },
sl@0
   204
    {
sl@0
   205
        TESTIDS("612"),
sl@0
   206
        CASETITLE("Functional: Positive: eglCancelNotificationNOK completes with KErrCancel."),
sl@0
   207
        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
sl@0
   208
        {
sl@0
   209
        { EInitializeCase,          0,              EGL_SUCCESS },
sl@0
   210
        { ECreateSurfaceCase,       0,              EGL_SUCCESS, 0, EStandardSurface },
sl@0
   211
        { ECreateEndpointCase,      0,              EGL_SUCCESS },
sl@0
   212
        { ERequestNotificationCase, 0,              EGL_SUCCESS },
sl@0
   213
        { ECancelNotificationCase,  0,              EGL_SUCCESS },
sl@0
   214
        { EWaitForNotificationCase, EExpectError,   KErrCancel, 0, 0, 100000 },
sl@0
   215
        { EDestroyEndpointCase,     0,              EGL_SUCCESS },
sl@0
   216
        { ETerminateCase,           0,              EGL_SUCCESS },
sl@0
   217
        { EFinishedCase }
sl@0
   218
        },
sl@0
   219
    },
sl@0
   220
    {
sl@0
   221
        TESTIDS("613"),
sl@0
   222
        CASETITLE("Functional: Positive: eglCancelNotificationNOK works after notification completed."),
sl@0
   223
        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
sl@0
   224
        {
sl@0
   225
        { EInitializeCase,          0,              EGL_SUCCESS },
sl@0
   226
        { ECreateSurfaceCase,       0,              EGL_SUCCESS, 0, EStandardSurface },
sl@0
   227
        { ECreateEndpointCase,      0,              EGL_SUCCESS },
sl@0
   228
        { ERequestNotificationCase, 0,              EGL_SUCCESS },
sl@0
   229
        { EContentUpdateCase,       0,              EGL_SUCCESS },
sl@0
   230
        { EWaitForNotificationCase, 0,              KErrNone,    0, 0, 100000 },
sl@0
   231
        { ECancelNotificationCase,  0,              EGL_SUCCESS },
sl@0
   232
        { EWaitForNotificationCase, EExpectError,   KErrTimedOut,0, 0, 100000 },
sl@0
   233
        { EDestroyEndpointCase,     0,              EGL_SUCCESS },
sl@0
   234
        { ETerminateCase,           0,              EGL_SUCCESS },
sl@0
   235
        { EFinishedCase }
sl@0
   236
        },
sl@0
   237
    },
sl@0
   238
};
sl@0
   239
sl@0
   240
static const TTestCase KNotifcationNegativeCases[] =
sl@0
   241
{
sl@0
   242
    {
sl@0
   243
        TESTIDS("560"),
sl@0
   244
        CASETITLE("Functional: Negative: eglRequestNotification bad parameter test."),
sl@0
   245
        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
sl@0
   246
        {
sl@0
   247
        { EInitializeCase,      0,              EGL_SUCCESS },
sl@0
   248
        { ECreateSurfaceCase,   0,              EGL_SUCCESS, 0, EStandardSurface },
sl@0
   249
        { ECreateEndpointCase,  0,              EGL_SUCCESS },
sl@0
   250
        // Bad display
sl@0
   251
        { ERequestNotificationCase, EUseBadDisplay, EGL_BAD_DISPLAY },
sl@0
   252
        { ERequestNotificationCase, EUseBadDisplay | EUseBadEndpoint, EGL_BAD_DISPLAY },
sl@0
   253
        { ERequestNotificationCase, EUseBadDisplay | EUseBadSync, EGL_BAD_DISPLAY },
sl@0
   254
        { ERequestNotificationCase, EUseBadDisplay | EUseBadEndpoint | EUseBadSync, EGL_BAD_DISPLAY },
sl@0
   255
        { ERequestNotificationCase, EUseBadEndpoint, EGL_BAD_ENDPOINT_NOK },
sl@0
   256
        { ERequestNotificationCase, EUseBadSync, EGL_BAD_PARAMETER },
sl@0
   257
        { EDestroyEndpointCase, 0,              EGL_SUCCESS },
sl@0
   258
        { ETerminateCase,       0,              EGL_SUCCESS },
sl@0
   259
        { EFinishedCase }
sl@0
   260
        },
sl@0
   261
    },
sl@0
   262
    {
sl@0
   263
        TESTIDS("562"),
sl@0
   264
        CASETITLE("Functional: Negative: eglCancelNotification bad parameter test."),
sl@0
   265
        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
sl@0
   266
        {
sl@0
   267
        { EInitializeCase,      0,              EGL_SUCCESS },
sl@0
   268
        { ECreateSurfaceCase,   0,              EGL_SUCCESS, 0, EStandardSurface },
sl@0
   269
        { ECreateEndpointCase,  0,              EGL_SUCCESS },
sl@0
   270
        // Bad display
sl@0
   271
        { ECancelNotificationCase, EUseBadDisplay, EGL_BAD_DISPLAY },
sl@0
   272
        { ECancelNotificationCase, EUseBadDisplay | EUseBadEndpoint, EGL_BAD_DISPLAY },
sl@0
   273
        { ECancelNotificationCase, EUseBadEndpoint, EGL_BAD_ENDPOINT_NOK },
sl@0
   274
        { EDestroyEndpointCase, 0,              EGL_SUCCESS },
sl@0
   275
        { ETerminateCase,       0,              EGL_SUCCESS },
sl@0
   276
        { EFinishedCase }
sl@0
   277
        },
sl@0
   278
    },
sl@0
   279
};
sl@0
   280
sl@0
   281
sl@0
   282
sl@0
   283
static const TTestCases KTestCases[] =
sl@0
   284
{
sl@0
   285
        TestCase(KNotifcationPositiveCases),
sl@0
   286
        TestCase(KNotifcationNegativeCases),
sl@0
   287
};
sl@0
   288
sl@0
   289
const TInt KNumberTestCases = sizeof(KTestCases) / sizeof(KTestCases[0]);
sl@0
   290
sl@0
   291
CEglTest_LocalTestStep_EndpointNotification::CEglTest_LocalTestStep_EndpointNotification():
sl@0
   292
    CEgltest_Local_Engine(KTestCases, KNumberTestCases)
sl@0
   293
    {
sl@0
   294
    }