First public contribution.
1 // Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
19 @internalComponent - Internal Symbian test code
22 #include "tgcesuiteserver.h"
23 #include "tgraphicsresource.h"
24 #include "tbitbltperf_directgdi.h"
25 #include "tsimpledrawing_directgdi.h"
26 #include "tdirectgdiperf.h"
27 #include "teventhandlingperf.h"
28 #include "tflipframerate.h"
29 #include "trenderorientation.h"
32 Same code for Secure and non-secure variants
33 Called inside the MainL() function to create and start the
34 CTestServer derived server.
36 @return - Instance of the test server
38 CGceSuiteServer* CGceSuiteServer::NewL()
40 CGceSuiteServer * server = new (ELeave) CGceSuiteServer();
41 CleanupStack::PushL(server);
43 // Get server name from process so we can use SetCap to change the capabilites and use this server with a different filename
44 RProcess handle = RProcess();
45 TParsePtrC serverName(handle.FileName());
47 server->ConstructL(serverName.Name());
48 CleanupStack::Pop(server);
54 MainL - uses the new Rendezvous() call to sync with the client
58 // Active scheduler only for this thread. Test need to create own active scheduler
59 CActiveScheduler* scheduler = new(ELeave) CActiveScheduler;
60 CActiveScheduler::Install(scheduler);
62 CGceSuiteServer* server = NULL;
64 // Create the CTestServer derived server
65 TRAPD(err,server = CGceSuiteServer::NewL());
68 // Sync with the client and enter the active scheduler
69 RProcess::Rendezvous(KErrNone);
79 Process entry point. Called by client using RProcess API
81 @return - Standard Epoc error code on process exit
83 GLDEF_C TInt E32Main()
86 CTrapCleanup* cleanup = CTrapCleanup::New();
98 Secure and non-secure variants
99 Implementation of CTestServer pure virtual
101 @return - A CTestStep derived instance
103 CTestStep* CGceSuiteServer::CreateTestStep(const TDesC& aStepName)
105 CTestStep* testStep = NULL;
107 if(aStepName == KTGraphicsResource)
108 testStep = new CTGraphicsResource();
109 else if(aStepName == KTBitBltPerfDirectGdi)
110 testStep = new CTBitBltPerfDirectGdi();
111 else if(aStepName == KTDirectGdiPerfTest)
112 testStep = new CTDirectGdiPerf();
113 else if(aStepName == KTSimpleDrawingPerfDirectGdi)
114 testStep = new CTSimpleDrawingDirectGdi();
115 else if(aStepName == KEventHandlingPerfName)
116 testStep = new CTEventHandlingPerf();
117 else if(aStepName == KTFlipFramerate)
118 testStep = new CTFlipFramerate();
119 else if(aStepName == KTRenderOrientation)
120 testStep = new CTRenderOrientation;