|
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 // The test server drives tests related to Cone APIs featuring |
|
15 // Creating controls, Component-control interface, Background drawing, object |
|
16 // provider mechanism, Screen Drawing- Offscreen drawing erc.\n |
|
17 // |
|
18 // |
|
19 |
|
20 /** |
|
21 @file |
|
22 @test |
|
23 @internalComponent - Internal Symbian test code |
|
24 */ |
|
25 |
|
26 |
|
27 #include "TConeTestServer.h" |
|
28 #include "TCone0Step.h" |
|
29 #include "TCone1Step.h" |
|
30 #include "TCone2Step.h" |
|
31 #include "TCone3Step.h" |
|
32 #include "TCone4StepExe.h" |
|
33 #include "TConeErrorMsgStep.h" |
|
34 #include "TConeHelpTextStep.h" |
|
35 #include "TConeBackground.h" |
|
36 #include "TCone5Step.h" |
|
37 #include "TCone6Step.h" |
|
38 #include "TCone7Step.h" |
|
39 #include "TConeInvalidate.h" |
|
40 #include "TConeTransition.h" |
|
41 #include "TConeTransparency.h" |
|
42 #include "TConeZoomFont.h" |
|
43 #include "TConeVisibility.h" |
|
44 #include "tconecoedatastoragestep.h" |
|
45 #include "tconecoecntssstep.h" |
|
46 #include "tconeresourceloader.h" |
|
47 #include "tconestateobs.h" |
|
48 #include "TConeMultiPtrStep.h" |
|
49 #include "tconemultiptrcompoundstep.h" |
|
50 #include "TMultipleScreensStep.h" |
|
51 #include "tconeevents.h" |
|
52 |
|
53 |
|
54 _LIT(KServerName,"TConeTestServer"); |
|
55 |
|
56 |
|
57 CTConeTestServer* CTConeTestServer::NewL() |
|
58 { |
|
59 CTConeTestServer * server = new (ELeave) CTConeTestServer(); |
|
60 CleanupStack::PushL(server); |
|
61 server->StartL(KServerName); |
|
62 CleanupStack::Pop(server); |
|
63 return server; |
|
64 } |
|
65 |
|
66 LOCAL_C void MainL() |
|
67 { |
|
68 RProcess().DataCaging(RProcess::EDataCagingOn); |
|
69 RProcess().SecureApi(RProcess::ESecureApiOn); |
|
70 CActiveScheduler* sched=NULL; |
|
71 sched=new(ELeave) CActiveScheduler; |
|
72 CActiveScheduler::Install(sched); |
|
73 |
|
74 CTConeTestServer* server = NULL; |
|
75 TRAPD(err,server = CTConeTestServer::NewL()); |
|
76 if(!err) |
|
77 { |
|
78 // Sync with the client and enter the active scheduler |
|
79 RProcess::Rendezvous(KErrNone); |
|
80 sched->Start(); |
|
81 } |
|
82 delete server; |
|
83 delete sched; |
|
84 } |
|
85 |
|
86 |
|
87 GLDEF_C TInt E32Main() |
|
88 { |
|
89 CTrapCleanup* cleanup = CTrapCleanup::New(); |
|
90 if(cleanup == NULL) |
|
91 { |
|
92 return KErrNoMemory; |
|
93 } |
|
94 TRAP_IGNORE(MainL()); |
|
95 |
|
96 delete cleanup; |
|
97 return KErrNone; |
|
98 } |
|
99 |
|
100 |
|
101 CTestStep* CTConeTestServer::CreateTestStep(const TDesC& aStepName) |
|
102 { |
|
103 CTestStep* testStep = NULL; |
|
104 if (aStepName==KTConeErrorMsgStep) |
|
105 { |
|
106 testStep = new CTConeErrorMsgStep(); |
|
107 } |
|
108 else if (aStepName==KTConeHelpTextStep) |
|
109 { |
|
110 testStep = new CTConeHelpTextStep(); |
|
111 } |
|
112 else if (aStepName==KTCone0Step) |
|
113 { |
|
114 testStep = new CTCone0Step(); |
|
115 } |
|
116 else if (aStepName==KTCone1Step) |
|
117 { |
|
118 testStep = new CTCone1Step(); |
|
119 } |
|
120 else if (aStepName==KTCone2Step) |
|
121 { |
|
122 testStep = new CTCone2Step(); |
|
123 } |
|
124 else if (aStepName==KTCone3Step) |
|
125 { |
|
126 testStep = new CTCone3Step(); |
|
127 } |
|
128 else if (aStepName==KTCone4StepExe) |
|
129 { |
|
130 testStep = new CTCone4StepExe(); |
|
131 } |
|
132 else if (aStepName==KTBackgroundStep) |
|
133 { |
|
134 testStep = new CTConeBackgroundStep(); |
|
135 } |
|
136 else if (aStepName==KTCone5Step) |
|
137 { |
|
138 testStep = new CTCone5Step(); |
|
139 } |
|
140 else if (aStepName==KTConeInvalidateStep) |
|
141 { |
|
142 testStep = new CTConeInvalidateStep(); |
|
143 } |
|
144 else if (aStepName==KTCone6Step) |
|
145 { |
|
146 testStep = new CTCone6Step(); |
|
147 } |
|
148 else if (aStepName==KTCone7Step) |
|
149 { |
|
150 testStep = new CTCone7Step(); |
|
151 } |
|
152 else if (aStepName==KTConeTransitionStep) |
|
153 { |
|
154 testStep = new CTConeTransitionStep(); |
|
155 } |
|
156 else if (aStepName==KTConeZoomFontStep) |
|
157 { |
|
158 testStep = new CTConeZoomFontStep(); |
|
159 } |
|
160 else if (aStepName==KTConeVisibilityStep) |
|
161 { |
|
162 testStep = new CTConeVisibilityStep(); |
|
163 } |
|
164 else if (aStepName==KTConeCoeDataStorageStep) |
|
165 { |
|
166 testStep = new CTConeCoeDataStorageStep(); |
|
167 } |
|
168 else if (aStepName==KTConeCoeCntSSStep) |
|
169 { |
|
170 testStep = new CTConeCoeCntSSStep(); |
|
171 } |
|
172 else if (aStepName==KTConeResourceLoader) |
|
173 { |
|
174 testStep = new CTConeResourceLoaderStep(); |
|
175 } |
|
176 else if (aStepName==KTConeStateObs) |
|
177 { |
|
178 testStep = new CTConeStateObs(); |
|
179 } |
|
180 else if(aStepName == KTConeTransparencyStep) |
|
181 { |
|
182 testStep = new CTConeTransparencyStep(); |
|
183 } |
|
184 else if (aStepName==KTConeMultiPtrStep) |
|
185 { |
|
186 testStep = new CTConeMultiPtrStep(); |
|
187 } |
|
188 else if (aStepName==KTConeMultiPtrCompoundStep) |
|
189 { |
|
190 testStep = new CTConeMultiPtrCompoundStep(); |
|
191 } |
|
192 else if(aStepName == KTMultipleScreensStep) |
|
193 { |
|
194 testStep = new CTMultipleScreensStep(); |
|
195 } |
|
196 else if (aStepName==KTConeEvents) |
|
197 { |
|
198 testStep=new CTConeEvents(1); |
|
199 } |
|
200 else if (aStepName==KTConeEvents2) |
|
201 { |
|
202 testStep=new CTConeEvents(2); |
|
203 } |
|
204 return testStep; |
|
205 } |