|
1 /* |
|
2 * Copyright (c) 2002-2009 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: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 #ifndef PROENGWRAPAPI_H |
|
27 #define PROENGWRAPAPI_H |
|
28 |
|
29 // INCLUDES |
|
30 #include <StifLogger.h> |
|
31 #include <TestScripterInternal.h> |
|
32 #include <StifTestModule.h> |
|
33 #include <TestclassAssert.h> |
|
34 |
|
35 |
|
36 #include <e32std.h> |
|
37 #include <e32debug.h> |
|
38 #include <e32base.h> |
|
39 #include <f32file.h> |
|
40 #include <e32property.h> |
|
41 #include <MProEngEngine.h> |
|
42 #include <MProEngProfile.h> |
|
43 #include <MProEngProfileName.h> |
|
44 #include <MProEngProfileNameArray.h> |
|
45 #include <MProEngTones.h> |
|
46 #include <ProEngFactory.h> |
|
47 #include <MProEngToneSettings.h> |
|
48 #include <MProEngAlertToneSeeker.h> |
|
49 #include <MProEngAlertToneSeekerObserver.h> |
|
50 #include <MProEngNotifyHandler.h> |
|
51 #include <MProEngActiveProfileObserver.h> |
|
52 #include <MProEngProfileActivationObserver.h> |
|
53 #include <MProEngProfileObserver.h> |
|
54 #include <MProEngProfileNameArrayObserver.h> |
|
55 #include "CSchedulerUtility.h" |
|
56 |
|
57 |
|
58 |
|
59 // MACROS |
|
60 #define TEST_CLASS_VERSION_MAJOR 31 |
|
61 #define TEST_CLASS_VERSION_MINOR 8 |
|
62 #define TEST_CLASS_VERSION_BUILD 48 |
|
63 |
|
64 // Logging path |
|
65 _LIT( KProEngWrapAPILogPath, "\\logs\\testframework\\ProEngWrapAPI\\" ); |
|
66 // Log file |
|
67 _LIT( KProEngWrapAPILogFile, "ProEngWrapAPI.txt" ); |
|
68 _LIT( KProEngWrapAPILogFileWithTitle, "ProEngWrapAPI_[%S].txt" ); |
|
69 |
|
70 // MODULE DATA STRUCTURES |
|
71 |
|
72 class CProEngVTNotifyHandlerWrapper : public CBase |
|
73 { |
|
74 public: |
|
75 CProEngVTNotifyHandlerWrapper() {} |
|
76 ~CProEngVTNotifyHandlerWrapper() { delete iNotifyHandler; } |
|
77 void SetObject( MProEngNotifyHandler* aNotifyHandler ) |
|
78 { |
|
79 iNotifyHandler = aNotifyHandler; |
|
80 } |
|
81 private: |
|
82 MProEngNotifyHandler* iNotifyHandler; |
|
83 }; |
|
84 |
|
85 class CProEngVTAlertToneSeekerWrapper : public CBase |
|
86 { |
|
87 public: |
|
88 CProEngVTAlertToneSeekerWrapper() {} |
|
89 ~CProEngVTAlertToneSeekerWrapper() { delete iSeeker; } |
|
90 void SetObject( MProEngAlertToneSeeker* aSeeker ) |
|
91 { |
|
92 iSeeker = aSeeker; |
|
93 } |
|
94 private: |
|
95 MProEngAlertToneSeeker* iSeeker; |
|
96 }; |
|
97 |
|
98 class CProEngVTSeekerObserver : public CBase, |
|
99 public MProEngAlertToneSeekerObserver |
|
100 { |
|
101 public: |
|
102 CProEngVTSeekerObserver(CSchedulerUtility& aSchedulerUtility):iSchedulerUtility(aSchedulerUtility){ |
|
103 //iSchedulerUtility = aSchedulerUtility; |
|
104 } |
|
105 ~CProEngVTSeekerObserver() {}; |
|
106 void HandleAlertToneListCompletedL( MDesCArray* aToneList ) |
|
107 { |
|
108 RDebug::Print( _L( "ProEng Validation test VTSeekerObserver::HndlAlrtTnLstCmpltd" ) ); |
|
109 delete aToneList; |
|
110 iSchedulerUtility.Stop(); |
|
111 // CSchedulerUtility::InstanceL()->Stop(); |
|
112 } |
|
113 |
|
114 void HandleError( TInt /* aError */ ) |
|
115 { |
|
116 iSchedulerUtility.Stop(); |
|
117 //CSchedulerUtility::InstanceL()->Stop(); |
|
118 } |
|
119 public: |
|
120 CSchedulerUtility& iSchedulerUtility; |
|
121 }; |
|
122 |
|
123 class CProEngVTObserver: public CBase, |
|
124 public MProEngActiveProfileObserver, |
|
125 public MProEngProfileActivationObserver, |
|
126 public MProEngProfileObserver, |
|
127 public MProEngProfileNameArrayObserver |
|
128 { |
|
129 public: |
|
130 CProEngVTObserver(CSchedulerUtility& aSchedulerUtility):iSchedulerUtility(aSchedulerUtility){ |
|
131 //iSchedulerUtility = aSchedulerUtility; |
|
132 } |
|
133 ~CProEngVTObserver() {}; |
|
134 |
|
135 void HandleActiveProfileModifiedL() |
|
136 { |
|
137 RDebug::Print( _L( "ProEng Validation test VTObserver handle act prof modified" ) ); |
|
138 iSchedulerUtility.Stop(); |
|
139 //CSchedulerUtility::InstanceL()->Stop(); |
|
140 } |
|
141 |
|
142 void HandleActiveProfileNotificationError( |
|
143 TInt /* aError */ ) |
|
144 { |
|
145 RDebug::Print( _L( "ProEng Validation test VTObserver handle act prof error" ) ); |
|
146 iSchedulerUtility.Stop(); |
|
147 //CSchedulerUtility::InstanceL()->Stop(); |
|
148 } |
|
149 |
|
150 void HandleProfileActivatedL( TInt /* aProfileId */ ) |
|
151 { |
|
152 RDebug::Print( _L( "ProEng Validation test VTObserver handle act prof activated" ) ); |
|
153 iSchedulerUtility.Stop(); |
|
154 //CSchedulerUtility::InstanceL()->Stop(); |
|
155 } |
|
156 |
|
157 void HandleProfileActivationNotificationError( |
|
158 TInt /* aError */ ) |
|
159 { |
|
160 RDebug::Print( _L( "ProEng Validation test VTObserver handle act prof activated error" ) ); |
|
161 iSchedulerUtility.Stop(); |
|
162 //CSchedulerUtility::InstanceL()->Stop(); |
|
163 } |
|
164 |
|
165 void HandleProfileNameArrayModificationL() |
|
166 { |
|
167 RDebug::Print( _L( "ProEng Validation test VTObserver handle name array notify" ) ); |
|
168 iSchedulerUtility.Stop(); |
|
169 //CSchedulerUtility::InstanceL()->Stop(); |
|
170 } |
|
171 |
|
172 void HandleProfileNameArrayNotificationError( |
|
173 TInt /* aError */ ) |
|
174 { |
|
175 RDebug::Print( _L( "ProEng Validation test VTObserver handle name array notify error" ) ); |
|
176 iSchedulerUtility.Stop(); |
|
177 //CSchedulerUtility::InstanceL()->Stop(); |
|
178 } |
|
179 |
|
180 void HandleProfileModifiedL( TInt /* aProfileId */ ) |
|
181 { |
|
182 RDebug::Print( _L( "ProEng Validation test VTObserver handle profile notify" ) ); |
|
183 iSchedulerUtility.Stop(); |
|
184 //CSchedulerUtility::InstanceL()->Stop(); |
|
185 } |
|
186 |
|
187 void HandleProfileNotificationError( |
|
188 TInt /* aError */ ) |
|
189 { |
|
190 RDebug::Print( _L( "ProEng Validation test VTObserver handle profile notify error" ) ); |
|
191 iSchedulerUtility.Stop(); |
|
192 //CSchedulerUtility::InstanceL()->Stop(); |
|
193 } |
|
194 public: |
|
195 CSchedulerUtility& iSchedulerUtility; |
|
196 |
|
197 }; |
|
198 |
|
199 |
|
200 |
|
201 // FORWARD DECLARATIONS |
|
202 class CProEngWrapAPI; |
|
203 |
|
204 |
|
205 // CLASS DECLARATION |
|
206 |
|
207 /** |
|
208 * CProEngWrapAPI test class for STIF Test Framework TestScripter. |
|
209 * ?other_description_lines |
|
210 * |
|
211 * @lib ?library |
|
212 * @since ?Series60_version |
|
213 */ |
|
214 NONSHARABLE_CLASS(CProEngWrapAPI) : public CScriptBase |
|
215 { |
|
216 public: // Constructors and destructor |
|
217 |
|
218 /** |
|
219 * Two-phased constructor. |
|
220 */ |
|
221 static CProEngWrapAPI* NewL( CTestModuleIf& aTestModuleIf ); |
|
222 |
|
223 /** |
|
224 * Destructor. |
|
225 */ |
|
226 virtual ~CProEngWrapAPI(); |
|
227 |
|
228 |
|
229 public: // Functions from base classes |
|
230 |
|
231 /** |
|
232 * From CScriptBase Runs a script line. |
|
233 * @since ?Series60_version |
|
234 * @param aItem Script line containing method name and parameters |
|
235 * @return Symbian OS error code |
|
236 */ |
|
237 virtual TInt RunMethodL( CStifItemParser& aItem ); |
|
238 |
|
239 private: |
|
240 |
|
241 /** |
|
242 * C++ default constructor. |
|
243 */ |
|
244 CProEngWrapAPI( CTestModuleIf& aTestModuleIf ); |
|
245 |
|
246 /** |
|
247 * By default Symbian 2nd phase constructor is private. |
|
248 */ |
|
249 void ConstructL(); |
|
250 |
|
251 /** |
|
252 * Frees all resources allocated from test methods. |
|
253 * @since ?Series60_version |
|
254 */ |
|
255 void Delete(); |
|
256 |
|
257 /** |
|
258 * Test methods are listed below. |
|
259 */ |
|
260 |
|
261 /** |
|
262 * Example test method. |
|
263 * @since ?Series60_version |
|
264 * @param aItem Script line containing parameters. |
|
265 * @return Symbian OS error code. |
|
266 */ |
|
267 virtual TInt NewEngineL(); |
|
268 virtual TInt NewEngineLC(); |
|
269 virtual TInt NewEngineLCWithRFsL(); |
|
270 virtual TInt NewNotifyHandlerL(); |
|
271 virtual TInt RequestProfileActivationNotificationsL(); |
|
272 virtual TInt CancelProfileActivationNotificationsL(); |
|
273 virtual TInt RequestActiveProfileNotificationsL(); |
|
274 virtual TInt CancelActiveProfileNotificationsL(); |
|
275 virtual TInt RequestProfileNotificationsL(); |
|
276 virtual TInt CancelProfileNotificationsL(); |
|
277 virtual TInt RequestProfileNameArrayNotificationsL(); |
|
278 virtual TInt CancelProfileNameArrayNotificationsL(); |
|
279 virtual TInt CancelAllL(); |
|
280 virtual TInt ActiveProfileLC(); |
|
281 virtual TInt ActiveProfileL(); |
|
282 virtual TInt ActiveProfileIdL(); |
|
283 virtual TInt ProfileNameArrayLC(); |
|
284 virtual TInt SetActiveProfileL(); |
|
285 virtual TInt ProfileLC(); |
|
286 virtual TInt ProfileL(); |
|
287 |
|
288 virtual TInt MdcaCountL(); |
|
289 void TestProfileNameArrayMdcaCountL(MProEngProfileNameArray& aNameArray); |
|
290 virtual TInt MdcaPointL(); |
|
291 void TestProfileNameArrayMdcaPointL(MProEngProfileNameArray& aNameArray); |
|
292 virtual TInt ProfileIdL(); |
|
293 void TestProfileNameArrayProfileIdL(MProEngProfileNameArray& aNameArray); |
|
294 virtual TInt FindByIdL(); |
|
295 void TestProfileNameArrayFindByIdL(MProEngProfileNameArray& aNameArray); |
|
296 virtual TInt FindByNameL(); |
|
297 void TestProfileNameArrayFindByNameL(MProEngProfileNameArray& aNameArray); |
|
298 |
|
299 virtual TInt ProfileNameL(); |
|
300 void TestProfileSettingsProfileNameL(MProEngProfile& aProfile); |
|
301 virtual TInt ProfileTonesL(); |
|
302 void TestProfileSettingsProfileTonesL(MProEngProfile& aProfile); |
|
303 virtual TInt ToneSettingsL(); |
|
304 void TestProfileSettingsToneSettingsL(MProEngProfile& aProfile); |
|
305 virtual TInt AlertForL(); |
|
306 void TestProfileSettingsAlertForL(MProEngProfile& aProfile); |
|
307 virtual TInt SetAlertForL(); |
|
308 void TestProfileSettingsSetAlertForL(MProEngProfile& aProfile); |
|
309 virtual TInt IsSilentL(); |
|
310 void TestProfileSettingsIsSilentL(MProEngProfile& aProfile); |
|
311 virtual TInt CommitChangeL(); |
|
312 void TestProfileSettingsCommitChangeL(MProEngProfile& aProfile); |
|
313 |
|
314 virtual TInt NameL(); |
|
315 void TestProfileSettingsNameL(MProEngProfile& aProfile); |
|
316 virtual TInt IdL(); |
|
317 void TestProfileSettingsIdL(MProEngProfile& aProfile); |
|
318 virtual TInt SetNameL(); |
|
319 void TestProfileSettingsSetNameL(MProEngProfile& aProfile); |
|
320 |
|
321 virtual TInt RingingTone1L(); |
|
322 void TestProfileSettingsRingingTone1L(MProEngProfile& aProfile); |
|
323 virtual TInt RingingTone2L(); |
|
324 void TestProfileSettingsRingingTone2L(MProEngProfile& aProfile); |
|
325 virtual TInt MessageAlertToneL(); |
|
326 void TestProfileSettingsMessageAlertToneL(MProEngProfile& aProfile); |
|
327 virtual TInt EmailAlertToneL(); |
|
328 void TestProfileSettingsEmailAlertToneL(MProEngProfile& aProfile); |
|
329 virtual TInt VideoCallRingingToneL(); |
|
330 void TestProfileSettingsVideoCallRingingToneL(MProEngProfile& aProfile); |
|
331 virtual TInt SetRingingTone1L(); |
|
332 void TestProfileSettingsSetRingingTone1L(MProEngProfile& aProfile); |
|
333 virtual TInt SetRingingTone2L(); |
|
334 void TestProfileSettingsSetRingingTone2L(MProEngProfile& aProfile); |
|
335 virtual TInt SetMessageAlertToneL(); |
|
336 void TestProfileSettingsSetMessageAlertToneL(MProEngProfile& aProfile); |
|
337 virtual TInt SetEmailAlertToneL(); |
|
338 void TestProfileSettingsSetEmailAlertToneL(MProEngProfile& aProfile); |
|
339 virtual TInt SetVideoCallRingingToneL(); |
|
340 void TestProfileSettingsSetVideoCallRingingToneL(MProEngProfile& aProfile); |
|
341 |
|
342 virtual TInt RingingTypeL(); |
|
343 void TestProfileSettingsRingingTypeL(MProEngProfile& aProfile); |
|
344 virtual TInt KeypadVolumeL(); |
|
345 void TestProfileSettingsKeypadVolumeL(MProEngProfile& aProfile); |
|
346 virtual TInt RingingVolumeL(); |
|
347 void TestProfileSettingsRingingVolumeL(MProEngProfile& aProfile); |
|
348 virtual TInt VibratingAlertL(); |
|
349 void TestProfileSettingsVibratingAlertL(MProEngProfile& aProfile); |
|
350 virtual TInt WarningAndGameTonesL(); |
|
351 void TestProfileSettingsWarningAndGameTonesL(MProEngProfile& aProfile); |
|
352 virtual TInt TextToSpeechL(); |
|
353 void TestProfileSettingsTextToSpeechL(MProEngProfile& aProfile); |
|
354 virtual TInt SetRingingTypeL(); |
|
355 void TestProfileSettingsSetRingingTypeL(MProEngProfile& aProfile); |
|
356 virtual TInt SetKeypadVolumeL(); |
|
357 void TestProfileSettingsSetKeypadVolumeL(MProEngProfile& aProfile); |
|
358 virtual TInt SetRingingVolumeL(); |
|
359 void TestProfileSettingsSetRingingVolumeL(MProEngProfile& aProfile); |
|
360 virtual TInt SetVibratingAlertL(); |
|
361 void TestProfileSettingsSetVibratingAlertL(MProEngProfile& aProfile); |
|
362 virtual TInt SetWarningAndGameTonesL(); |
|
363 void TestProfileSettingsSetWarningAndGameTonesL(MProEngProfile& aProfile); |
|
364 virtual TInt SetTextToSpeechL(); |
|
365 void TestProfileSettingsSetTextToSpeechL(MProEngProfile& aProfile); |
|
366 |
|
367 virtual TInt NewAlertToneSeekerL(); |
|
368 virtual TInt FetchAlertToneListL(); |
|
369 virtual TInt CancelFetchL(); |
|
370 |
|
371 virtual TInt NewEngineLWithRFsL(); |
|
372 |
|
373 |
|
374 /** |
|
375 * Method used to log version of test class |
|
376 */ |
|
377 void SendTestClassVersion(); |
|
378 |
|
379 //ADD NEW METHOD DEC HERE |
|
380 //[TestMethods] - Do not remove |
|
381 |
|
382 public: // Data |
|
383 CSchedulerUtility* iSchedulerUtility; |
|
384 RFs iFs; |
|
385 |
|
386 }; |
|
387 |
|
388 #endif // PROENGWRAPAPI_H |
|
389 |
|
390 // End of File |