os/ossrv/lowlevellibsandfws/pluginfw/TestExecute/EComPerfTest/src/Te_EComPerfTestServer.cpp
First public contribution.
1 // Copyright (c) 2005-2009 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.
14 // Te_EComPerfLoggerServer.cpp
15 // for (WINS && !EKA2) versions will be xxxServer.Dll and require a thread to be started
16 // in the process of the client. The client initialises the server by calling the
17 // one and only ordinal.
24 #include "Te_EComPerfTestServer.h"
25 #include "Te_EComPerfLoggerStep.h"
26 #include "Te_EComStartupStatePerfTestStep.h"
27 #include "Te_EComClientRequestPerfTestStep.h"
28 #include "Te_EComAccumulatedClientRequestPerfTestStep.h"
29 #include "Te_EComPluginReDiscoverPerfTestStep.h"
31 _LIT(KServerName, "Te_EComPerfTest");
33 CEComPerfTestServer* CEComPerfTestServer::NewL()
35 * @return - Instance of the test server
36 * Called inside the MainL() function to create and start the
37 * CTestServer derived server.
40 CEComPerfTestServer * server = new (ELeave) CEComPerfTestServer();
41 CleanupStack::PushL(server);
42 // CServer base class call
43 server->StartL(KServerName);
44 CleanupStack::Pop(server);
50 // Leave the hooks in for platform security
51 #if (defined __DATA_CAGING__)
52 RProcess().DataCaging(RProcess::EDataCagingOn);
53 RProcess().SecureApi(RProcess::ESecureApiOn);
56 CActiveScheduler* sched=NULL;
57 sched=new(ELeave) CActiveScheduler;
58 CActiveScheduler::Install(sched);
59 CEComPerfTestServer* server = NULL;
60 // Create the CTestServer derived server
61 TRAPD(err,server = CEComPerfTestServer::NewL());
64 // Sync with the client and enter the active scheduler
65 RProcess::Rendezvous(KErrNone);
72 GLDEF_C TInt E32Main()
74 * @return - Standard Epoc error code on exit
77 CTrapCleanup* cleanup = CTrapCleanup::New();
83 err = err; // removes armv5 warning
88 CTestStep* CEComPerfTestServer::CreateTestStep(const TDesC& aStepName)
90 * @return - A CTestStep derived instance
91 * Implementation of CTestServer pure virtual
94 CTestStep* testStep = NULL;
96 if (aStepName == KEComStartupStatePerfTest)
98 testStep = new CEComStartupStatePerfTest();
100 else if (aStepName == KEComPerfLogger)
102 testStep = new CEComPerfLogger();
104 else if (aStepName == KEComAccumulatedClientRequestsPerfTest)
106 testStep = new CEComAccumulatedClientRequestsPerfTest();
108 else if (aStepName == KEComClientRequestsPerfTest)
110 testStep = new CEComClientRequestsPerfTest();
112 else if (aStepName == KEComPluginReDiscoverPerfTest)
114 testStep = new CEComPluginReDiscoverPerfTest();