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: // Description: 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: sl@0: #include "tflowwindowstestopenglvg.h" sl@0: #include "tflowwindowopengl.h" sl@0: #include "tflowwindowopenvg.h" sl@0: #include "tsmallwindowraster.h" sl@0: #include "tflowwindowscontroller.h" sl@0: sl@0: sl@0: _LIT(KTestStep0002,"GRAPHICS-UI-BENCH-S60-0002"); sl@0: _LIT(KSectNameOpenGLVGTest, "OpenGLVGTest"); sl@0: _LIT(KKeyNamePreload, "Preload"); sl@0: _LIT(KKeyNameFiles, "Files"); sl@0: _LIT(KKeyNameWindowWidth, "WindowWidth"); sl@0: _LIT(KKeyNameWindowHeight, "WindowHeight"); sl@0: sl@0: CTFlowWindowsTestOpenGLVG::CTFlowWindowsTestOpenGLVG() sl@0: { sl@0: SetTestStepName(KTFlowWindowsOpenGLVG); sl@0: } sl@0: sl@0: CTFlowWindowsTestOpenGLVG::~CTFlowWindowsTestOpenGLVG() sl@0: { sl@0: delete iFlowWindowsController; sl@0: iFileNames.Close(); sl@0: } sl@0: sl@0: TVerdict CTFlowWindowsTestOpenGLVG::doTestStepPreambleL() sl@0: { sl@0: CTe_graphicsperformanceSuiteStepBase::doTestStepPreambleL(); sl@0: sl@0: iPreload = EFalse; // default behaviour sl@0: GetBoolFromConfig(KSectNameOpenGLVGTest, KKeyNamePreload, iPreload); sl@0: sl@0: TSize windowSize = CTWindow::GetDisplaySizeInPixels(); sl@0: GetIntFromConfig(KSectNameOpenGLVGTest, KKeyNameWindowWidth, windowSize.iWidth); sl@0: GetIntFromConfig(KSectNameOpenGLVGTest, KKeyNameWindowHeight, windowSize.iHeight); sl@0: TPtrC fileNameList; sl@0: TEST(GetStringFromConfig(KSectNameOpenGLVGTest, KKeyNameFiles, fileNameList)); sl@0: ExtractListL(fileNameList, iFileNames); sl@0: iIterationsToTest = windowSize.iWidth * iFileNames.Count(); sl@0: sl@0: RArray initialPositions; sl@0: RArray windowCreatorFunctions; sl@0: TPoint initialPosition(0, 0); sl@0: CleanupClosePushL(initialPositions); sl@0: CleanupClosePushL(windowCreatorFunctions); sl@0: windowCreatorFunctions.AppendL(CTFlowWindowOpenGL::NewL); sl@0: initialPositions.AppendL(initialPosition); sl@0: sl@0: windowCreatorFunctions.AppendL(CTFlowWindowOpenVG::NewL); sl@0: initialPosition.iX += windowSize.iWidth; sl@0: initialPositions.AppendL(initialPosition); sl@0: sl@0: windowCreatorFunctions.AppendL(CTSmallWindowRaster::NewL); sl@0: initialPosition.iX += windowSize.iWidth; sl@0: initialPositions.AppendL(initialPosition); sl@0: sl@0: iFlowWindowsController = CTFlowWindowsController::NewL(ETrue, iFileNames, windowSize, windowCreatorFunctions, initialPositions, EFalse); sl@0: CleanupStack::PopAndDestroy(2, &initialPositions); sl@0: return TestStepResult(); sl@0: } sl@0: sl@0: /** sl@0: Override of base class pure virtual sl@0: Our implementation only gets called if the base class doTestStepPreambleL() did sl@0: not leave. sl@0: sl@0: @return - TVerdict code sl@0: */ sl@0: TVerdict CTFlowWindowsTestOpenGLVG::doTestStepL() sl@0: { sl@0: SetTestStepID(KTestStep0002); sl@0: TRAPD(err, FlowOpenGLVGWindowsL()); sl@0: if (err != KErrNone) sl@0: { sl@0: SetTestStepResult(EAbort); sl@0: } sl@0: return TestStepResult(); sl@0: } sl@0: sl@0: /** sl@0: @SYMTestCaseID sl@0: GRAPHICS-UI-BENCH-S60-0002 sl@0: sl@0: @SYMTestCaseDesc sl@0: Tests how long it takes to moves windows over the screen. sl@0: sl@0: @SYMTestActions sl@0: Creates windows which draw bitmaps, OpenVG and OpenGL ES content and moves them over the screen. sl@0: sl@0: @SYMTestExpectedResults sl@0: Test should pass and write the average framerate of the test to a log file. sl@0: */ sl@0: void CTFlowWindowsTestOpenGLVG::FlowOpenGLVGWindowsL() sl@0: { sl@0: iProfiler->InitResults(); sl@0: iIterationsToTest = 25; sl@0: for (TInt i = 0; i < iIterationsToTest; ++i) sl@0: { sl@0: iFlowWindowsController->MoveL(); sl@0: } sl@0: iProfiler->MarkResultSetL(); sl@0: TSize windowSize = CTWindow::GetDisplaySizeInPixels(); sl@0: iProfiler->ResultsAnalysisFrameRate(KTestStep0002, 0, 0, 0, iIterationsToTest, windowSize.iWidth * windowSize.iHeight); sl@0: }