sl@0: // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @test sl@0: @internalComponent - Internal Symbian test code sl@0: */ sl@0: sl@0: #include "egltest_endpointstreaming.h" sl@0: sl@0: sl@0: /** sl@0: @SYMTestCaseID GRAPHICS-EGL-04xx sl@0: sl@0: @SYMTestPriority 1 sl@0: sl@0: @SYMPREQ 2670 sl@0: sl@0: @SYMREQ sl@0: sl@0: @SYMTestCaseDesc sl@0: Test the behaviour of eglEndpointBeginStreamingNOK and eglEndpointEndStreamingNOK with and sl@0: without bad parameters. sl@0: sl@0: @SYMTestActions sl@0: Create a number of surfaces sl@0: For each test case in a loop sl@0: * start the test in the remote windows server side to create endpoints sl@0: * in the client side call a surface update on any surface which should have the ready sl@0: attribute set sl@0: * Send commands with parameters to the windows server process test render stage to sl@0: begin/end streaming on an end point. These parameters include any error codes which sl@0: is expected. sl@0: * Log any failures sl@0: If the procedure was successful release all the resources and check the heap for memory leaks. sl@0: No memory or handle leaks. sl@0: sl@0: @SYMTestExpectedResults sl@0: If the function fails, the return value is undefined and an error is generated. sl@0: If dpy is not the handle of a valid EGLDisplay object, the error EGL_BAD_DISPLAY is sl@0: generated for both BeginSreaming and EndStraming sl@0: If endpoint is not a valid EGLEndpointNOK object, the error EGL_BAD_ENDPOINT_NOK is sl@0: generated for both BeginStreaming and EndStraming. sl@0: If the endpoint is not ready,EGL_BAD_ACCESS is generated for calling BeginStreaming. sl@0: */ sl@0: sl@0: sl@0: static const TTestCase KStreamingPositiveCases[] = sl@0: { sl@0: { sl@0: TESTIDS("545A, 546A"), sl@0: CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Begin and Endstreaming only"), sl@0: SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered), sl@0: { sl@0: { EInitializeCase, 0, EGL_SUCCESS }, sl@0: { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface }, sl@0: { ECreateEndpointCase, 0, EGL_SUCCESS }, sl@0: { EDrawContentCase, 0, EGL_SUCCESS }, sl@0: { EContentUpdateCase, 0, EGL_SUCCESS }, sl@0: { EBeginStreamingCase, 0, EGL_SUCCESS }, sl@0: { EEndStreamingCase, 0, EGL_SUCCESS }, sl@0: { EDestroyEndpointCase, 0, EGL_SUCCESS }, sl@0: { ETerminateCase, 0, EGL_SUCCESS }, sl@0: { EFinishedCase } sl@0: }, sl@0: }, sl@0: { sl@0: TESTIDS("545B, 546B"), sl@0: CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Begin, twice, then Endstreaming"), sl@0: SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered), sl@0: { sl@0: { EInitializeCase, 0, EGL_SUCCESS }, sl@0: { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface }, sl@0: { ECreateEndpointCase, 0, EGL_SUCCESS }, sl@0: { EDrawContentCase, 0, EGL_SUCCESS }, sl@0: { EContentUpdateCase, 0, EGL_SUCCESS }, sl@0: { EBeginStreamingCase, 0, EGL_SUCCESS }, sl@0: { EBeginStreamingCase, 0, EGL_SUCCESS }, sl@0: { EEndStreamingCase, 0, EGL_SUCCESS }, sl@0: { EDestroyEndpointCase, 0, EGL_SUCCESS }, sl@0: { ETerminateCase, 0, EGL_SUCCESS }, sl@0: { EFinishedCase } sl@0: }, sl@0: }, sl@0: { sl@0: TESTIDS("545C, 546C"), sl@0: CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Begin then Endstreaming twice"), sl@0: SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered), sl@0: { sl@0: { EInitializeCase, 0, EGL_SUCCESS }, sl@0: { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface }, sl@0: { ECreateEndpointCase, 0, EGL_SUCCESS }, sl@0: { EDrawContentCase, 0, EGL_SUCCESS }, sl@0: { EContentUpdateCase, 0, EGL_SUCCESS }, sl@0: { EBeginStreamingCase, 0, EGL_SUCCESS }, sl@0: { EEndStreamingCase, 0, EGL_SUCCESS }, sl@0: { EEndStreamingCase, 0, EGL_SUCCESS }, sl@0: { EDestroyEndpointCase, 0, EGL_SUCCESS }, sl@0: { ETerminateCase, 0, EGL_SUCCESS }, sl@0: { EFinishedCase } sl@0: }, sl@0: }, sl@0: // Now check that we can and can't acquire images when in or out of a streaming block. sl@0: { sl@0: TESTIDS("545D, 546D"), sl@0: CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Beginstreaming, acquire, endstreaming"), sl@0: SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered), sl@0: { sl@0: { EInitializeCase, 0, EGL_SUCCESS }, sl@0: { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface }, sl@0: { ECreateEndpointCase, 0, EGL_SUCCESS }, sl@0: { EDrawContentCase, 0, EGL_SUCCESS }, sl@0: { EContentUpdateCase, 0, EGL_SUCCESS }, sl@0: { EBeginStreamingCase, 0, EGL_SUCCESS }, sl@0: { EAcquireImageCase, 0, EGL_SUCCESS }, sl@0: { ECompareImageCase, 0, EGL_SUCCESS }, sl@0: { EEndStreamingCase, 0, EGL_SUCCESS }, sl@0: { EDestroyEndpointCase, 0, EGL_SUCCESS }, sl@0: { ETerminateCase, 0, EGL_SUCCESS }, sl@0: { EFinishedCase } sl@0: }, sl@0: }, sl@0: { sl@0: TESTIDS("545E, 546E"), sl@0: CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Beginstreaming, endstreaming, acquire"), sl@0: SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered), sl@0: { sl@0: { EInitializeCase, 0, EGL_SUCCESS }, sl@0: { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface }, sl@0: { ECreateEndpointCase, 0, EGL_SUCCESS }, sl@0: { EDrawContentCase, 0, EGL_SUCCESS }, sl@0: { EContentUpdateCase, 0, EGL_SUCCESS }, sl@0: { EBeginStreamingCase, 0, EGL_SUCCESS }, sl@0: { EEndStreamingCase, 0, EGL_SUCCESS }, sl@0: { EAcquireImageCase, EExpectError, EGL_BAD_ACCESS }, sl@0: { EDestroyEndpointCase, 0, EGL_SUCCESS }, sl@0: { ETerminateCase, 0, EGL_SUCCESS }, sl@0: { EFinishedCase } sl@0: }, sl@0: }, sl@0: { sl@0: TESTIDS("545F, 546F"), sl@0: CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Beginstreaming twice, endstreaming, acquire"), sl@0: SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered), sl@0: { sl@0: { EInitializeCase, 0, EGL_SUCCESS }, sl@0: { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface }, sl@0: { ECreateEndpointCase, 0, EGL_SUCCESS }, sl@0: { EDrawContentCase, 0, EGL_SUCCESS }, sl@0: { EContentUpdateCase, 0, EGL_SUCCESS }, sl@0: { EBeginStreamingCase, 0, EGL_SUCCESS }, sl@0: { EBeginStreamingCase, 0, EGL_SUCCESS }, sl@0: { EEndStreamingCase, 0, EGL_SUCCESS }, sl@0: { EAcquireImageCase, EExpectError, EGL_BAD_ACCESS }, sl@0: { EDestroyEndpointCase, 0, EGL_SUCCESS }, sl@0: { ETerminateCase, 0, EGL_SUCCESS }, sl@0: { EFinishedCase } sl@0: }, sl@0: }, sl@0: { sl@0: TESTIDS("545G, 546G"), sl@0: CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Beginstreaming, endstreaming twice, beginstreaming, acquire"), sl@0: SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered), sl@0: { sl@0: { EInitializeCase, 0, EGL_SUCCESS }, sl@0: { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface }, sl@0: { ECreateEndpointCase, 0, EGL_SUCCESS }, sl@0: { EDrawContentCase, 0, EGL_SUCCESS }, sl@0: { EContentUpdateCase, 0, EGL_SUCCESS }, sl@0: { EBeginStreamingCase, 0, EGL_SUCCESS }, sl@0: { EEndStreamingCase, 0, EGL_SUCCESS }, sl@0: { EEndStreamingCase, 0, EGL_SUCCESS }, sl@0: { EDrawContentCase, 0, EGL_SUCCESS }, sl@0: { EContentUpdateCase, 0, EGL_SUCCESS }, sl@0: { EBeginStreamingCase, 0, EGL_SUCCESS }, sl@0: { EAcquireImageCase, 0, EGL_SUCCESS }, sl@0: { ECompareImageCase, 0, EGL_SUCCESS }, sl@0: { EEndStreamingCase, 0, EGL_SUCCESS }, sl@0: { EDestroyEndpointCase, 0, EGL_SUCCESS }, sl@0: { ETerminateCase, 0, EGL_SUCCESS }, sl@0: { EFinishedCase } sl@0: }, sl@0: }, sl@0: { sl@0: TESTIDS("545H, 546H"), sl@0: CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Beginstreaming, destroy, create, acquire (not ready)"), sl@0: SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered), sl@0: { sl@0: { EInitializeCase, 0, EGL_SUCCESS }, sl@0: { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface }, sl@0: { ECreateEndpointCase, 0, EGL_SUCCESS }, sl@0: { EDrawContentCase, 0, EGL_SUCCESS }, sl@0: { EContentUpdateCase, 0, EGL_SUCCESS }, sl@0: { EBeginStreamingCase, 0, EGL_SUCCESS }, sl@0: { EDestroyEndpointCase, 0, EGL_SUCCESS }, sl@0: { ECreateEndpointCase, 0, EGL_SUCCESS }, sl@0: // We should get bad access, as the endpoint is not ready! sl@0: { EAcquireImageCase, EExpectError, EGL_BAD_ACCESS }, sl@0: { EEndStreamingCase, 0, EGL_SUCCESS }, sl@0: { EDestroyEndpointCase, 0, EGL_SUCCESS }, sl@0: { ETerminateCase, 0, EGL_SUCCESS }, sl@0: { EFinishedCase } sl@0: }, sl@0: }, sl@0: { sl@0: TESTIDS("545I, 546I"), sl@0: CASETITLE("Functional: Positive: eglEndpointBeginStreamingNOK & eglEndpointEndStreamingNOK with Valid Parameters: Beginstreaming, destroy, create, acquire (ready)"), sl@0: SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered), sl@0: { sl@0: { EInitializeCase, 0, EGL_SUCCESS }, sl@0: { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface }, sl@0: { ECreateEndpointCase, 0, EGL_SUCCESS }, sl@0: { EDrawContentCase, 0, EGL_SUCCESS }, sl@0: { EContentUpdateCase, 0, EGL_SUCCESS }, sl@0: { EBeginStreamingCase, 0, EGL_SUCCESS }, sl@0: { EDestroyEndpointCase, 0, EGL_SUCCESS }, sl@0: { ECreateEndpointCase, 0, EGL_SUCCESS }, sl@0: { EDrawContentCase, 0, EGL_SUCCESS }, sl@0: { EContentUpdateCase, 0, EGL_SUCCESS }, sl@0: // We should get bad access, as the endpoint is not in a streaming block! sl@0: { EAcquireImageCase, EExpectError, EGL_BAD_ACCESS }, sl@0: { EEndStreamingCase, 0, EGL_SUCCESS }, sl@0: { EDestroyEndpointCase, 0, EGL_SUCCESS }, sl@0: { ETerminateCase, 0, EGL_SUCCESS }, sl@0: { EFinishedCase } sl@0: }, sl@0: }, sl@0: }; sl@0: sl@0: static const TTestCase KStreamingBadParameterCases[] = sl@0: { sl@0: { sl@0: TESTIDS("553A"), sl@0: CASETITLE("Functional: Negative: eglEndpointBeginStreamingNOK with Bad Parameters: Test eglEndpointBeginStreaming bad parameter variations"), sl@0: SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered), sl@0: { sl@0: { EInitializeCase, 0, EGL_SUCCESS }, sl@0: { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface }, sl@0: { ECreateEndpointCase, 0, EGL_SUCCESS }, sl@0: { EDrawContentCase, 0, EGL_SUCCESS }, sl@0: { EContentUpdateCase, 0, EGL_SUCCESS }, sl@0: // Bad display on it's own. sl@0: { EBeginStreamingCase, EUseBadDisplay, EGL_BAD_DISPLAY }, sl@0: // Bad display should be priority over the bad endpoint sl@0: { EBeginStreamingCase, EUseBadDisplay | EUseBadEndpoint, EGL_BAD_DISPLAY }, sl@0: // Bad endpoint should result in "BAD_ENDPOINT" error. sl@0: { EBeginStreamingCase, EUseBadEndpoint, EGL_BAD_ENDPOINT_NOK }, sl@0: { EEndStreamingCase, 0, EGL_SUCCESS }, sl@0: { EDestroyEndpointCase, 0, EGL_SUCCESS }, sl@0: { ETerminateCase, 0, EGL_SUCCESS }, sl@0: { EFinishedCase } sl@0: }, sl@0: }, sl@0: { sl@0: TESTIDS("554A"), sl@0: CASETITLE("Functional: Negative: eglEndpointEndStreamingNOK with Bad Parameters: Test eglEndpointEndStreaming bad parameter variations"), sl@0: SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered), sl@0: { sl@0: { EInitializeCase, 0, EGL_SUCCESS }, sl@0: { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface }, sl@0: { ECreateEndpointCase, 0, EGL_SUCCESS }, sl@0: { EDrawContentCase, 0, EGL_SUCCESS }, sl@0: { EContentUpdateCase, 0, EGL_SUCCESS }, sl@0: // Bad display on it's own. sl@0: { EEndStreamingCase, EUseBadDisplay, EGL_BAD_DISPLAY }, sl@0: // Bad display should be priority over the bad endpoint sl@0: { EEndStreamingCase, EUseBadDisplay | EUseBadEndpoint, EGL_BAD_DISPLAY }, sl@0: { EEndStreamingCase, EUseBadEndpoint, EGL_BAD_ENDPOINT_NOK }, sl@0: { EEndStreamingCase, 0, EGL_SUCCESS }, sl@0: { EDestroyEndpointCase, 0, EGL_SUCCESS }, sl@0: { ETerminateCase, 0, EGL_SUCCESS }, sl@0: { EFinishedCase } sl@0: }, sl@0: }, sl@0: }; sl@0: sl@0: static const TTestCase KStreamingNegativeCases[] = sl@0: { sl@0: { sl@0: TESTIDS("553B"), sl@0: CASETITLE("Functional: Negative: eglEndpointBeginStreamingNOK with Bad Parameters: eglEndpointBeginStreaming with no contentupdate"), sl@0: SurfaceTypes3(ESurfTypeRaw, ESurfTypeEglWindow, ESurfTypeRawSingleBuffered), sl@0: { sl@0: { EInitializeCase, 0, EGL_SUCCESS }, sl@0: { ECreateSurfaceCase, 0, EGL_SUCCESS, 0, EStandardSurface }, sl@0: { ECreateEndpointCase, 0, EGL_SUCCESS }, sl@0: { EBeginStreamingCase, EExpectError, EGL_BAD_ACCESS }, sl@0: { EDrawContentCase, 0, EGL_SUCCESS }, sl@0: { EContentUpdateCase, 0, EGL_SUCCESS }, sl@0: { EBeginStreamingCase, 0, EGL_SUCCESS }, sl@0: { EDestroyEndpointCase, 0, EGL_SUCCESS }, sl@0: { ETerminateCase, 0, EGL_SUCCESS }, sl@0: { EFinishedCase } sl@0: }, sl@0: }, sl@0: }; sl@0: sl@0: static const TTestCases KTestCases[] = sl@0: { sl@0: TestCase(KStreamingPositiveCases), sl@0: TestCase(KStreamingBadParameterCases), sl@0: TestCase(KStreamingNegativeCases), sl@0: }; sl@0: sl@0: const TInt KNumberTestCases = sizeof(KTestCases) / sizeof(KTestCases[0]); sl@0: sl@0: CEglTest_LocalTestStep_EndpointStreaming::CEglTest_LocalTestStep_EndpointStreaming(): sl@0: CEgltest_Local_Engine(KTestCases, KNumberTestCases) sl@0: { sl@0: }