First public contribution.
1 // Copyright (c) 2007-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.
23 #include "t_wservintegserver.h"
24 #include "t_wservintegstepbase.h"
25 #include "t_wservintegstepbasic.h"
26 #include "t_wservintegstepdsa.h"
27 #include "t_wservintegstepsurface.h"
28 #include "t_wservintegstepfps.h"
30 CT_WServIntegServer* CT_WServIntegServer::NewL()
32 * @return - Instance of the test server
33 * Same code for Secure and non-secure variants
34 * Called inside the MainL() function to create and start the
35 * CTestServer derived server.
38 CT_WServIntegServer* server = new (ELeave) CT_WServIntegServer();
39 CleanupStack::PushL(server);
41 CleanupStack::Pop(server);
45 void CT_WServIntegServer::ConstructL()
47 RProcess handle = RProcess();
48 TParsePtrC serverName(handle.FileName());
49 CTestServer::ConstructL(serverName.Name());
55 * Much simpler, uses the new Rendezvous() call to sync with the client
58 #if (defined __DATA_CAGING__)
59 RProcess().DataCaging(RProcess::EDataCagingOn);
60 RProcess().SecureApi(RProcess::ESecureApiOn);
62 CActiveScheduler* sched=NULL;
63 sched=new(ELeave) CActiveScheduler;
64 CActiveScheduler::Install(sched);
65 CT_WServIntegServer* server = NULL;
66 // Create the CTestServer derived server
67 TRAPD(err,server = CT_WServIntegServer::NewL());
70 // Sync with the client and enter the active scheduler
71 RProcess::Rendezvous(KErrNone);
78 GLDEF_C TInt E32Main()
80 * @return - Standard Epoc error code on process exit
82 * Process entry point. Called by client using RProcess Integ
86 CTrapCleanup* cleanup = CTrapCleanup::New();
91 #if (defined TRAP_IGNORE)
101 CTestStep* CT_WServIntegServer::CreateTestStep(const TDesC& aStepName)
103 * @return - A CTestStep derived instance
104 * Secure and non-secure variants
105 * Implementation of CTestServer pure virtual
108 CTestStep* testStep = NULL;
110 if ( aStepName==KT_WServIntegStep )
112 testStep=new CT_WServIntegStep();
114 else if ( aStepName==KT_WServIntegStepDsa )
116 testStep= new CT_WServIntegStepDsa();
118 else if ( aStepName==KT_WServIntegStepSurface )
120 testStep= new CT_WServIntegStepSurface();
122 else if ( aStepName==KT_WServIntegStepBasic )
124 testStep= new CT_WServIntegStepBasic();
126 else if ( aStepName==KT_WServIntegStepFps )
128 testStep= new CT_WServIntegStepFps();