author | sl@SLION-WIN7.fritz.box |
Fri, 15 Jun 2012 03:10:57 +0200 | |
changeset 0 | bde4ae8d615e |
permissions | -rw-r--r-- |
sl@0 | 1 |
// Copyright (c) 2006-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 |
// Description: |
sl@0 | 14 |
// |
sl@0 | 15 |
|
sl@0 | 16 |
/** |
sl@0 | 17 |
@file |
sl@0 | 18 |
@test |
sl@0 | 19 |
*/ |
sl@0 | 20 |
|
sl@0 | 21 |
#include "te_graphicsperformancesuiteserver_s60.h" |
sl@0 | 22 |
#include "ttextlistscroll.h" |
sl@0 | 23 |
#include "tfullscreentext.h" |
sl@0 | 24 |
#include "tuiandvideo.h" |
sl@0 | 25 |
#include "tcomplexfonts.h" |
sl@0 | 26 |
#include "tfontmultiplesizes.h" |
sl@0 | 27 |
#include "tpan.h" |
sl@0 | 28 |
#include "tscale.h" |
sl@0 | 29 |
#include "tflowwindowstest.h" |
sl@0 | 30 |
#include "trotateteststep.h" |
sl@0 | 31 |
#include "tflowwindowstestopenglvg.h" |
sl@0 | 32 |
#include "tsmallwindowstest.h" |
sl@0 | 33 |
#include "tsmallwindowstestopengl.h" |
sl@0 | 34 |
#include "tsmallwindowstestzoom.h" |
sl@0 | 35 |
#include "tzorder.h" |
sl@0 | 36 |
#include "tzordermultiplesurfaces.h" |
sl@0 | 37 |
#include "tsmallwindowstestopenvg.h" |
sl@0 | 38 |
#include "tsmallwindowstestraster.h" |
sl@0 | 39 |
#include "tcopyrect.h" |
sl@0 | 40 |
|
sl@0 | 41 |
|
sl@0 | 42 |
/** |
sl@0 | 43 |
Same code for Secure and non-secure variants |
sl@0 | 44 |
Called inside the MainL() function to create and start the |
sl@0 | 45 |
CTestServer derived server. |
sl@0 | 46 |
|
sl@0 | 47 |
@return - Instance of the test server |
sl@0 | 48 |
*/ |
sl@0 | 49 |
CTe_graphicsperformanceSuite_S60* CTe_graphicsperformanceSuite_S60::NewL() |
sl@0 | 50 |
{ |
sl@0 | 51 |
CTe_graphicsperformanceSuite_S60 * server = new (ELeave) CTe_graphicsperformanceSuite_S60(); |
sl@0 | 52 |
CleanupStack::PushL(server); |
sl@0 | 53 |
|
sl@0 | 54 |
// Get server name from process so we can use SetCap to change the capabilites and use this server with a different filename |
sl@0 | 55 |
RProcess handle = RProcess(); |
sl@0 | 56 |
TParsePtrC serverName(handle.FileName()); |
sl@0 | 57 |
|
sl@0 | 58 |
server->ConstructL(serverName.Name()); |
sl@0 | 59 |
CleanupStack::Pop(server); |
sl@0 | 60 |
return server; |
sl@0 | 61 |
} |
sl@0 | 62 |
|
sl@0 | 63 |
|
sl@0 | 64 |
/** |
sl@0 | 65 |
MainL - uses the new Rendezvous() call to sync with the client |
sl@0 | 66 |
*/ |
sl@0 | 67 |
LOCAL_C void MainL() |
sl@0 | 68 |
{ |
sl@0 | 69 |
// Active scheduler only for this thread. Test need to create own active scheduler |
sl@0 | 70 |
CActiveScheduler* scheduler = new(ELeave) CActiveScheduler; |
sl@0 | 71 |
CActiveScheduler::Install(scheduler); |
sl@0 | 72 |
|
sl@0 | 73 |
CTe_graphicsperformanceSuite_S60* server = NULL; |
sl@0 | 74 |
|
sl@0 | 75 |
// Create the CTestServer derived server |
sl@0 | 76 |
TRAPD(err,server = CTe_graphicsperformanceSuite_S60::NewL()); |
sl@0 | 77 |
if(!err) |
sl@0 | 78 |
{ |
sl@0 | 79 |
// Sync with the client and enter the active scheduler |
sl@0 | 80 |
RProcess::Rendezvous(KErrNone); |
sl@0 | 81 |
scheduler->Start(); |
sl@0 | 82 |
} |
sl@0 | 83 |
delete server; |
sl@0 | 84 |
delete scheduler; |
sl@0 | 85 |
} |
sl@0 | 86 |
|
sl@0 | 87 |
/** |
sl@0 | 88 |
Secure variant only |
sl@0 | 89 |
Process entry point. Called by client using RProcess API |
sl@0 | 90 |
|
sl@0 | 91 |
@return - Standard Epoc error code on process exit |
sl@0 | 92 |
*/ |
sl@0 | 93 |
GLDEF_C TInt E32Main() |
sl@0 | 94 |
{ |
sl@0 | 95 |
__UHEAP_MARK; |
sl@0 | 96 |
CTrapCleanup* cleanup = CTrapCleanup::New(); |
sl@0 | 97 |
if(cleanup == NULL) |
sl@0 | 98 |
{ |
sl@0 | 99 |
return KErrNoMemory; |
sl@0 | 100 |
} |
sl@0 | 101 |
TRAPD(err,MainL()); |
sl@0 | 102 |
delete cleanup; |
sl@0 | 103 |
__UHEAP_MARKEND; |
sl@0 | 104 |
return err; |
sl@0 | 105 |
} |
sl@0 | 106 |
|
sl@0 | 107 |
/** |
sl@0 | 108 |
Secure and non-secure variants |
sl@0 | 109 |
Implementation of CTestServer pure virtual |
sl@0 | 110 |
|
sl@0 | 111 |
@return - A CTestStep derived instance |
sl@0 | 112 |
*/ |
sl@0 | 113 |
CTestStep* CTe_graphicsperformanceSuite_S60::CreateTestStep(const TDesC& aStepName) |
sl@0 | 114 |
{ |
sl@0 | 115 |
CTestStep* testStep = NULL; |
sl@0 | 116 |
if (aStepName == KTTextListScroll) |
sl@0 | 117 |
{ |
sl@0 | 118 |
testStep = new CTTextListScroll(); |
sl@0 | 119 |
} |
sl@0 | 120 |
else if (aStepName == KFullScreenText) |
sl@0 | 121 |
{ |
sl@0 | 122 |
testStep = new CTFullScreenText(); |
sl@0 | 123 |
} |
sl@0 | 124 |
else if(aStepName == KTUiAndVideo) |
sl@0 | 125 |
{ |
sl@0 | 126 |
testStep = new CTUiAndVideo(); |
sl@0 | 127 |
} |
sl@0 | 128 |
else if(aStepName == KTComplexFonts) |
sl@0 | 129 |
{ |
sl@0 | 130 |
testStep = new CTComplexFonts(); |
sl@0 | 131 |
} |
sl@0 | 132 |
else if(aStepName == KFontMultipleSizesTestStep) |
sl@0 | 133 |
{ |
sl@0 | 134 |
testStep = new CTFontMultipleSizesTestStep(); |
sl@0 | 135 |
} |
sl@0 | 136 |
else if(aStepName == KTPan) |
sl@0 | 137 |
{ |
sl@0 | 138 |
testStep = new CTPan(); |
sl@0 | 139 |
} |
sl@0 | 140 |
else if(aStepName == KTScale) |
sl@0 | 141 |
{ |
sl@0 | 142 |
testStep = new CTScale(); |
sl@0 | 143 |
} |
sl@0 | 144 |
else if(aStepName == KTFlowWindows) |
sl@0 | 145 |
{ |
sl@0 | 146 |
testStep = new CTFlowWindowsTest(); |
sl@0 | 147 |
} |
sl@0 | 148 |
else if(aStepName == KTRotateTestStep) |
sl@0 | 149 |
{ |
sl@0 | 150 |
testStep = new CTRotateTestStep(); |
sl@0 | 151 |
} |
sl@0 | 152 |
else if(aStepName == KTFlowWindowsOpenGLVG) |
sl@0 | 153 |
{ |
sl@0 | 154 |
testStep = new CTFlowWindowsTestOpenGLVG(); |
sl@0 | 155 |
} |
sl@0 | 156 |
else if(aStepName == KTSmallWindows) |
sl@0 | 157 |
{ |
sl@0 | 158 |
testStep = new CTSmallWindowsTest(); |
sl@0 | 159 |
} |
sl@0 | 160 |
else if(aStepName == KTSmallWindowsOpenGL) |
sl@0 | 161 |
{ |
sl@0 | 162 |
testStep = new CTSmallWindowsTestOpenGL(); |
sl@0 | 163 |
} |
sl@0 | 164 |
else if(aStepName == KTSmallWindowsZoom) |
sl@0 | 165 |
{ |
sl@0 | 166 |
testStep = new CTSmallWindowsTestZoom(); |
sl@0 | 167 |
} |
sl@0 | 168 |
else if(aStepName == KTZOrder) |
sl@0 | 169 |
{ |
sl@0 | 170 |
testStep = new CTZOrder(); |
sl@0 | 171 |
} |
sl@0 | 172 |
else if(aStepName == KTZOrderMultipleSurfaces) |
sl@0 | 173 |
{ |
sl@0 | 174 |
testStep = new CTZOrderMultipleSurfaces(); |
sl@0 | 175 |
} |
sl@0 | 176 |
else if(aStepName == KTSmallWindowsOpenVG) |
sl@0 | 177 |
{ |
sl@0 | 178 |
testStep = new CTSmallWindowsTestOpenVG(); |
sl@0 | 179 |
} |
sl@0 | 180 |
else if(aStepName == KTSmallWindowsRaster) |
sl@0 | 181 |
{ |
sl@0 | 182 |
testStep = new CTSmallWindowsTestRaster(); |
sl@0 | 183 |
} |
sl@0 | 184 |
else if(aStepName == KTCopyRect) |
sl@0 | 185 |
{ |
sl@0 | 186 |
testStep = new CTCopyRect(); |
sl@0 | 187 |
} |
sl@0 | 188 |
|
sl@0 | 189 |
return testStep; |
sl@0 | 190 |
} |