os/ossrv/lowlevellibsandfws/pluginfw/TestExecute/EComPerfTest/src/TE_EcomGranularityTestServer.cpp
Update contrib.
1 // Copyright (c) 2006-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.
16 #include <test/testexecuteserverbase.h>
17 #include "TE_EcomGranularityTestStep.h"
19 _LIT(KServerName, "TE_EcomGranularityTestServer");
21 class CEcomGranularityTestServer : public CTestServer
24 static CEcomGranularityTestServer* NewL();
25 virtual CTestStep* CreateTestStep(const TDesC& aStepName);
29 Called inside the MainL() function to create and start the
30 CTestServer derived server.
32 CEcomGranularityTestServer* CEcomGranularityTestServer::NewL()
34 CEcomGranularityTestServer* server = new (ELeave) CEcomGranularityTestServer();
35 CleanupStack::PushL(server);
36 // CServer base class call
37 server->StartL(KServerName);
38 CleanupStack::Pop(server);
44 RProcess().DataCaging(RProcess::EDataCagingOn);
45 RProcess().SecureApi(RProcess::ESecureApiOn);
47 CActiveScheduler* sched=NULL;
48 sched=new(ELeave) CActiveScheduler;
49 CActiveScheduler::Install(sched);
50 CEcomGranularityTestServer* server = NULL;
51 // Create the CTestServer derived server
52 TRAPD(err,server = CEcomGranularityTestServer::NewL());
55 // Sync with the client and enter the active scheduler
56 RProcess::Rendezvous(KErrNone);
63 GLDEF_C TInt E32Main()
65 CTrapCleanup* cleanup = CTrapCleanup::New();
76 @return - A CTestStep derived instance
77 Implementation of CTestServer pure virtual
79 CTestStep* CEcomGranularityTestServer::CreateTestStep(const TDesC& aStepName)
81 CTestStep* testStep = NULL;
83 if (aStepName == KEComImplIndexPerfTest)
85 testStep = new CEComImplIndexPerfTest();