|
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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
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. |
|
18 // |
|
19 // |
|
20 |
|
21 /** |
|
22 @internalTechnology |
|
23 */ |
|
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" |
|
30 |
|
31 _LIT(KServerName, "Te_EComPerfTest"); |
|
32 |
|
33 CEComPerfTestServer* CEComPerfTestServer::NewL() |
|
34 /** |
|
35 * @return - Instance of the test server |
|
36 * Called inside the MainL() function to create and start the |
|
37 * CTestServer derived server. |
|
38 */ |
|
39 { |
|
40 CEComPerfTestServer * server = new (ELeave) CEComPerfTestServer(); |
|
41 CleanupStack::PushL(server); |
|
42 // CServer base class call |
|
43 server->StartL(KServerName); |
|
44 CleanupStack::Pop(server); |
|
45 return server; |
|
46 } |
|
47 |
|
48 LOCAL_C void MainL() |
|
49 { |
|
50 // Leave the hooks in for platform security |
|
51 #if (defined __DATA_CAGING__) |
|
52 RProcess().DataCaging(RProcess::EDataCagingOn); |
|
53 RProcess().SecureApi(RProcess::ESecureApiOn); |
|
54 #endif |
|
55 |
|
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()); |
|
62 if(!err) |
|
63 { |
|
64 // Sync with the client and enter the active scheduler |
|
65 RProcess::Rendezvous(KErrNone); |
|
66 sched->Start(); |
|
67 } |
|
68 delete server; |
|
69 delete sched; |
|
70 } |
|
71 |
|
72 GLDEF_C TInt E32Main() |
|
73 /** |
|
74 * @return - Standard Epoc error code on exit |
|
75 */ |
|
76 { |
|
77 CTrapCleanup* cleanup = CTrapCleanup::New(); |
|
78 if(cleanup == NULL) |
|
79 { |
|
80 return KErrNoMemory; |
|
81 } |
|
82 TRAPD(err,MainL()); |
|
83 err = err; // removes armv5 warning |
|
84 delete cleanup; |
|
85 return KErrNone; |
|
86 } |
|
87 |
|
88 CTestStep* CEComPerfTestServer::CreateTestStep(const TDesC& aStepName) |
|
89 /** |
|
90 * @return - A CTestStep derived instance |
|
91 * Implementation of CTestServer pure virtual |
|
92 */ |
|
93 { |
|
94 CTestStep* testStep = NULL; |
|
95 |
|
96 if (aStepName == KEComStartupStatePerfTest) |
|
97 { |
|
98 testStep = new CEComStartupStatePerfTest(); |
|
99 } |
|
100 else if (aStepName == KEComPerfLogger) |
|
101 { |
|
102 testStep = new CEComPerfLogger(); |
|
103 } |
|
104 else if (aStepName == KEComAccumulatedClientRequestsPerfTest) |
|
105 { |
|
106 testStep = new CEComAccumulatedClientRequestsPerfTest(); |
|
107 } |
|
108 else if (aStepName == KEComClientRequestsPerfTest) |
|
109 { |
|
110 testStep = new CEComClientRequestsPerfTest(); |
|
111 } |
|
112 else if (aStepName == KEComPluginReDiscoverPerfTest) |
|
113 { |
|
114 testStep = new CEComPluginReDiscoverPerfTest(); |
|
115 } |
|
116 return testStep; |
|
117 } |
|
118 |