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 // |
|
15 |
|
16 #include "TE_PerfTestServer.h" |
|
17 #include "TE_PerfTestStep.h" |
|
18 #include "TE_MemTestStep.h" |
|
19 #include "TE_FindPerfTestStep.h" |
|
20 #include "TE_PerfTestCacheEnabledStep.h" |
|
21 #include "TE_PerfTestCacheDisabledStep.h" |
|
22 #include "TE_PerfTestCompareStep.h" |
|
23 #include "TE_DefectTestStep.h" |
|
24 #include "TE_PerfTestClientOpenStep.h" |
|
25 #include "TE_NotifyMemTestStep.h" |
|
26 |
|
27 _LIT(KServerName, "CentRepPerfTest"); |
|
28 |
|
29 CPerfTestServer* CPerfTestServer::NewL() |
|
30 { |
|
31 CPerfTestServer* server = new (ELeave) CPerfTestServer(); |
|
32 CleanupStack::PushL(server); |
|
33 // CServer base class call |
|
34 server->StartL(KServerName); |
|
35 CleanupStack::Pop(server); |
|
36 return server; |
|
37 } |
|
38 |
|
39 LOCAL_C void MainL() |
|
40 { |
|
41 // Leave the hooks in for platform security |
|
42 #if (defined __DATA_CAGING__) |
|
43 RProcess().DataCaging(RProcess::EDataCagingOn); |
|
44 RProcess().SecureApi(RProcess::ESecureApiOn); |
|
45 #endif |
|
46 |
|
47 CActiveScheduler* sched=NULL; |
|
48 sched=new(ELeave) CActiveScheduler; |
|
49 CActiveScheduler::Install(sched); |
|
50 CPerfTestServer* server = NULL; |
|
51 // Create the CTestServer derived server |
|
52 TRAPD(err,server = CPerfTestServer::NewL()); |
|
53 if (KErrNone == err) |
|
54 { |
|
55 // Sync with the client and enter the active scheduler |
|
56 RProcess::Rendezvous(KErrNone); |
|
57 sched->Start(); |
|
58 } |
|
59 delete server; |
|
60 delete sched; |
|
61 } |
|
62 |
|
63 GLDEF_C TInt E32Main() |
|
64 { |
|
65 CTrapCleanup* cleanup = CTrapCleanup::New(); |
|
66 if(cleanup == NULL) |
|
67 { |
|
68 return KErrNoMemory; |
|
69 } |
|
70 TRAPD(err,MainL()); |
|
71 delete cleanup; |
|
72 return err; |
|
73 } |
|
74 |
|
75 CTestStep* CPerfTestServer::CreateTestStep(const TDesC& aStepName) |
|
76 { |
|
77 CTestStep* testStep = NULL; |
|
78 |
|
79 if (aStepName == KGetPerfTestResults) |
|
80 { |
|
81 testStep = new CPerfTestStep(); |
|
82 } |
|
83 else if (aStepName == KMemTestName) |
|
84 { |
|
85 testStep = new CMemTestStep(); |
|
86 } |
|
87 else if (aStepName == KFindPerfTestName) |
|
88 { |
|
89 testStep = new CFindPerfTestStep(); |
|
90 } |
|
91 else if (aStepName == KPerfTestCacheEnabledStep) |
|
92 { |
|
93 testStep = new CPerfTestCacheEnabledStep(); |
|
94 } |
|
95 else if (aStepName == KPerfTestCacheDisabledStep) |
|
96 { |
|
97 testStep = new CPerfTestCacheDisabledStep(); |
|
98 } |
|
99 else if (aStepName == KPerfTestCompareStep) |
|
100 { |
|
101 testStep = new CPerfTestCompareStep(); |
|
102 } |
|
103 else if (aStepName == KPerfTestDefectStepDEF057491) |
|
104 { |
|
105 testStep = new CPerfTestDefectStep057491(); |
|
106 } |
|
107 else if (aStepName == KPerfTestDefectStepDEF059633) |
|
108 { |
|
109 testStep = new CPerfTestDefectStep059633(); |
|
110 } |
|
111 else if (aStepName == KPerfTestClientOpenName) |
|
112 { |
|
113 testStep = new CPerfTestClientOpenStep(); |
|
114 } |
|
115 else if (aStepName == KNotifyMemTestStep) |
|
116 { |
|
117 testStep = new CNotifyMemTestStep(); |
|
118 } |
|
119 |
|
120 return testStep; |
|
121 } |
|
122 |
|