os/graphics/egl/egltest/endpointtestsuite/automated/tsrc/egltest_endpointdirtyarea.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_endpointdirtyarea.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,146 @@
     1.4 +// Copyright (c) 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 +// Testing of eglEndpointDirtyAreaNOK functionality.
    1.18 +//
    1.19 +
    1.20 +/**
    1.21 + @file
    1.22 + @test
    1.23 + @internalComponent - Internal Symbian test code
    1.24 +*/
    1.25 +
    1.26 +#include "egltest_endpointdirtyarea.h"
    1.27 +
    1.28 +static const TTestCase KDirtyAreaPositiveCases[] =
    1.29 +{
    1.30 +    {
    1.31 +        TESTIDS("614"),
    1.32 +        CASETITLE("Functional: Positive: eglGetEndpointDirtyArea basic test."),
    1.33 +        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
    1.34 +        {
    1.35 +        { EInitializeCase,           0,              EGL_SUCCESS },
    1.36 +        { ECreateSurfaceCase,        0,              EGL_SUCCESS, 0, EStandardSurface },
    1.37 +        { ECreateEndpointCase,       0,              EGL_SUCCESS },
    1.38 +        { EDrawContentCase,          0,              EGL_SUCCESS },
    1.39 +        { EContentUpdateCase,        0,              EGL_SUCCESS },
    1.40 +        { EBeginStreamingCase,       0,              EGL_SUCCESS },
    1.41 +        { EAcquireImageCase,         0,              EGL_SUCCESS },
    1.42 +        { EGetEndpointDirtyAreaCase, 0,              EGL_SUCCESS, 0, 0, 0, 1 },
    1.43 +        { EReleaseImageCase,         0,              EGL_SUCCESS },
    1.44 +        { EDestroyEndpointCase,      0,              EGL_SUCCESS },
    1.45 +        { ETerminateCase,            0,              EGL_SUCCESS },
    1.46 +        { EFinishedCase }
    1.47 +        },
    1.48 +    },
    1.49 +    {
    1.50 +        TESTIDS("615"),
    1.51 +        CASETITLE("Functional: Positive: eglGetEndpointDirtyArea simple working test - collapse area."),
    1.52 +        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
    1.53 +        {
    1.54 +        { EInitializeCase,           0,                EGL_SUCCESS },
    1.55 +        { ECreateSurfaceCase,        0,                EGL_SUCCESS, 0, EStandardSurface },
    1.56 +        { ECreateEndpointCase,       0,                EGL_SUCCESS },
    1.57 +        { EDrawContentCase,          0,                EGL_SUCCESS },
    1.58 +        { EContentUpdateCase,        0,                EGL_SUCCESS },
    1.59 +        { EBeginStreamingCase,       0,                EGL_SUCCESS },
    1.60 +        { EAcquireImageCase,         0,                EGL_SUCCESS },
    1.61 +        { EGetEndpointDirtyAreaCase, EUseCollapseArea, EGL_SUCCESS, 0, 0, 0, 2 },
    1.62 +        { EReleaseImageCase,         0,                EGL_SUCCESS },
    1.63 +        { EDestroyEndpointCase,      0,                EGL_SUCCESS },
    1.64 +        { ETerminateCase,            0,                EGL_SUCCESS },
    1.65 +        { EFinishedCase }
    1.66 +        },
    1.67 +    },
    1.68 +    {
    1.69 +        TESTIDS("617"),
    1.70 +        CASETITLE("Functional: Positive: eglGetEndpointDirtyArea - check number of rects avialable"),
    1.71 +        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
    1.72 +        {
    1.73 +        { EInitializeCase,           0,              EGL_SUCCESS },
    1.74 +        { ECreateSurfaceCase,        0,              EGL_SUCCESS, 0, EStandardSurface },
    1.75 +        { ECreateEndpointCase,       0,              EGL_SUCCESS },
    1.76 +        { EDrawContentCase,          0,              EGL_SUCCESS },
    1.77 +        { EContentUpdateCase,        0,              EGL_SUCCESS },
    1.78 +        { EBeginStreamingCase,       0,              EGL_SUCCESS },
    1.79 +        { EAcquireImageCase,         0,              EGL_SUCCESS },
    1.80 +        { EGetEndpointDirtyAreaCase, EUseNullRects,  EGL_SUCCESS, 0, 0, 0, 0 },
    1.81 +        { EReleaseImageCase,         0,              EGL_SUCCESS },
    1.82 +        { EDestroyEndpointCase,      0,              EGL_SUCCESS },
    1.83 +        { ETerminateCase,            0,              EGL_SUCCESS },
    1.84 +        { EFinishedCase }
    1.85 +        },
    1.86 +    },
    1.87 +};
    1.88 +static const TTestCase KDirtyAreaNegativeCases[] =
    1.89 +{
    1.90 +    {
    1.91 +        TESTIDS("616"),
    1.92 +        CASETITLE("Functional: Negative: eglRequestNotification bad parameter test."),
    1.93 +        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
    1.94 +        {
    1.95 +        { EInitializeCase,           0,                    EGL_SUCCESS },
    1.96 +        { ECreateSurfaceCase,        0,                    EGL_SUCCESS, 0, EStandardSurface },
    1.97 +        { ECreateEndpointCase,       0,                    EGL_SUCCESS },
    1.98 +        { EDrawContentCase,          0,                    EGL_SUCCESS },
    1.99 +        { EContentUpdateCase,        0,                    EGL_SUCCESS },
   1.100 +        { EBeginStreamingCase,       0,                    EGL_SUCCESS },
   1.101 +        { EAcquireImageCase,         0,                    EGL_SUCCESS },
   1.102 +        // Bad display
   1.103 +        { EGetEndpointDirtyAreaCase, EUseBadDisplay,       EGL_BAD_DISPLAY },
   1.104 +        { EGetEndpointDirtyAreaCase, EUseBadDisplay | EUseBadEndpoint, EGL_BAD_DISPLAY },
   1.105 +        { EGetEndpointDirtyAreaCase, EUseBadDisplay | EUseBadRects, EGL_BAD_DISPLAY },
   1.106 +        { EGetEndpointDirtyAreaCase, EUseBadDisplay | EUseBadEndpoint | EUseBadRects, EGL_BAD_DISPLAY },
   1.107 +        { EGetEndpointDirtyAreaCase, EUseBadEndpoint,      EGL_BAD_ENDPOINT_NOK },
   1.108 +        { EGetEndpointDirtyAreaCase, EUseBadRects,         EGL_BAD_PARAMETER, 0, 0, 0, 1 },
   1.109 +        // All zeros, but not NULL rects -> bad parameter error.
   1.110 +        { EGetEndpointDirtyAreaCase, EExpectError,         EGL_BAD_PARAMETER, 0, 0, 0, 0 },
   1.111 +        { EDestroyEndpointCase, 0,                         EGL_SUCCESS },
   1.112 +        { ETerminateCase,       0,                         EGL_SUCCESS },
   1.113 +        { EFinishedCase }
   1.114 +        },
   1.115 +    },
   1.116 +    {
   1.117 +        TESTIDS("618"),
   1.118 +        CASETITLE("Functional: Negative: eglRequestNotification no acquired image."),
   1.119 +        SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered),
   1.120 +        {
   1.121 +        { EInitializeCase,           0,                    EGL_SUCCESS },
   1.122 +        { ECreateSurfaceCase,        0,                    EGL_SUCCESS, 0, EStandardSurface },
   1.123 +        { ECreateEndpointCase,       0,                    EGL_SUCCESS },
   1.124 +        { EDrawContentCase,          0,                    EGL_SUCCESS },
   1.125 +        { EContentUpdateCase,        0,                    EGL_SUCCESS },
   1.126 +        { EBeginStreamingCase,       0,                    EGL_SUCCESS },
   1.127 +        { EGetEndpointDirtyAreaCase, EExpectError,         EGL_BAD_ACCESS, 0, 0, 0, 1 },
   1.128 +        { EGetEndpointDirtyAreaCase, EUseNullRects|EExpectError, EGL_BAD_ACCESS, 0, 0, 0, 0 },
   1.129 +        { EDestroyEndpointCase, 0,                         EGL_SUCCESS },
   1.130 +        { ETerminateCase,       0,                         EGL_SUCCESS },
   1.131 +        { EFinishedCase }
   1.132 +        },
   1.133 +    },
   1.134 +
   1.135 +};
   1.136 +
   1.137 +
   1.138 +static const TTestCases KTestCases[] =
   1.139 +{
   1.140 +        TestCase(KDirtyAreaPositiveCases),
   1.141 +        TestCase(KDirtyAreaNegativeCases),
   1.142 +};
   1.143 +
   1.144 +const TInt KNumberTestCases = sizeof(KTestCases) / sizeof(KTestCases[0]);
   1.145 +
   1.146 +CEglTest_LocalTestStep_EndpointDirtyArea::CEglTest_LocalTestStep_EndpointDirtyArea():
   1.147 +    CEgltest_Local_Engine(KTestCases, KNumberTestCases)
   1.148 +    {
   1.149 +    }