|
1 /* |
|
2 * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 /** |
|
20 * @file |
|
21 * @internalTechnology |
|
22 */ |
|
23 |
|
24 #include "omxilgraphicsinksuiteserver.h" |
|
25 #include "graphicsinkteststeps.h" |
|
26 |
|
27 _LIT(KServerName,"tsu_omxilgraphicsink"); |
|
28 COmxGsTestSuiteServer* COmxGsTestSuiteServer::NewL() |
|
29 /** |
|
30 * @return - Instance of the test server |
|
31 * Same code for Secure and non-secure variants |
|
32 * Called inside the MainL() function to create and start the |
|
33 * CTestServer derived server. |
|
34 */ |
|
35 { |
|
36 COmxGsTestSuiteServer * server = new (ELeave) COmxGsTestSuiteServer(); |
|
37 CleanupStack::PushL(server); |
|
38 |
|
39 server->ConstructL(KServerName); |
|
40 CleanupStack::Pop(server); |
|
41 return server; |
|
42 } |
|
43 |
|
44 |
|
45 // Secure variants much simpler |
|
46 // For EKA2, just an E32Main and a MainL() |
|
47 LOCAL_C void MainL() |
|
48 /** |
|
49 * Secure variant |
|
50 * Much simpler, uses the new Rendezvous() call to sync with the client |
|
51 */ |
|
52 { |
|
53 // Leave the hooks in for platform security |
|
54 #if (defined __DATA_CAGING__) |
|
55 RProcess().DataCaging(RProcess::EDataCagingOn); |
|
56 RProcess().DataCaging(RProcess::ESecureApiOn); |
|
57 #endif |
|
58 CActiveScheduler* sched=NULL; |
|
59 sched=new(ELeave) CActiveScheduler; |
|
60 CActiveScheduler::Install(sched); |
|
61 COmxGsTestSuiteServer* server = NULL; |
|
62 // Create the CTestServer derived server |
|
63 TRAPD(err,server = COmxGsTestSuiteServer::NewL()); |
|
64 if(!err) |
|
65 { |
|
66 // Sync with the client and enter the active scheduler |
|
67 RProcess::Rendezvous(KErrNone); |
|
68 sched->Start(); |
|
69 } |
|
70 delete server; |
|
71 delete sched; |
|
72 } |
|
73 |
|
74 |
|
75 |
|
76 GLDEF_C TInt E32Main() |
|
77 /** |
|
78 * @return - Standard Epoc error code on process exit |
|
79 * Secure variant only |
|
80 * Process entry point. Called by client using RProcess API |
|
81 */ |
|
82 { |
|
83 __UHEAP_MARK; |
|
84 CTrapCleanup* cleanup = CTrapCleanup::New(); |
|
85 if(cleanup == NULL) |
|
86 { |
|
87 return KErrNoMemory; |
|
88 } |
|
89 TRAPD(err,MainL()); |
|
90 delete cleanup; |
|
91 __UHEAP_MARKEND; |
|
92 return err; |
|
93 } |
|
94 |
|
95 |
|
96 CTestStep* COmxGsTestSuiteServer::CreateTestStep(const TDesC& aStepName) |
|
97 /** |
|
98 * @return - A CTestStep derived instance |
|
99 * Secure and non-secure variants |
|
100 * Implementation of CTestServer pure virtual |
|
101 */ |
|
102 { |
|
103 CTestStep* testStep = NULL; |
|
104 |
|
105 // --------------------------------------------------------------- |
|
106 // Graphics Sink Tests |
|
107 // --------------------------------------------------------------- |
|
108 if(aStepName == KOmxGsTest0001Step00) |
|
109 testStep = new COmxGsTest0001Step00(); |
|
110 else if(aStepName == KOmxGsTest0001Step01) |
|
111 testStep = new COmxGsTest0001Step01(); |
|
112 else if(aStepName == KOmxGsTest0001Step02) |
|
113 testStep = new COmxGsTest0001Step02(); |
|
114 else if(aStepName == KOmxGsTest0001Step03) |
|
115 testStep = new COmxGsTest0001Step03(); |
|
116 else if(aStepName == KOmxGsTest0001Step04) |
|
117 testStep = new COmxGsTest0001Step04(); |
|
118 else if(aStepName == KOmxGsTest0001Step05) |
|
119 testStep = new COmxGsTest0001Step05(); |
|
120 else if(aStepName == KOmxGsTest0001Step06) |
|
121 testStep = new COmxGsTest0001Step06(); |
|
122 else if(aStepName == KOmxGsTest0001Step07) |
|
123 testStep = new COmxGsTest0001Step07(); |
|
124 else if(aStepName == KOmxGsTest0001Step08) |
|
125 testStep = new COmxGsTest0001Step08(); |
|
126 else if(aStepName == KOmxGsTest0001Step09) |
|
127 testStep = new COmxGsTest0001Step09(); |
|
128 |
|
129 else if(aStepName == KOmxGsTest0002Step01) |
|
130 testStep = new COmxGsTest0002Step01(); |
|
131 else if(aStepName == KOmxGsTest0002Step02) |
|
132 testStep = new COmxGsTest0002Step02(); |
|
133 else if(aStepName == KOmxGsTest0002Step03) |
|
134 testStep = new COmxGsTest0002Step03(); |
|
135 else if(aStepName == KOmxGsTest0002Step04) |
|
136 testStep = new COmxGsTest0002Step04(); |
|
137 |
|
138 else if(aStepName == KOmxGsTest0003Step01) |
|
139 testStep = new COmxGsTest0003Step01(); |
|
140 else if(aStepName == KOmxGsTest0003Step02) |
|
141 testStep = new COmxGsTest0003Step02(); |
|
142 else if(aStepName == KOmxGsTest0003Step03) |
|
143 testStep = new COmxGsTest0003Step03(); |
|
144 else if(aStepName == KOmxGsTest0003Step04) |
|
145 testStep = new COmxGsTest0003Step04(); |
|
146 |
|
147 else if(aStepName == KOmxGsTest0004Step01) |
|
148 testStep = new COmxGsTest0004Step01(); |
|
149 else if(aStepName == KOmxGsTest0004Step02) |
|
150 testStep = new COmxGsTest0004Step02(); |
|
151 else if(aStepName == KOmxGsTest0004Step03) |
|
152 testStep = new COmxGsTest0004Step03(); |
|
153 else if(aStepName == KOmxGsTest0004Step04) |
|
154 testStep = new COmxGsTest0004Step04(); |
|
155 else if(aStepName == KOmxGsTest0004Step05) |
|
156 testStep = new COmxGsTest0004Step05(); |
|
157 else if(aStepName == KOmxGsTest0004Step06) |
|
158 testStep = new COmxGsTest0004Step06(); |
|
159 |
|
160 else if(aStepName == KOmxGsTest0005Step01) |
|
161 testStep = new COmxGsTest0005Step01(); |
|
162 else if(aStepName == KOmxGsTest0005Step02) |
|
163 testStep = new COmxGsTest0005Step02(); |
|
164 else if(aStepName == KOmxGsTest0005Step03) |
|
165 testStep = new COmxGsTest0005Step03(); |
|
166 else if(aStepName == KOmxGsTest0005Step04) |
|
167 testStep = new COmxGsTest0005Step04(); |
|
168 else if(aStepName == KOmxGsTest0005Step05) |
|
169 testStep = new COmxGsTest0005Step05(); |
|
170 |
|
171 else if(aStepName == KOmxGsTest0006Step01) |
|
172 testStep = new COmxGsTest0006Step01(); |
|
173 else if(aStepName == KOmxGsTest0006Step02) |
|
174 testStep = new COmxGsTest0006Step02(); |
|
175 |
|
176 else if(aStepName == KOmxGsTest0007Step01) |
|
177 testStep = new COmxGsTest0007Step01(); |
|
178 else if(aStepName == KOmxGsTest0007Step02) |
|
179 testStep = new COmxGsTest0007Step02(); |
|
180 else if(aStepName == KOmxGsTest0007Step03) |
|
181 testStep = new COmxGsTest0007Step03(); |
|
182 else if(aStepName == KOmxGsTest0007Step04) |
|
183 testStep = new COmxGsTest0007Step04(); |
|
184 else if(aStepName == KOmxGsTest0008Step01) |
|
185 testStep = new COmxGsTest0008Step01(); |
|
186 else if(aStepName == KOmxGsTest0009Step00) |
|
187 testStep = new COmxGsTest0009Step00(); |
|
188 else if(aStepName == KOmxGsTest0010Step00) |
|
189 testStep = new COmxGsTest0010Step00(); |
|
190 |
|
191 return testStep; |
|
192 } |