|
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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // apparctestserver.cpp |
|
15 // |
|
16 |
|
17 /** |
|
18 @file apparctestserver.cpp |
|
19 @test |
|
20 @internalComponent - Internal Symbian test code |
|
21 */ |
|
22 |
|
23 #include <basched.h> |
|
24 #include <eikenv.h> |
|
25 #include <eikappui.h> |
|
26 #include <techview/eikon.hrh> |
|
27 #include <eikapp.h> |
|
28 #include <eikdoc.h> |
|
29 #include <techview/eiklabel.h> |
|
30 #include <eikfctry.h> |
|
31 #include <coecntrl.h> |
|
32 #include <barsread.h> |
|
33 #include <techview/eiktbar.h> |
|
34 #include <techview/eikmenub.h> |
|
35 |
|
36 #include "appfwk_test_appui.h" |
|
37 #include "apparctestserver.h" |
|
38 #include "t_foreground.h" |
|
39 #include "T_ProStep.h" |
|
40 #include "T_OOMStep.h" |
|
41 #include "T_File2Step.h" |
|
42 #include "T_File3Step.h" |
|
43 #include "T_BackupStep.h" |
|
44 #include "T_MdrStep.h" |
|
45 #include "T_Serv2Step.h" |
|
46 #include "T_Serv3Step.h" |
|
47 #include "T_MruStep.h" |
|
48 #include "T_CmdlnStep.h" |
|
49 #include "T_WgnamStep.h" |
|
50 #include "T_ExeStep.h" |
|
51 #include "T_NotifStep.h" |
|
52 #include "T_CaptionStep.h" |
|
53 #include "T_LocaleStep.h" |
|
54 #include "T_RApaLsSessionStep.h" |
|
55 #include "T_ServicesStep.h" |
|
56 #include "T_ServiceRegistryStep.h" |
|
57 #include "T_StartAppStep.h" |
|
58 #include "T_StartDocStep.h" |
|
59 #include "T_AutoMMCReaderOpen.h" |
|
60 #include "T_ControlPanelTest.h" |
|
61 #include "T_RuleBasedLaunchingStep.h" |
|
62 #include "T_Capability1.h" |
|
63 #include "T_Capability2.h" |
|
64 #include "T_DataTypeMappingWithSid1.h" |
|
65 #include "T_groupNametest.h" |
|
66 #include "T_groupNametest_ver1.h" |
|
67 #include "T_groupNametest_ver2.h" |
|
68 #include "T_WindowChainingStep.h" |
|
69 #include "T_AppList.h" |
|
70 #include "T_SysStartApparcStep.h" |
|
71 #include "T_ProcStep.h" |
|
72 #include "T_DataMappingPersistenceA.h" |
|
73 #include "T_DataMappingPersistenceB.h" |
|
74 #include "T_DataMappingPersistenceC.h" |
|
75 #include "T_NonNativeAppsStep.h" |
|
76 #include "T_IntegritySupportStep.h" |
|
77 #include "T_IntegritySupportRebootStep.h" |
|
78 #include "T_ApsScan.h" |
|
79 #include "T_EndTaskStep.h" |
|
80 #include "T_RecUpgrade.h" |
|
81 #include "T_AppListFileBootStep.h" |
|
82 #include "T_AppListFileUpdateStep.h" |
|
83 #include "t_largestackstep.h" |
|
84 #include "t_drivenotification.h" |
|
85 #include "t_mimecontentpolicystep.h" |
|
86 #include "t_servicebasestep.h" |
|
87 |
|
88 CApparctestServer* CApparctestServer::NewL() |
|
89 /** |
|
90 @return - Instance of the test server |
|
91 Same code for Secure and non-secure variants |
|
92 Called inside the MainL() function to create and start the |
|
93 CTestServer derived server. |
|
94 */ |
|
95 { |
|
96 CApparctestServer * server = new (ELeave) CApparctestServer(); |
|
97 CleanupStack::PushL(server); |
|
98 // CServer base class call |
|
99 TParsePtrC serverName(RProcess().FileName()); |
|
100 server->StartL(serverName.Name()); |
|
101 CleanupStack::Pop(server); |
|
102 return server; |
|
103 } |
|
104 |
|
105 |
|
106 |
|
107 CTestStep* CApparctestServer::CreateTestStep(const TDesC& aStepName) |
|
108 /** |
|
109 @return - A CTestStep derived instance |
|
110 Secure and non-secure variants |
|
111 Implementation of CTestServer pure virtual |
|
112 */ |
|
113 { |
|
114 CTestStep* testStep = NULL; |
|
115 // User::After(TTimeIntervalMicroSeconds32(5000000)); |
|
116 // This server creates just one step but create as many as you want |
|
117 // They are created "just in time" when the worker thread is created |
|
118 if(aStepName == KTestAppListStep) |
|
119 { |
|
120 testStep = new CTestAppListStep(); |
|
121 } |
|
122 else if(aStepName == KTestForegroundStep) |
|
123 { |
|
124 testStep = new CTestForegroundStep(); |
|
125 } |
|
126 else if(aStepName == KT_ProStep) |
|
127 { |
|
128 testStep = new CT_ProStep(); |
|
129 } |
|
130 else if(aStepName == KT_OOMStep) |
|
131 { |
|
132 testStep = new CT_OOMStep(); |
|
133 } |
|
134 else if(aStepName == KT_File2Step) |
|
135 { |
|
136 testStep = new CT_File2Step(); |
|
137 } |
|
138 else if(aStepName == KT_File3Step) |
|
139 { |
|
140 testStep = new CT_File3Step(); |
|
141 } |
|
142 else if(aStepName == KT_BackupStep) |
|
143 { |
|
144 testStep = new CT_BackupStep(); |
|
145 } |
|
146 else if(aStepName == KT_MdrStep) |
|
147 { |
|
148 testStep = new CT_MdrStep(); |
|
149 } |
|
150 else if(aStepName == KT_Serv2Step) |
|
151 { |
|
152 testStep = new CT_Serv2Step(); |
|
153 } |
|
154 else if(aStepName == KT_Serv3Step) |
|
155 { |
|
156 testStep = new CT_Serv3Step(); |
|
157 } |
|
158 else if(aStepName == KT_MruStep) |
|
159 { |
|
160 testStep = new CT_MruStep(); |
|
161 } |
|
162 else if(aStepName == KT_CmdlnStep) |
|
163 { |
|
164 testStep = new CT_CmdlnStep(); |
|
165 } |
|
166 else if(aStepName == KT_RApaLsSessionStep) |
|
167 { |
|
168 testStep = new CT_RApaLsSessionTestStep(); |
|
169 } |
|
170 else if(aStepName == KT_NotifStep) |
|
171 { |
|
172 testStep = new CT_NotifStep(); |
|
173 } |
|
174 else if(aStepName == KT_WgnamStep) |
|
175 { |
|
176 testStep = new CT_WgnamStep(); |
|
177 } |
|
178 else if(aStepName == KT_ExeStep) |
|
179 { |
|
180 testStep = new CT_ExeStep(); |
|
181 } |
|
182 else if(aStepName == KT_CaptionStep) |
|
183 { |
|
184 testStep = new CT_CaptionStep(); |
|
185 } |
|
186 else if(aStepName == KT_LocaleStep) |
|
187 { |
|
188 testStep = new CT_LocaleStep(); |
|
189 } |
|
190 else if(aStepName == KT_ServicesStep) |
|
191 { |
|
192 testStep = new CT_ServicesTestStep(); |
|
193 } |
|
194 else if(aStepName == KT_StartAppStep) |
|
195 { |
|
196 testStep = new CT_StartAppTestStep(); |
|
197 } |
|
198 else if(aStepName == KT_ServiceRegistryStep) |
|
199 { |
|
200 testStep = new CT_ServiceRegistryTestStep(); |
|
201 } |
|
202 else if(aStepName == KT_StartDocStep) |
|
203 { |
|
204 testStep = new CT_StartDocStep(); |
|
205 } |
|
206 else if(aStepName == KTestAutoMMCReaderOpenStep) |
|
207 { |
|
208 testStep = new CTestAutoMMCReaderStep(); |
|
209 } |
|
210 else if(aStepName == KT_ControlPanelTest) |
|
211 { |
|
212 testStep = new CT_ControlPanelTestStep(); |
|
213 } |
|
214 else if(aStepName == KT_RuleBasedLaunchingStep) |
|
215 { |
|
216 testStep = new CTRuleBasedLaunchingStep(); |
|
217 } |
|
218 else if(aStepName == KT_GroupNameStep) |
|
219 { |
|
220 testStep = new CT_GroupNameStep(); |
|
221 } |
|
222 else if(aStepName == KT_GroupNameStep_ver1) |
|
223 { |
|
224 testStep = new CT_GroupNameStep_ver1(); |
|
225 } |
|
226 else if(aStepName == KT_GroupNameStep_ver2) |
|
227 { |
|
228 testStep = new CT_GroupNameStep_ver2(); |
|
229 } |
|
230 else if(aStepName == KT_Capability1) |
|
231 { |
|
232 testStep = new CT_Capability1(); |
|
233 } |
|
234 else if(aStepName == KT_Capability2) |
|
235 { |
|
236 testStep = new CT_Capability2(); |
|
237 } |
|
238 else if(aStepName == KT_DataTypeMappingWithSid1) |
|
239 { |
|
240 testStep = new CT_DataTypeMappingWithSid1(); |
|
241 } |
|
242 else if (aStepName == KT_WindowChainingStep) |
|
243 { |
|
244 testStep = new CT_WindowChainingStep(); |
|
245 } |
|
246 else if( (aStepName == KT_SysStartApparcStep) || |
|
247 (aStepName == KApparcStartupT_TestStartApp1L) || |
|
248 (aStepName == KApparcStartupT_TestStartApp2L) || |
|
249 (aStepName == KApparcStartupT_TestStartApp3L) || |
|
250 (aStepName == KApparcStartupT_TestStartApp4L) || |
|
251 (aStepName == KApparcStartupT_TestStartApp5L) || |
|
252 (aStepName == KApparcStartupT_TestStartApp6L) || |
|
253 (aStepName == KApparcStartupT_TestGetAllApps) || |
|
254 (aStepName == KApparcStartupT_TestInsertDataTypeL) || |
|
255 (aStepName == KApparcStartupT_TestAppForDataTypeL) || |
|
256 (aStepName == KApparcStartupT_TestDeleteDataTypeL) || |
|
257 (aStepName == KApparcStartupT_TestServiceDiscovery) || |
|
258 (aStepName == KApparcStartupT_TestGetAppInfo) || |
|
259 (aStepName == KApparcStartupT_TestAppCount) || |
|
260 (aStepName == KApparcStartupT_TestCreateDoc) || |
|
261 (aStepName == KApparcStartupT_TestLocalisedCaptionL) ) |
|
262 { |
|
263 testStep = new CT_SysStartApparcStep(); |
|
264 } |
|
265 else if (aStepName == KT_ProcStep) |
|
266 { |
|
267 testStep = new CT_ProcStep(); |
|
268 } |
|
269 else if (aStepName == KT_DataMappingPersistenceAStep) |
|
270 { |
|
271 testStep = new CT_DataMappingPersistenceATestStep(); |
|
272 } |
|
273 else if (aStepName == KT_DataMappingPersistenceBStep) |
|
274 { |
|
275 testStep = new CT_DataMappingPersistenceBTestStep(); |
|
276 } |
|
277 else if (aStepName == _L("T_DataMappingPersistenceC")) |
|
278 { |
|
279 testStep = new CT_DataMappingPersistenceCTestStep(); |
|
280 } |
|
281 else if (aStepName == _L("T_NonNativeApps")) |
|
282 { |
|
283 testStep = new CT_NonNativeAppsStep(); |
|
284 } |
|
285 else if (aStepName == KT_IntegritySupportStep) |
|
286 { |
|
287 testStep = new CT_IntegritySupportTestStep(); |
|
288 } |
|
289 else if (aStepName == KT_IntegritySupportReboot1Step) |
|
290 { |
|
291 testStep = new CT_IntegritySupportReboot1TestStep(); |
|
292 } |
|
293 else if (aStepName == KT_IntegritySupportReboot2Step) |
|
294 { |
|
295 testStep = new CT_IntegritySupportReboot2TestStep(); |
|
296 } |
|
297 else if (aStepName == KT_ApsScanStep) |
|
298 { |
|
299 testStep = new CT_ApsScanStep(); |
|
300 } |
|
301 else if (aStepName == KT_EndTaskStep) |
|
302 { |
|
303 testStep = new CTEndTaskStep(); |
|
304 } |
|
305 else if (aStepName == KT_AppListFileUpdate) |
|
306 { |
|
307 testStep = new CT_AppListFileUpdateStep(); |
|
308 } |
|
309 else if (aStepName == KT_AppListFile_Boot1) |
|
310 { |
|
311 testStep = new CT_AppListFileBootStep(1); |
|
312 } |
|
313 else if (aStepName == KT_AppListFile_Boot2) |
|
314 { |
|
315 testStep = new CT_AppListFileBootStep(2); |
|
316 } |
|
317 else if (aStepName == KT_AppListFile_Boot3) |
|
318 { |
|
319 testStep = new CT_AppListFileBootStep(3); |
|
320 } |
|
321 else if (aStepName == KT_LargeStackStep) |
|
322 { |
|
323 testStep = new CT_LargeStackStep(); |
|
324 } |
|
325 else if (aStepName == KT_DriveNotificationStep) |
|
326 { |
|
327 testStep = new CT_DriveNotificationStep(); |
|
328 } |
|
329 else if (aStepName == KT_MimeContentPolicyStep) |
|
330 { |
|
331 testStep = new CT_MimeContentPolicyStep(); |
|
332 } |
|
333 else if (aStepName == KT_ServiceBaseStep) |
|
334 { |
|
335 testStep = new CT_ServiceBaseStep(); |
|
336 } |
|
337 else if (aStepName == KT_RecUpgradeStep) |
|
338 { |
|
339 testStep = new CT_RecUpgradeStep(); |
|
340 } |
|
341 |
|
342 return testStep; |
|
343 } |
|
344 |
|
345 |
|
346 LOCAL_C void MainL() |
|
347 { |
|
348 // Leave the hooks in for platform security |
|
349 RProcess().DataCaging(RProcess::EDataCagingOn); |
|
350 RProcess().SecureApi(RProcess::ESecureApiOn); |
|
351 |
|
352 CActiveScheduler* sched=NULL; |
|
353 sched=new(ELeave) CActiveScheduler; |
|
354 CActiveScheduler::Install(sched); |
|
355 CApparctestServer* server = NULL; |
|
356 // Create the CTestServer derived server |
|
357 TRAPD(err,server = CApparctestServer::NewL());; |
|
358 |
|
359 if(!err) |
|
360 { |
|
361 // Sync with the client and enter the active scheduler |
|
362 RProcess::Rendezvous(KErrNone); |
|
363 sched->Start(); |
|
364 } |
|
365 delete server; |
|
366 delete sched; |
|
367 } |
|
368 |
|
369 |
|
370 GLDEF_C TInt E32Main() |
|
371 { |
|
372 CTrapCleanup* cleanup = CTrapCleanup::New(); |
|
373 if(cleanup == NULL) |
|
374 { |
|
375 return KErrNoMemory; |
|
376 } |
|
377 TRAP_IGNORE(MainL()); |
|
378 delete cleanup; |
|
379 return KErrNone; |
|
380 } |