|
1 // Copyright (c) 2004-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 // Header file: Declaration for Various Classes used for Audio Resource Notification tests. |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file TestAudioClientUtilitiesARN.h |
|
20 */ |
|
21 |
|
22 #ifndef TESTAUDIOCLIENTUTILITIESARN_H |
|
23 #define TESTAUDIOCLIENTUTILITIESARN_H |
|
24 |
|
25 #include "mdaaudiosampleplayer.h" |
|
26 #include "mdaaudiosampleeditor.h" |
|
27 #include "mdaaudiooutputstream.h" |
|
28 #include "TestPlayerUtils.h" |
|
29 #include "TestRecorder.h" |
|
30 #include "TSI_MMFACLNT.h" |
|
31 #include <mmf/common/mmfaudio.h> |
|
32 |
|
33 //------------------------------------------------------------------------------ |
|
34 //********************PREQ 797 - Audio Resource Notification******************** |
|
35 //------------------------------------------------------------------------------ |
|
36 |
|
37 /** |
|
38 * stopActiveScheduler |
|
39 */ |
|
40 static TInt stopActiveScheduler(TAny*) |
|
41 { |
|
42 CActiveScheduler::Stop(); |
|
43 return KErrNone; |
|
44 } |
|
45 |
|
46 // |
|
47 //Declarations// |
|
48 // |
|
49 |
|
50 // |
|
51 //Custom Error Codes & CONST Declarations. |
|
52 // |
|
53 const TInt KErrUser = -1000; |
|
54 const TInt KErrBadResult = (KErrUser - 1); |
|
55 const TInt KMicroSecsInOneSec = 1000000; |
|
56 const TUint KSampleRate8000Hz = 8000; |
|
57 |
|
58 // |
|
59 //Forward class declarations |
|
60 // |
|
61 class CCallbackTimer; |
|
62 class CTestMdaAudioPlayerCallbackSupport; |
|
63 class CTestMdaAudioRecorderCallbackSupport; |
|
64 class CTestMdaAudioOutputStreamCallbackSupport; |
|
65 class CTestMdaAudioMultiClientCallbackSupport; |
|
66 |
|
67 //------------------------------------------------------------------------------ |
|
68 //******************PREQ 797 - Audio Player Test Declarations******************* |
|
69 //------------------------------------------------------------------------------ |
|
70 class CMultiEventChecker: public CBase |
|
71 { |
|
72 public: |
|
73 // MultiEvent checker utility enums |
|
74 enum TClientUtilityType |
|
75 { |
|
76 EAudioPlayer = 0, |
|
77 EAudioRecorder, |
|
78 EAudioStream |
|
79 }; |
|
80 public: |
|
81 static CMultiEventChecker* NewL(); |
|
82 TBool CheckFsm(TInt aClientNumber, TClientUtilityType aClientType,TInt aEventCode, TInt aError=KErrNone,CMdaAudioClipUtility::TState aRecorderState=CMdaAudioClipUtility::ENotReady); |
|
83 void StopTest(); |
|
84 void SetExpectedState(TInt aState); |
|
85 void SetExpectedEvent(TInt aClientNumber, TInt aEvent,TInt aError,CMdaAudioClipUtility::TState aRecorderState=CMdaAudioClipUtility::ENotReady); |
|
86 void RegisterClientEventToMonitor(TInt aClientNumber, TInt aEventCode, TInt aError, TInt aState,CMdaAudioClipUtility::TState aRecorderState=CMdaAudioClipUtility::ENotReady); |
|
87 void EnableMultipleEventMonitor() |
|
88 { |
|
89 iMonitorMultipleEvents = ETrue; |
|
90 } |
|
91 void DisableMultipleEventMonitor() |
|
92 { |
|
93 iMonitorMultipleEvents = EFalse; |
|
94 } |
|
95 TBool IsMutipleEventMonitorEnabled() |
|
96 { |
|
97 return iMonitorMultipleEvents; |
|
98 } |
|
99 TInt NextState() |
|
100 { |
|
101 return iNextState; |
|
102 } |
|
103 TBool IsMonitoringFinished(); |
|
104 protected: |
|
105 void ConstructL(); |
|
106 CMultiEventChecker(); |
|
107 //Register client events to monitor |
|
108 TInt iExpectedEvent; |
|
109 TInt iExpectedError; |
|
110 CMdaAudioClipUtility::TState iExpectedRecorderState; |
|
111 TInt iNextState; |
|
112 TFixedArray <TInt, 4> iClientEventsToMonitor; |
|
113 TFixedArray <TInt, 4> iClientError; |
|
114 TFixedArray <TInt, 4> iFsmStateforClient; |
|
115 TInt iClientsRegistered; |
|
116 TBool iMonitorMultipleEvents; |
|
117 }; |
|
118 |
|
119 // |
|
120 //BASE CLASS DECLARATIONS// |
|
121 // |
|
122 |
|
123 /** |
|
124 * Observer class to identify and pass events to the test step class |
|
125 * |
|
126 * @class MTestAudioPlayerCallback |
|
127 * |
|
128 */ |
|
129 class MTestAudioPlayerCallback |
|
130 { |
|
131 public : |
|
132 virtual void MapcInitCompleteTest(TInt aError, const TTimeIntervalMicroSeconds& aDuration, CTestMdaAudioPlayerCallbackSupport& aMdaAudioPlayerCallbackSupport) = 0; |
|
133 virtual void MarncResourceAvailableTest(TUid aNotificationEventId, const TDesC8& aNotificationData, CTestMdaAudioPlayerCallbackSupport& aMdaAudioPlayerCallbackSupport) = 0; |
|
134 virtual void MapcPlayCompleteTest(TInt aError, CTestMdaAudioPlayerCallbackSupport& aMdaAudioPlayerCallbackSupport) = 0; |
|
135 }; |
|
136 |
|
137 /** |
|
138 * Support class to pass the events to the test step class using the MTestAudioPlayerCallback |
|
139 * |
|
140 * @class CTestMdaAudioPlayerCallbackSupport |
|
141 * |
|
142 */ |
|
143 class CTestMdaAudioPlayerCallbackSupport : public CBase, public MMdaAudioPlayerCallback, public MMMFAudioResourceNotificationCallback |
|
144 { |
|
145 public : |
|
146 static CTestMdaAudioPlayerCallbackSupport* NewL(MTestAudioPlayerCallback& aCallback); |
|
147 virtual void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration); |
|
148 virtual void MapcPlayComplete(TInt aError); |
|
149 virtual void MarncResourceAvailable(TUid aNotificationEventId, const TDesC8& aNotificationData); |
|
150 protected: |
|
151 CTestMdaAudioPlayerCallbackSupport(MTestAudioPlayerCallback& aCallback); |
|
152 void ConstructL(); |
|
153 private : |
|
154 MTestAudioPlayerCallback& iCallback; |
|
155 }; |
|
156 |
|
157 |
|
158 /** |
|
159 * Base Class for ARN functionality for most ARN audio player tests |
|
160 * |
|
161 * @class CTestMmfAclntAudioPlayerARN |
|
162 * |
|
163 */ |
|
164 class CTestMmfAclntAudioPlayerARN : public CTestMmfAclntStep, public MTestAudioPlayerCallback |
|
165 { |
|
166 public: |
|
167 // Enum to describe the current state. |
|
168 enum TMmfAudioPlayerState |
|
169 { |
|
170 EStateBegin = 0, |
|
171 EStateOpenPlayer1, |
|
172 EStateOpenPlayer2, |
|
173 EStateOpenPlayer3, |
|
174 EStatePlaying1, |
|
175 EStatePlaying2, |
|
176 EStatePlaying3, |
|
177 EStateEndPlay1, |
|
178 EStateEndPlay2, |
|
179 EStateEndPlay3, |
|
180 EStateErrInUsePlayer1, |
|
181 EStateErrInUsePlayer2, |
|
182 EStateErrInUsePlayer3, |
|
183 EStateNotifiedPlayer1, |
|
184 EStateNotifiedPlayer2, |
|
185 EStateNotifiedPlayer3, |
|
186 EStateErrInUsePlayer1A, |
|
187 EStateNotifiedPlayer1A, |
|
188 EStatePlaying2A, |
|
189 EStateEndPlay2A |
|
190 }; |
|
191 |
|
192 // Enum to decide which Event has occured. |
|
193 enum TMmfAudioPlayerEvents |
|
194 { |
|
195 EIdlePlayer = 0, |
|
196 EMapcInitComplete1, |
|
197 EMapcInitComplete2, |
|
198 EMapcInitComplete3, |
|
199 EMapcPlayComplete1, |
|
200 EMapcPlayComplete2, |
|
201 EMapcPlayComplete3, |
|
202 EMarncResourceAvailable1, |
|
203 EMarncResourceAvailable2, |
|
204 EMarncResourceAvailable3 |
|
205 }; |
|
206 public : |
|
207 // Constructor |
|
208 CTestMmfAclntAudioPlayerARN(const TDesC& aTestName, const TDesC& aSectName); |
|
209 // Virtual methods for Preamble and Postamble. |
|
210 virtual TVerdict DoTestStepPreambleL(); |
|
211 virtual TVerdict DoTestStepPostambleL(); |
|
212 // Virtual function to access test specific methods |
|
213 virtual TVerdict DoTestStepL(); |
|
214 // Pure function to access test specific methods |
|
215 virtual TVerdict DoTestL()=0; |
|
216 // from MTestAudioPlayerCallback |
|
217 virtual void MapcInitCompleteTest(TInt aError, const TTimeIntervalMicroSeconds& aDuration, CTestMdaAudioPlayerCallbackSupport& aMdaAudioPlayerCallbackSupport); |
|
218 virtual void MarncResourceAvailableTest(TUid aNotificationEventId, const TDesC8& aNotificationData, CTestMdaAudioPlayerCallbackSupport& aMdaAudioPlayerCallbackSupport); |
|
219 virtual void MapcPlayCompleteTest(TInt aError, CTestMdaAudioPlayerCallbackSupport& aMdaAudioPlayerCallbackSupport); |
|
220 // Centralised State Handler |
|
221 virtual void FsmL(TMmfAudioPlayerEvents aEventCode, TInt aError)=0; |
|
222 virtual TBool FsmCheck(TMmfAudioPlayerEvents aEventCode, TInt aError); |
|
223 protected : |
|
224 // StateInit Function |
|
225 void StateInit(); |
|
226 // StateChange Function |
|
227 void StateChange(TMmfAudioPlayerState aState, TMmfAudioPlayerEvents aExpectedEvent, TInt aExpectedError=KErrNone); |
|
228 protected : |
|
229 // CMdaAudioPlayerUtility instances |
|
230 CMdaAudioPlayerUtility* iTestAudioPlayer1; |
|
231 CMdaAudioPlayerUtility* iTestAudioPlayer2; |
|
232 CMdaAudioPlayerUtility* iTestAudioPlayer3; |
|
233 // CTestMdaAudioPlayerCallbackSupport instances |
|
234 CTestMdaAudioPlayerCallbackSupport* iMdaAudioPlayerCallbackSupport1; |
|
235 CTestMdaAudioPlayerCallbackSupport* iMdaAudioPlayerCallbackSupport2; |
|
236 CTestMdaAudioPlayerCallbackSupport* iMdaAudioPlayerCallbackSupport3; |
|
237 // Other class variable declarations |
|
238 TBuf<KSizeBuf> iFilename1; |
|
239 TBuf<KSizeBuf> iFilename2; |
|
240 TBuf<KSizeBuf> iFilename3; |
|
241 TTimeIntervalMicroSeconds iPosition; |
|
242 TTimeIntervalMicroSeconds iDuration; |
|
243 TInt iError; |
|
244 TMmfAudioPlayerState iState; |
|
245 TRequestStatus iRequestStatus; |
|
246 CCallBackTimer* iCallBackTimer; |
|
247 TMmfAudioPlayerEvents iExpectedEvent; |
|
248 TInt iExpectedError; |
|
249 TMmfAudioPlayerEvents iEventOccured; |
|
250 TBuf<KNameBufSize> iSectName; // Section name for retrieving filename |
|
251 CMultiEventChecker* iEventChecker; |
|
252 }; |
|
253 |
|
254 // |
|
255 //POSITIVE TESTS// |
|
256 // |
|
257 |
|
258 /** |
|
259 * Register for notification, but make no request to play audio. |
|
260 * |
|
261 * @class CTestMmfAclntARN8101 |
|
262 * |
|
263 */ |
|
264 class CTestMmfAclntARN8101 : public CTestMmfAclntAudioPlayerARN |
|
265 { |
|
266 public: |
|
267 static CTestMmfAclntARN8101* NewL( const TDesC& aTestName, const TDesC& aSectName ); |
|
268 virtual TVerdict DoTestL(); |
|
269 virtual void FsmL(TMmfAudioPlayerEvents aEventCode, TInt aError); |
|
270 |
|
271 protected: |
|
272 CTestMmfAclntARN8101( const TDesC& aTestName, const TDesC& aSectName ); |
|
273 TVerdict PerformTestL(); |
|
274 }; |
|
275 |
|
276 /** |
|
277 * Register (b4 play, after Open) and Receive Notification of a Resource Available Event. |
|
278 * (when audio resource is currently unavailable and then available) |
|
279 * |
|
280 * @class CTestMmfAclntARN8102 |
|
281 * |
|
282 */ |
|
283 class CTestMmfAclntARN8102 : public CTestMmfAclntAudioPlayerARN |
|
284 { |
|
285 public: |
|
286 static CTestMmfAclntARN8102* NewL( const TDesC& aTestName, const TDesC& aSectName ); |
|
287 virtual TVerdict DoTestL(); |
|
288 virtual void FsmL(TMmfAudioPlayerEvents aEventCode, TInt aError); |
|
289 |
|
290 protected: |
|
291 CTestMmfAclntARN8102( const TDesC& aTestName, const TDesC& aSectName ); |
|
292 TVerdict PerformTestL(); |
|
293 }; |
|
294 |
|
295 /** |
|
296 * Register (at the time of Play) and Receive Notification of a Resource Available Event. |
|
297 * (when audio resource is currently available and subsequently unavailable, and then available) |
|
298 |
|
299 * |
|
300 * @class CTestMmfAclntARN8103 |
|
301 * |
|
302 */ |
|
303 class CTestMmfAclntARN8103 : public CTestMmfAclntAudioPlayerARN |
|
304 { |
|
305 public: |
|
306 static CTestMmfAclntARN8103* NewL( const TDesC& aTestName, const TDesC& aSectName ); |
|
307 virtual TVerdict DoTestL(); |
|
308 virtual void FsmL(TMmfAudioPlayerEvents aEventCode, TInt aError); |
|
309 virtual TBool FsmCheck(TMmfAudioPlayerEvents aEventCode, TInt aError); |
|
310 |
|
311 protected: |
|
312 CTestMmfAclntARN8103( const TDesC& aTestName, const TDesC& aSectName ); |
|
313 TVerdict PerformTestL(); |
|
314 }; |
|
315 |
|
316 /** |
|
317 * Registration (b4 File Open) and Cancellation of the notification request |
|
318 * |
|
319 * @class CTestMmfAclntARN8104 |
|
320 * |
|
321 */ |
|
322 class CTestMmfAclntARN8104 : public CTestMmfAclntAudioPlayerARN |
|
323 { |
|
324 public: |
|
325 static CTestMmfAclntARN8104* NewL( const TDesC& aTestName, const TDesC& aSectName ); |
|
326 virtual TVerdict DoTestL(); |
|
327 virtual void FsmL(TMmfAudioPlayerEvents aEventCode, TInt aError); |
|
328 |
|
329 protected: |
|
330 CTestMmfAclntARN8104( const TDesC& aTestName, const TDesC& aSectName ); |
|
331 TVerdict PerformTestL(); |
|
332 }; |
|
333 |
|
334 /** |
|
335 * Register (after Play Error) and Get the actual position from where the paused audio can be resumed. |
|
336 * Low priority client is played first. |
|
337 * |
|
338 * @class CTestMmfAclntARN8105 |
|
339 * |
|
340 */ |
|
341 class CTestMmfAclntARN8105 : public CTestMmfAclntAudioPlayerARN |
|
342 { |
|
343 public: |
|
344 static CTestMmfAclntARN8105* NewL( const TDesC& aTestName, const TDesC& aSectName ); |
|
345 virtual TVerdict DoTestL(); |
|
346 virtual void FsmL(TMmfAudioPlayerEvents aEventCode, TInt aError); |
|
347 virtual TBool FsmCheck(TMmfAudioPlayerEvents aEventCode, TInt aError); |
|
348 |
|
349 protected: |
|
350 CTestMmfAclntARN8105( const TDesC& aTestName, const TDesC& aSectName ); |
|
351 TVerdict PerformTestL(); |
|
352 |
|
353 private: |
|
354 TTimeIntervalMicroSeconds iPositionStop; |
|
355 TTimeIntervalMicroSeconds iPositionResume; |
|
356 }; |
|
357 |
|
358 /** |
|
359 * Register (after Play Error) and Get the actual position from where the paused audio can be resumed. |
|
360 * High priority client is played first. |
|
361 * |
|
362 * @class CTestMmfAclntARN8106 |
|
363 * |
|
364 */ |
|
365 class CTestMmfAclntARN8106 : public CTestMmfAclntAudioPlayerARN |
|
366 { |
|
367 public: |
|
368 static CTestMmfAclntARN8106* NewL( const TDesC& aTestName, const TDesC& aSectName ); |
|
369 virtual TVerdict DoTestL(); |
|
370 virtual void FsmL(TMmfAudioPlayerEvents aEventCode, TInt aError); |
|
371 virtual TBool FsmCheck(TMmfAudioPlayerEvents aEventCode, TInt aError); |
|
372 |
|
373 protected: |
|
374 CTestMmfAclntARN8106( const TDesC& aTestName, const TDesC& aSectName ); |
|
375 TVerdict PerformTestL(); |
|
376 |
|
377 private: |
|
378 TTimeIntervalMicroSeconds iPositionStop; |
|
379 TTimeIntervalMicroSeconds iPositionResume; |
|
380 }; |
|
381 |
|
382 /** |
|
383 * Client does not need to Re-register for the same event when the event is received |
|
384 * i.e API is not one shot. |
|
385 * |
|
386 * @class CTestMmfAclntARN8107 |
|
387 * |
|
388 */ |
|
389 class CTestMmfAclntARN8107 : public CTestMmfAclntAudioPlayerARN |
|
390 { |
|
391 public: |
|
392 static CTestMmfAclntARN8107* NewL( const TDesC& aTestName, const TDesC& aSectName ); |
|
393 virtual TVerdict DoTestL(); |
|
394 virtual void FsmL(TMmfAudioPlayerEvents aEventCode, TInt aError); |
|
395 virtual TBool FsmCheck(TMmfAudioPlayerEvents aEventCode, TInt aError); |
|
396 |
|
397 protected: |
|
398 CTestMmfAclntARN8107( const TDesC& aTestName, const TDesC& aSectName ); |
|
399 TVerdict PerformTestL(); |
|
400 }; |
|
401 |
|
402 /** |
|
403 * High priority client plays with repeats and low priority client doesn't get resources |
|
404 * |
|
405 * @class CTestMmfAclntARN8109 |
|
406 * |
|
407 */ |
|
408 class CTestMmfAclntARN8109 : public CTestMmfAclntAudioPlayerARN |
|
409 { |
|
410 public: |
|
411 static CTestMmfAclntARN8109* NewL( const TDesC& aTestName, const TDesC& aSectName ); |
|
412 virtual TVerdict DoTestL(); |
|
413 virtual void FsmL(TMmfAudioPlayerEvents aEventCode, TInt aError); |
|
414 virtual TBool FsmCheck(TMmfAudioPlayerEvents aEventCode, TInt aError); |
|
415 |
|
416 // from MTestAudioPlayerCallback |
|
417 virtual void MarncResourceAvailableTest(TUid aNotificationEventId, const TDesC8& aNotificationData, CTestMdaAudioPlayerCallbackSupport& aMdaAudioPlayerCallbackSupport); |
|
418 virtual void MapcPlayCompleteTest(TInt aError, CTestMdaAudioPlayerCallbackSupport& aMdaAudioPlayerCallbackSupport); |
|
419 |
|
420 protected: |
|
421 CTestMmfAclntARN8109( const TDesC& aTestName, const TDesC& aSectName ); |
|
422 TVerdict PerformTestL(); |
|
423 TBool TimeComparison(const TUint aActual, const TUint aExpected, const TUint aDeviation); |
|
424 private: |
|
425 TTime iStart; |
|
426 TTime iStop; |
|
427 TInt iDuration; |
|
428 TUint iActualDuration; |
|
429 TBool iPlayComplete2; |
|
430 TBool iResourceAvailable1; |
|
431 }; |
|
432 |
|
433 |
|
434 |
|
435 /** |
|
436 * Call WillResumePlay() |
|
437 * |
|
438 * @class CTestMmfAclntARN8108 |
|
439 * |
|
440 */ |
|
441 class CTestMmfAclntARN8108 : public CTestMmfAclntAudioPlayerARN |
|
442 { |
|
443 public: |
|
444 static CTestMmfAclntARN8108* NewL( const TDesC& aTestName, const TDesC& aSectName ); |
|
445 virtual TVerdict DoTestL(); |
|
446 virtual void FsmL(TMmfAudioPlayerEvents aEventCode, TInt aError); |
|
447 virtual void DecideFsmState(TInt aClientNumber,CMultiEventChecker::TClientUtilityType aClientType, TInt aEventCode, TInt aError=KErrNone); |
|
448 protected: |
|
449 TVerdict HandleStateOpenPlayer1(); |
|
450 TVerdict HandleStateOpenPlayer3(); |
|
451 TVerdict HandleStateOpenPlayer2(); |
|
452 TVerdict HandleStateErrInUsePlayer1(); |
|
453 TVerdict HandleStateErrInUsePlayer3(); |
|
454 TVerdict HandleStateNotifiedPlayer1(); |
|
455 TVerdict HandleStateNotifiedPlayer3(); |
|
456 TVerdict HandleStatePlaying1(); |
|
457 CTestMmfAclntARN8108( const TDesC& aTestName, const TDesC& aSectName ); |
|
458 void InitTest(); |
|
459 void StartTestL(); |
|
460 TVerdict PerformTestL(); |
|
461 typedef TVerdict (CTestMmfAclntARN8108::*fp)(); |
|
462 TFixedArray<fp,30> iStateHandlers; |
|
463 }; |
|
464 |
|
465 /** |
|
466 * Dont register for ARN, get pre-empted and then resume from same position. |
|
467 * Test case for DevCR KEVN-7T5EHA |
|
468 * @class CTestMmfAclntARN8110 |
|
469 * |
|
470 */ |
|
471 class CTestMmfAclntARN8110 : public CTestMmfAclntAudioPlayerARN |
|
472 { |
|
473 public: |
|
474 static CTestMmfAclntARN8110* NewL( const TDesC& aTestName, const TDesC& aSectName ); |
|
475 virtual TVerdict DoTestL(); |
|
476 virtual void FsmL(TMmfAudioPlayerEvents aEventCode, TInt aError); |
|
477 |
|
478 protected: |
|
479 CTestMmfAclntARN8110( const TDesC& aTestName, const TDesC& aSectName ); |
|
480 TVerdict PerformTestL(); |
|
481 TTimeIntervalMicroSeconds iPlayer1Pos; |
|
482 }; |
|
483 |
|
484 /** |
|
485 * Dont register for ARN, get pre-empted, stop and chk if position is reset, start play again. |
|
486 * Test case for DevCR KEVN-7T5EHA |
|
487 * @class CTestMmfAclntARN8111 |
|
488 * |
|
489 */ |
|
490 class CTestMmfAclntARN8111 : public CTestMmfAclntAudioPlayerARN |
|
491 { |
|
492 public: |
|
493 static CTestMmfAclntARN8111* NewL( const TDesC& aTestName, const TDesC& aSectName ); |
|
494 virtual TVerdict DoTestL(); |
|
495 virtual void FsmL(TMmfAudioPlayerEvents aEventCode, TInt aError); |
|
496 |
|
497 protected: |
|
498 CTestMmfAclntARN8111( const TDesC& aTestName, const TDesC& aSectName ); |
|
499 TVerdict PerformTestL(); |
|
500 TTimeIntervalMicroSeconds iPlayer1Pos; |
|
501 }; |
|
502 |
|
503 /** |
|
504 * Play higher priority first, then start playing low priority |
|
505 * Test case for DevCR KEVN-7T5EHA |
|
506 * @class CTestMmfAclntARN8112 |
|
507 * |
|
508 */ |
|
509 class CTestMmfAclntARN8112 : public CTestMmfAclntAudioPlayerARN |
|
510 { |
|
511 public: |
|
512 static CTestMmfAclntARN8112* NewL( const TDesC& aTestName, const TDesC& aSectName ); |
|
513 virtual TVerdict DoTestL(); |
|
514 virtual void FsmL(TMmfAudioPlayerEvents aEventCode, TInt aError); |
|
515 |
|
516 protected: |
|
517 CTestMmfAclntARN8112( const TDesC& aTestName, const TDesC& aSectName ); |
|
518 TVerdict PerformTestL(); |
|
519 TTimeIntervalMicroSeconds iPlayer1Pos; |
|
520 }; |
|
521 // |
|
522 //NEGATIVE TESTS// |
|
523 // |
|
524 |
|
525 /** |
|
526 * Register for notification with an unsupported event type. |
|
527 * |
|
528 * @class CTestMmfAclntARN1301 |
|
529 * |
|
530 */ |
|
531 class CTestMmfAclntARN1301 : public CTestMmfAclntAudioPlayerARN |
|
532 { |
|
533 public: |
|
534 static CTestMmfAclntARN1301* NewL( const TDesC& aTestName, const TDesC& aSectName ); |
|
535 virtual TVerdict DoTestL(); |
|
536 virtual void FsmL(TMmfAudioPlayerEvents aEventCode, TInt aError); |
|
537 |
|
538 protected: |
|
539 CTestMmfAclntARN1301( const TDesC& aTestName, const TDesC& aSectName ); |
|
540 TVerdict PerformTestL(); |
|
541 }; |
|
542 |
|
543 /** |
|
544 * Cancel the request for notification with an unsupported event type. |
|
545 * |
|
546 * @class CTestMmfAclntARN1302 |
|
547 * |
|
548 */ |
|
549 class CTestMmfAclntARN1302 : public CTestMmfAclntAudioPlayerARN |
|
550 { |
|
551 public: |
|
552 static CTestMmfAclntARN1302* NewL( const TDesC& aTestName, const TDesC& aSectName ); |
|
553 virtual TVerdict DoTestL(); |
|
554 virtual void FsmL(TMmfAudioPlayerEvents aEventCode, TInt aError); |
|
555 |
|
556 protected: |
|
557 CTestMmfAclntARN1302( const TDesC& aTestName, const TDesC& aSectName ); |
|
558 TVerdict PerformTestL(); |
|
559 }; |
|
560 |
|
561 /** |
|
562 * Cancel when no resource Notification is requested. |
|
563 * |
|
564 * @class CTestMmfAclntARN1303 |
|
565 * |
|
566 */ |
|
567 class CTestMmfAclntARN1303 : public CTestMmfAclntAudioPlayerARN |
|
568 { |
|
569 public: |
|
570 static CTestMmfAclntARN1303* NewL( const TDesC& aTestName, const TDesC& aSectName ); |
|
571 virtual TVerdict DoTestL(); |
|
572 virtual void FsmL(TMmfAudioPlayerEvents aEventCode, TInt aError); |
|
573 |
|
574 protected: |
|
575 CTestMmfAclntARN1303( const TDesC& aTestName, const TDesC& aSectName ); |
|
576 TVerdict PerformTestL(); |
|
577 }; |
|
578 |
|
579 /** |
|
580 * Multiple Registration for notification for the same event type. |
|
581 * |
|
582 * @class CTestMmfAclntARN1304 |
|
583 * |
|
584 */ |
|
585 class CTestMmfAclntARN1304 : public CTestMmfAclntAudioPlayerARN |
|
586 { |
|
587 public: |
|
588 static CTestMmfAclntARN1304* NewL( const TDesC& aTestName, const TDesC& aSectName ); |
|
589 virtual TVerdict DoTestL(); |
|
590 virtual void FsmL(TMmfAudioPlayerEvents aEventCode, TInt aError); |
|
591 |
|
592 protected: |
|
593 CTestMmfAclntARN1304( const TDesC& aTestName, const TDesC& aSectName ); |
|
594 TVerdict PerformTestL(); |
|
595 }; |
|
596 |
|
597 //------------------------------------------------------------------------------ |
|
598 //*****************PREQ 797 - Audio Recorder Test Declarations****************** |
|
599 //------------------------------------------------------------------------------ |
|
600 |
|
601 // |
|
602 //ENUM DECLARATIONS// |
|
603 // |
|
604 |
|
605 // Enum to decide which Event has occured. |
|
606 enum TMmfAudioRecorderEvents |
|
607 { |
|
608 EIdleRecorder = 0, |
|
609 EMoscoStateChange1, |
|
610 EMoscoStateChange2, |
|
611 EMoscoStateChange3, |
|
612 EMarncResourceAvailableRec1, |
|
613 EMarncResourceAvailableRec2, |
|
614 EMarncResourceAvailableRec3 |
|
615 }; |
|
616 |
|
617 // |
|
618 //BASE CLASS DECLARATIONS// |
|
619 // |
|
620 |
|
621 /** |
|
622 * Observer class to identify and pass events to the test step class |
|
623 * |
|
624 * @class MTestAudioRecorderCallback |
|
625 * |
|
626 */ |
|
627 class MTestAudioRecorderCallback |
|
628 { |
|
629 public : |
|
630 virtual void MoscoStateChangeEventTest(CBase* aObject,TInt aPreviousState,TInt aCurrentState, TInt aErrorCode, CTestMdaAudioRecorderCallbackSupport& aMdaAudioRecorderCallbackSupport) = 0; |
|
631 virtual void MarncResourceAvailableTest(TUid aNotificationEventId, const TDesC8& aNotificationData, CTestMdaAudioRecorderCallbackSupport& aMdaAudioRecorderCallbackSupport) = 0; |
|
632 }; |
|
633 |
|
634 /** |
|
635 * Support class to pass the events to the test step class using the MTestAudioRecorderCallback |
|
636 * |
|
637 * @class CTestMdaAudioRecorderCallbackSupport |
|
638 * |
|
639 */ |
|
640 class CTestMdaAudioRecorderCallbackSupport : public CBase, public MMdaObjectStateChangeObserver, public MMMFAudioResourceNotificationCallback |
|
641 { |
|
642 public : |
|
643 static CTestMdaAudioRecorderCallbackSupport* NewL(MTestAudioRecorderCallback& aCallback); |
|
644 virtual void MoscoStateChangeEvent(CBase* aObject,TInt aPreviousState,TInt aCurrentState, TInt aErrorCode); |
|
645 virtual void MarncResourceAvailable(TUid aNotificationEventId, const TDesC8& aNotificationData); |
|
646 protected: |
|
647 CTestMdaAudioRecorderCallbackSupport(MTestAudioRecorderCallback& aCallback); |
|
648 void ConstructL(); |
|
649 private : |
|
650 MTestAudioRecorderCallback& iCallback; |
|
651 }; |
|
652 |
|
653 /** |
|
654 * Base Class for ARN functionality for most ARN audio recorder tests |
|
655 * |
|
656 * @class CTestMmfAclntRecordARN |
|
657 * |
|
658 */ |
|
659 class CTestMmfAclntRecordARN : public CTestMmfAclntStep, public MTestAudioRecorderCallback |
|
660 { |
|
661 public: |
|
662 // Constructor |
|
663 CTestMmfAclntRecordARN(const TDesC& aTestName, const TDesC& aSectName); |
|
664 // Virtual methods for Preamble and Postamble. |
|
665 virtual TVerdict DoTestStepPreambleL(); |
|
666 virtual TVerdict DoTestStepPostambleL(); |
|
667 // Virtual function to access test specific methods |
|
668 virtual TVerdict DoTestStepL(); |
|
669 // Pure function to access test specific methods |
|
670 virtual TVerdict DoTestL()=0; |
|
671 // from MTestAudioRecorderCallback |
|
672 void MoscoStateChangeEventTest(CBase* aObject,TInt aPreviousState,TInt aCurrentState, TInt aErrorCode, CTestMdaAudioRecorderCallbackSupport& aMdaAudioRecorderCallbackSupport); |
|
673 void MarncResourceAvailableTest(TUid aNotificationEventId, const TDesC8& aNotificationData, CTestMdaAudioRecorderCallbackSupport& aMdaAudioRecorderCallbackSupport); |
|
674 // Centralised State Handler |
|
675 virtual void FsmL(TMmfAudioRecorderEvents aEventCode, CMdaAudioClipUtility::TState aRecorderState, TInt aError=KErrNone)=0; |
|
676 virtual TBool FsmCheck(TMmfAudioRecorderEvents aEventCode, CMdaAudioClipUtility::TState aRecorderState, TInt aError=KErrNone); |
|
677 protected: |
|
678 // StateInit Function |
|
679 void StateInit(); |
|
680 // StateChange Function |
|
681 void StateChange(TMmfAudioRecorderEvents aExpectedEvent, CMdaAudioClipUtility::TState aExpectedRecorderState, TInt aExpectedError=KErrNone); |
|
682 protected : |
|
683 // CMdaAudioRecorderUtility instances |
|
684 CMdaAudioRecorderUtility* iTestAudioRecorder1; |
|
685 CMdaAudioRecorderUtility* iTestAudioRecorder2; |
|
686 CMdaAudioRecorderUtility* iTestAudioRecorder3; |
|
687 // CTestMdaAudioRecorderCallbackSupport instances |
|
688 CTestMdaAudioRecorderCallbackSupport* iMdaAudioRecorderCallbackSupport1; |
|
689 CTestMdaAudioRecorderCallbackSupport* iMdaAudioRecorderCallbackSupport2; |
|
690 CTestMdaAudioRecorderCallbackSupport* iMdaAudioRecorderCallbackSupport3; |
|
691 // Other class variable declarations |
|
692 TBuf<KSizeBuf> iFilename1; |
|
693 TBuf<KSizeBuf> iFilename2; |
|
694 TBuf<KSizeBuf> iFilename3; |
|
695 TInt iError; |
|
696 TInt iState; |
|
697 TRequestStatus iRequestStatus; |
|
698 CCallBackTimer* iCallBackTimer; |
|
699 TMmfAudioRecorderEvents iExpectedEvent; |
|
700 CMdaAudioClipUtility::TState iExpectedRecorderState; |
|
701 TInt iExpectedError; |
|
702 TTimeIntervalMicroSeconds iDuration; |
|
703 TTimeIntervalMicroSeconds iPosition; |
|
704 TMmfAudioRecorderEvents iEventOccured; |
|
705 TBuf<KNameBufSize> iSectName; // Section name for retrieving filename |
|
706 }; |
|
707 |
|
708 // |
|
709 //POSITIVE TESTS// |
|
710 // |
|
711 |
|
712 /** |
|
713 * Register for notification, but make no request to play audio. |
|
714 * |
|
715 * @class CTestMmfAclntARN8011 |
|
716 * |
|
717 */ |
|
718 class CTestMmfAclntARN8011 : public CTestMmfAclntRecordARN |
|
719 { |
|
720 public: |
|
721 static CTestMmfAclntARN8011* NewL( const TDesC& aTestName, const TDesC& aSectName ); |
|
722 virtual TVerdict DoTestL(); |
|
723 virtual void FsmL(TMmfAudioRecorderEvents aEventCode, CMdaAudioClipUtility::TState aRecorderState, TInt aError=KErrNone); |
|
724 |
|
725 protected: |
|
726 CTestMmfAclntARN8011( const TDesC& aTestName, const TDesC& aSectName ); |
|
727 TVerdict PerformTestL(); |
|
728 }; |
|
729 |
|
730 |
|
731 /** |
|
732 * Register (b4 play, after Open) and Receive Notification of a Resource Available Event. |
|
733 * (when audio resource is currently unavailable and then available) |
|
734 * |
|
735 * @class CTestMmfAclntARN8012 |
|
736 * |
|
737 */ |
|
738 class CTestMmfAclntARN8012 : public CTestMmfAclntRecordARN |
|
739 { |
|
740 public: |
|
741 static CTestMmfAclntARN8012* NewL( const TDesC& aTestName, const TDesC& aSectName ); |
|
742 virtual TVerdict DoTestL(); |
|
743 virtual void FsmL(TMmfAudioRecorderEvents aEventCode, CMdaAudioClipUtility::TState aRecorderState, TInt aError=KErrNone); |
|
744 |
|
745 protected: |
|
746 CTestMmfAclntARN8012( const TDesC& aTestName, const TDesC& aSectName ); |
|
747 TVerdict PerformTestL(); |
|
748 }; |
|
749 |
|
750 /** |
|
751 * Register (at the time of Play) and Receive Notification of a Resource Available Event. |
|
752 * (when audio resource is currently available and subsequently unavailable, and then available) |
|
753 * |
|
754 * @class CTestMmfAclntARN8013 |
|
755 * |
|
756 */ |
|
757 class CTestMmfAclntARN8013 : public CTestMmfAclntRecordARN |
|
758 { |
|
759 public: |
|
760 static CTestMmfAclntARN8013* NewL( const TDesC& aTestName, const TDesC& aSectName ); |
|
761 virtual TVerdict DoTestL(); |
|
762 virtual void FsmL(TMmfAudioRecorderEvents aEventCode, CMdaAudioClipUtility::TState aRecorderState, TInt aError=KErrNone); |
|
763 |
|
764 protected: |
|
765 CTestMmfAclntARN8013( const TDesC& aTestName, const TDesC& aSectName ); |
|
766 TVerdict PerformTestL(); |
|
767 }; |
|
768 |
|
769 /** |
|
770 * Registration (b4 File Open) and Cancellation of the notification request |
|
771 * |
|
772 * @class CTestMmfAclntARN8014 |
|
773 * |
|
774 */ |
|
775 class CTestMmfAclntARN8014 : public CTestMmfAclntRecordARN |
|
776 { |
|
777 public: |
|
778 static CTestMmfAclntARN8014* NewL( const TDesC& aTestName, const TDesC& aSectName ); |
|
779 virtual TVerdict DoTestL(); |
|
780 virtual void FsmL(TMmfAudioRecorderEvents aEventCode, CMdaAudioClipUtility::TState aRecorderState, TInt aError=KErrNone); |
|
781 |
|
782 protected: |
|
783 CTestMmfAclntARN8014( const TDesC& aTestName, const TDesC& aSectName ); |
|
784 TVerdict PerformTestL(); |
|
785 }; |
|
786 |
|
787 /** |
|
788 * Get the actual position from where the paused audio can be resumed. |
|
789 * |
|
790 * @class CTestMmfAclntARN8015 |
|
791 * |
|
792 */ |
|
793 class CTestMmfAclntARN8015 : public CTestMmfAclntRecordARN |
|
794 { |
|
795 public: |
|
796 static CTestMmfAclntARN8015* NewL( const TDesC& aTestName, const TDesC& aSectName ); |
|
797 virtual TVerdict DoTestL(); |
|
798 virtual void FsmL(TMmfAudioRecorderEvents aEventCode, CMdaAudioClipUtility::TState aRecorderState, TInt aError=KErrNone); |
|
799 virtual TBool FsmCheck(TMmfAudioRecorderEvents aEventCode, CMdaAudioClipUtility::TState aRecorderState, TInt aError=KErrNone); |
|
800 |
|
801 protected: |
|
802 CTestMmfAclntARN8015( const TDesC& aTestName, const TDesC& aSectName ); |
|
803 TVerdict PerformTestL(); |
|
804 |
|
805 private: |
|
806 TTimeIntervalMicroSeconds iPositionStop; |
|
807 TTimeIntervalMicroSeconds iPositionResume; |
|
808 }; |
|
809 |
|
810 /** |
|
811 * Call WillResumePlay() |
|
812 * |
|
813 * @class CTestMmfAclntARN8016 |
|
814 * |
|
815 */ |
|
816 class CTestMmfAclntARN8016 : public CTestMmfAclntRecordARN |
|
817 { |
|
818 public: |
|
819 static CTestMmfAclntARN8016* NewL( const TDesC& aTestName, const TDesC& aSectName ); |
|
820 virtual TVerdict DoTestL(); |
|
821 virtual void FsmL(TMmfAudioRecorderEvents aEventCode, CMdaAudioClipUtility::TState aRecorderState, TInt aError=KErrNone); |
|
822 virtual TBool FsmCheck(TMmfAudioRecorderEvents aEventCode, CMdaAudioClipUtility::TState aRecorderState, TInt aError=KErrNone); |
|
823 |
|
824 protected: |
|
825 CTestMmfAclntARN8016( const TDesC& aTestName, const TDesC& aSectName ); |
|
826 TVerdict PerformTestL(); |
|
827 |
|
828 private: |
|
829 TTimeIntervalMicroSeconds iPositionStop; |
|
830 TTimeIntervalMicroSeconds iPositionResume; |
|
831 }; |
|
832 |
|
833 |
|
834 // |
|
835 //NEGATIVE TESTS// |
|
836 // |
|
837 |
|
838 /** |
|
839 * Register for notification with an unsupported event type. |
|
840 * |
|
841 * @class CTestMmfAclntARN1311 |
|
842 * |
|
843 */ |
|
844 class CTestMmfAclntARN1311 : public CTestMmfAclntRecordARN |
|
845 { |
|
846 public: |
|
847 static CTestMmfAclntARN1311* NewL( const TDesC& aTestName, const TDesC& aSectName ); |
|
848 virtual TVerdict DoTestL(); |
|
849 virtual void FsmL(TMmfAudioRecorderEvents aEventCode, CMdaAudioClipUtility::TState aRecorderState, TInt aError=KErrNone); |
|
850 |
|
851 protected: |
|
852 CTestMmfAclntARN1311( const TDesC& aTestName, const TDesC& aSectName ); |
|
853 TVerdict PerformTestL(); |
|
854 }; |
|
855 |
|
856 /** |
|
857 * Cancel the request for notification with an unsupported event type. |
|
858 * |
|
859 * @class CTestMmfAclntARN1312 |
|
860 * |
|
861 */ |
|
862 class CTestMmfAclntARN1312 : public CTestMmfAclntRecordARN |
|
863 { |
|
864 public: |
|
865 static CTestMmfAclntARN1312* NewL( const TDesC& aTestName, const TDesC& aSectName ); |
|
866 virtual TVerdict DoTestL(); |
|
867 virtual void FsmL(TMmfAudioRecorderEvents aEventCode, CMdaAudioClipUtility::TState aRecorderState, TInt aError=KErrNone); |
|
868 |
|
869 protected: |
|
870 CTestMmfAclntARN1312( const TDesC& aTestName, const TDesC& aSectName ); |
|
871 TVerdict PerformTestL(); |
|
872 }; |
|
873 |
|
874 /** |
|
875 * Cancel when no resource Notification is requested. |
|
876 * |
|
877 * @class CTestMmfAclntARN1313 |
|
878 * |
|
879 */ |
|
880 class CTestMmfAclntARN1313 : public CTestMmfAclntRecordARN |
|
881 { |
|
882 public: |
|
883 static CTestMmfAclntARN1313* NewL( const TDesC& aTestName, const TDesC& aSectName ); |
|
884 virtual TVerdict DoTestL(); |
|
885 virtual void FsmL(TMmfAudioRecorderEvents aEventCode, CMdaAudioClipUtility::TState aRecorderState, TInt aError=KErrNone); |
|
886 |
|
887 protected: |
|
888 CTestMmfAclntARN1313( const TDesC& aTestName, const TDesC& aSectName ); |
|
889 TVerdict PerformTestL(); |
|
890 }; |
|
891 |
|
892 /** |
|
893 * Multiple Registration for notification for the same event type. |
|
894 * |
|
895 * @class CTestMmfAclntARN1314 |
|
896 * |
|
897 */ |
|
898 class CTestMmfAclntARN1314 : public CTestMmfAclntRecordARN |
|
899 { |
|
900 public: |
|
901 static CTestMmfAclntARN1314* NewL( const TDesC& aTestName, const TDesC& aSectName ); |
|
902 virtual TVerdict DoTestL(); |
|
903 virtual void FsmL(TMmfAudioRecorderEvents aEventCode, CMdaAudioClipUtility::TState aRecorderState, TInt aError=KErrNone); |
|
904 |
|
905 protected: |
|
906 CTestMmfAclntARN1314( const TDesC& aTestName, const TDesC& aSectName ); |
|
907 TVerdict PerformTestL(); |
|
908 }; |
|
909 |
|
910 |
|
911 //------------------------------------------------------------------------------ |
|
912 //***************PREQ 797 - Audio OutputStream Test Declarations**************** |
|
913 //------------------------------------------------------------------------------ |
|
914 |
|
915 // |
|
916 //ENUM DECLARATIONS// |
|
917 // |
|
918 |
|
919 _LIT(KStreamRawFile1,"c:\\AclntITestData\\test.raw"); |
|
920 _LIT(KStreamRawFile2,"c:\\AclntITestData\\test2.raw"); |
|
921 _LIT(KStreamRawFile3,"c:\\AclntITestData\\test3.raw"); |
|
922 |
|
923 // Enum to decide which Event has occured. |
|
924 enum TMmfAudioOutputStreamEvents |
|
925 { |
|
926 EIdleOutputStream = 0, |
|
927 EMaoscOpenComplete1, |
|
928 EMaoscOpenComplete2, |
|
929 EMaoscOpenComplete3, |
|
930 EMaoscBufferCopied1, |
|
931 EMaoscBufferCopied2, |
|
932 EMaoscBufferCopied3, |
|
933 EMaoscPlayComplete1, |
|
934 EMaoscPlayComplete2, |
|
935 EMaoscPlayComplete3, |
|
936 EMarncResourceAvailableOS1, |
|
937 EMarncResourceAvailableOS2, |
|
938 EMarncResourceAvailableOS3, |
|
939 }; |
|
940 |
|
941 enum TFsmOutputStreamState |
|
942 { |
|
943 EStateIdle = 0, |
|
944 EStateOpening1, |
|
945 EStateOpening2, |
|
946 EStateOpening3, |
|
947 EStateOpenComplete1, |
|
948 EStateOpenComplete2, |
|
949 EStateOpenComplete3, |
|
950 EStateStreaming1, |
|
951 EStateStreaming2, |
|
952 EStateStreaming3, |
|
953 EStateResumeStreaming1, |
|
954 EStateResumeStreaming2, |
|
955 EStateResumeStreaming3, |
|
956 EStateBufferCopied1, |
|
957 EStateBufferCopied2, |
|
958 EStateBufferCopied3, |
|
959 EStateStreamingComplete1, |
|
960 EStateStreamingComplete1ErrInUse, |
|
961 EStateStreamingComplete1ErrUnderflow, |
|
962 EStateStreamingComplete2, |
|
963 EStateStreamingComplete2ErrInUse, |
|
964 EStateStreamingComplete2ErrUnderflow, |
|
965 EStateStreamingComplete3, |
|
966 EStateStreamingComplete3ErrInUse, |
|
967 EStateStreamingComplete3ErrUnderflow, |
|
968 EStateResourceAvailableOS1, |
|
969 EStateResourceAvailableOS2, |
|
970 EStateResourceAvailableOS3, |
|
971 EStateMonitoringEvents, |
|
972 EStateFinished |
|
973 }; |
|
974 |
|
975 // |
|
976 //BASE CLASS DECLARATIONS// |
|
977 // |
|
978 |
|
979 /** |
|
980 * Observer class to identify and pass events to the test step class |
|
981 * |
|
982 * @class MTestAudioOutputStreamCallback |
|
983 * |
|
984 */ |
|
985 class MTestAudioOutputStreamCallback |
|
986 { |
|
987 public : |
|
988 virtual void MaoscOpenCompleteTest(TInt aError, CTestMdaAudioOutputStreamCallbackSupport& aMdaAudioOutputStreamCallbackSupport) = 0; |
|
989 virtual void MaoscBufferCopiedTest(TInt aError, const TDesC8& aBuffer, CTestMdaAudioOutputStreamCallbackSupport& aMdaAudioOutputStreamCallbackSupport) = 0; |
|
990 virtual void MaoscPlayCompleteTest(TInt aError, CTestMdaAudioOutputStreamCallbackSupport& aMdaAudioOutputStreamCallbackSupport) = 0; |
|
991 virtual void MarncResourceAvailableTest(TUid aNotificationEventId, const TDesC8& aNotificationData, CTestMdaAudioOutputStreamCallbackSupport& aMdaAudioOutputStreamCallbackSupport) = 0; |
|
992 }; |
|
993 |
|
994 /** |
|
995 * Support class to pass the events to the test step class using the MTestAudioOutputStreamCallback |
|
996 * |
|
997 * @class CTestMdaAudioOutputStreamCallbackSupport |
|
998 * |
|
999 */ |
|
1000 class CTestMdaAudioOutputStreamCallbackSupport : public CBase, public MMdaAudioOutputStreamCallback, public MMMFAudioResourceNotificationCallback |
|
1001 { |
|
1002 public : |
|
1003 static CTestMdaAudioOutputStreamCallbackSupport* NewL(MTestAudioOutputStreamCallback& aCallback); |
|
1004 virtual void MaoscOpenComplete(TInt aError); |
|
1005 virtual void MaoscBufferCopied(TInt aError, const TDesC8& aBuffer); |
|
1006 virtual void MaoscPlayComplete(TInt aError); |
|
1007 virtual void MarncResourceAvailable(TUid aNotificationEventId, const TDesC8& aNotificationData); |
|
1008 protected: |
|
1009 CTestMdaAudioOutputStreamCallbackSupport(MTestAudioOutputStreamCallback& aCallback); |
|
1010 void ConstructL(); |
|
1011 private : |
|
1012 MTestAudioOutputStreamCallback& iCallback; |
|
1013 }; |
|
1014 |
|
1015 |
|
1016 /** |
|
1017 * Base Class for ARN functionality for most ARN Audio Output Stream tests |
|
1018 * |
|
1019 * @class CTestStepAudioOutputStreamARN |
|
1020 * |
|
1021 */ |
|
1022 class CTestStepAudioOutputStreamARN : public CTestMmfAclntStep, public MTestAudioOutputStreamCallback |
|
1023 { |
|
1024 public: |
|
1025 // Virtual methods for Preamble and Postamble. |
|
1026 virtual enum TVerdict DoTestStepPreambleL(); |
|
1027 virtual enum TVerdict DoTestStepPostambleL(); |
|
1028 // Virtual function to access test specific methods |
|
1029 virtual TVerdict DoTestStepL(); |
|
1030 // Pure function to access test specific methods |
|
1031 virtual TVerdict DoTestL()=0; |
|
1032 // from MTestAudioOutputStreamCallback |
|
1033 virtual void MaoscOpenCompleteTest(TInt aError, CTestMdaAudioOutputStreamCallbackSupport& aMdaAudioOutputStreamCallbackSupport); |
|
1034 virtual void MaoscBufferCopiedTest(TInt aError, const TDesC8& aBuffer, CTestMdaAudioOutputStreamCallbackSupport& aMdaAudioOutputStreamCallbackSupport); |
|
1035 virtual void MaoscPlayCompleteTest(TInt aError, CTestMdaAudioOutputStreamCallbackSupport& aMdaAudioOutputStreamCallbackSupport); |
|
1036 virtual void MarncResourceAvailableTest(TUid aNotificationEventId, const TDesC8& aNotificationData, CTestMdaAudioOutputStreamCallbackSupport& aMdaAudioOutputStreamCallbackSupport); |
|
1037 // Centralised State Handler |
|
1038 virtual void FsmL(TMmfAudioOutputStreamEvents aEventCode, TInt aError=KErrNone)=0; |
|
1039 virtual TBool FsmCheck(TMmfAudioOutputStreamEvents aEventCode, TInt aError=KErrNone); |
|
1040 protected: |
|
1041 // Constructor |
|
1042 CTestStepAudioOutputStreamARN(const TDesC& aTestName); |
|
1043 // StateInit Function |
|
1044 void StateInit(); |
|
1045 // StateChange Function |
|
1046 void StateChange(TMmfAudioOutputStreamEvents aExpectedEvent, TInt aExpectedError=KErrNone); |
|
1047 // CMdaAudioOutputStream instances |
|
1048 CMdaAudioOutputStream* iTestAudioOutputStream1; |
|
1049 CMdaAudioOutputStream* iTestAudioOutputStream2; |
|
1050 CMdaAudioOutputStream* iTestAudioOutputStream3; |
|
1051 // CTestMdaAudioOutputStreamCallbackSupport instances |
|
1052 CTestMdaAudioOutputStreamCallbackSupport* iMdaAudioOutputStreamCallbackSupport1; |
|
1053 CTestMdaAudioOutputStreamCallbackSupport* iMdaAudioOutputStreamCallbackSupport2; |
|
1054 CTestMdaAudioOutputStreamCallbackSupport* iMdaAudioOutputStreamCallbackSupport3; |
|
1055 // Other class variable declarations |
|
1056 RFs iFs; |
|
1057 RFile iFile1; |
|
1058 RFile iFile2; |
|
1059 RFile iFile3; |
|
1060 TInt iFileSize1; |
|
1061 TInt iFileSize2; |
|
1062 TInt iFileSize3; |
|
1063 RBuf8 iBuf1; |
|
1064 RBuf8 iBuf2; |
|
1065 RBuf8 iBuf3; |
|
1066 TInt iError; |
|
1067 TTimeIntervalMicroSeconds iPosition; |
|
1068 TInt iState; |
|
1069 TRequestStatus iRequestStatus; |
|
1070 CCallBackTimer* iCallBackTimer; |
|
1071 TMmfAudioOutputStreamEvents iExpectedEvent; |
|
1072 TInt iExpectedError; |
|
1073 TMmfAudioOutputStreamEvents iEventOccured; |
|
1074 }; |
|
1075 |
|
1076 |
|
1077 class CFsmAudioOutputStreamClient; |
|
1078 /** |
|
1079 * Base Class for ARN functionality for most ARN Audio Output Stream tests |
|
1080 * |
|
1081 * @class CTestStepAudioOutputStreamARN2 |
|
1082 * |
|
1083 */ |
|
1084 class CTestStepAudioOutputStreamARN2 : public CTestMmfAclntStep |
|
1085 { |
|
1086 public: |
|
1087 enum TFsmAosState |
|
1088 { |
|
1089 EStateIdle = 0, |
|
1090 EStateOpenComplete1, |
|
1091 EStateOpenComplete2, |
|
1092 EStateOpenComplete3, |
|
1093 EStateStreaming1, |
|
1094 EStateStreaming2, |
|
1095 EStateStreaming3, |
|
1096 EStateResumeStreaming1, |
|
1097 EStateResumeStreaming2, |
|
1098 EStateResumeStreaming3, |
|
1099 EStateBufferCopied1, |
|
1100 EStateBufferCopied2, |
|
1101 EStateBufferCopied3, |
|
1102 EStateStreamingComplete1, |
|
1103 EStateStreamingComplete1ErrInUse, |
|
1104 EStateStreamingComplete1ErrUnderflow, |
|
1105 EStateStreamingComplete2, |
|
1106 EStateStreamingComplete2ErrInUse, |
|
1107 EStateStreamingComplete2ErrUnderflow, |
|
1108 EStateStreamingComplete3, |
|
1109 EStateStreamingComplete3ErrInUse, |
|
1110 EStateStreamingComplete3ErrUnderflow, |
|
1111 EStateResourceAvailableOS1, |
|
1112 EStateResourceAvailableOS2, |
|
1113 EStateResourceAvailableOS3, |
|
1114 EStateMonitoringEvents, |
|
1115 EStateFinished, |
|
1116 }; |
|
1117 public: |
|
1118 virtual enum TVerdict DoTestStepPreambleL(); |
|
1119 virtual enum TVerdict DoTestStepPostambleL(); |
|
1120 virtual TVerdict DoTestStepL(); |
|
1121 virtual TVerdict DoTestL()=0; |
|
1122 virtual void Fsm(TInt aClientNumber,TInt aEventCode, TInt aError=KErrNone)=0; |
|
1123 virtual TBool FsmCheck(TInt aClientNumber, TInt aEventCode, TInt aError); |
|
1124 void StopTest(); |
|
1125 protected: |
|
1126 CTestStepAudioOutputStreamARN2(const TDesC& aTestName); |
|
1127 void StateChange(TFsmAosState aState); |
|
1128 void SetExpectedEvent(TInt aClientNumber, TInt aEvent,TInt aError); |
|
1129 //Register client events to monitor |
|
1130 void RegisterClientEventToMonitor(TInt aClientnumber, TInt aEventCode, TInt aError, TFsmAosState aFsmState); |
|
1131 TBool IsMonitoringFinished(); |
|
1132 protected: |
|
1133 TInt iExpectedEvent; |
|
1134 TInt iExpectedError; |
|
1135 TFsmAosState iState; |
|
1136 TFixedArray <CFsmAudioOutputStreamClient*, 4> iClientList; |
|
1137 TFixedArray <TInt, 4> iClientEventsToMonitor; |
|
1138 TFixedArray <TInt, 4> iClientError; |
|
1139 TFixedArray <TFsmAosState, 4> iFsmStateforClient; |
|
1140 TInt iClientsRegistered; |
|
1141 RFs iFs; |
|
1142 TFixedArray<RFile,4> iFileHandle; |
|
1143 TFixedArray<TInt, 4> iFileSize; |
|
1144 TFixedArray<RBuf8, 4> iBuf; |
|
1145 TInt iError; |
|
1146 TTimeIntervalMicroSeconds iPosition; |
|
1147 TRequestStatus iRequestStatus; |
|
1148 CCallBackTimer* iCallBackTimer; |
|
1149 }; |
|
1150 |
|
1151 class CFsmAudioOutputStreamClient : public CBase,public MMdaAudioOutputStreamCallback, public MMMFAudioResourceNotificationCallback |
|
1152 { |
|
1153 public: |
|
1154 // Enum to decide which Event has occured. |
|
1155 enum TMmfAosStreamEvents |
|
1156 { |
|
1157 EIdleOutputStream = 0, |
|
1158 EAudioOuputStreamOpenComplete, |
|
1159 EAudioOutputStreamBufferCopied, |
|
1160 EAudioOutputStreamPlayComplete, |
|
1161 EAudioOutputStreamResourceAvailable, |
|
1162 }; |
|
1163 public: |
|
1164 CFsmAudioOutputStreamClient(TInt aClientNumber,TInt aPriority,TMdaPriorityPreference aPref,CTestStepAudioOutputStreamARN2* aParent ); |
|
1165 ~CFsmAudioOutputStreamClient(); |
|
1166 static CFsmAudioOutputStreamClient* NewL(TInt aClientNumber, TInt aPriority,TMdaPriorityPreference aPref, CTestStepAudioOutputStreamARN2* aParent); |
|
1167 //Callback handlers |
|
1168 void MaoscOpenComplete(TInt aError); |
|
1169 void MaoscPlayComplete(TInt aError); |
|
1170 void MaoscBufferCopied(TInt aError, const TDesC8& aBuffer); |
|
1171 void MarncResourceAvailable(TUid aNotificationEventId, const TDesC8& aNotificationData); |
|
1172 |
|
1173 void TestOpen(); |
|
1174 TInt TestRegisterAsClient(); |
|
1175 TInt TestWrite(const TDesC8 &aData); |
|
1176 const TTimeIntervalMicroSeconds& GetCurrentPosition(); |
|
1177 TTimeIntervalMicroSeconds& GetResumedPosition(); |
|
1178 TInt BytesPlayed(); |
|
1179 private: |
|
1180 void ConstructL(); |
|
1181 private: |
|
1182 TMmfAosStreamEvents iEvent; |
|
1183 TInt iError; |
|
1184 TInt iClientNumber; |
|
1185 TInt iPriority; |
|
1186 TMdaPriorityPreference iPref; |
|
1187 CMdaAudioOutputStream* iMmfAudioOutputStream; |
|
1188 CTestStepAudioOutputStreamARN2* iParent; |
|
1189 TTimeIntervalMicroSeconds iResumedPosition; |
|
1190 }; |
|
1191 // |
|
1192 //POSITIVE TESTS// |
|
1193 // |
|
1194 |
|
1195 /** |
|
1196 * Register for notification, but make no request to play audio. |
|
1197 * |
|
1198 * @class CTestMmfAclntARN8021 |
|
1199 * |
|
1200 */ |
|
1201 class CTestMmfAclntARN8021 : public CTestStepAudioOutputStreamARN |
|
1202 { |
|
1203 public: |
|
1204 static CTestMmfAclntARN8021* NewL( const TDesC& aTestName ); |
|
1205 virtual TVerdict DoTestL(); |
|
1206 virtual void FsmL(TMmfAudioOutputStreamEvents aEventCode, TInt aError=KErrNone); |
|
1207 |
|
1208 protected: |
|
1209 CTestMmfAclntARN8021( const TDesC& aTestName ); |
|
1210 TVerdict PerformTestL(); |
|
1211 }; |
|
1212 |
|
1213 |
|
1214 /** |
|
1215 * Register (b4 play, after Open) and Receive Notification of a Resource Available Event. |
|
1216 * (when audio resource is currently unavailable and then available) |
|
1217 * |
|
1218 * @class CTestMmfAclntARN8022 |
|
1219 * |
|
1220 */ |
|
1221 class CTestMmfAclntARN8022 : public CTestStepAudioOutputStreamARN2 |
|
1222 { |
|
1223 public: |
|
1224 static CTestMmfAclntARN8022* NewL( const TDesC& aTestName ); |
|
1225 virtual TVerdict DoTestL(); |
|
1226 void Fsm(TInt aClientNumber,TInt aEventCode, TInt aError=KErrNone); |
|
1227 |
|
1228 protected: |
|
1229 CTestMmfAclntARN8022( const TDesC& aTestName ); |
|
1230 TVerdict PerformTestL(); |
|
1231 private: |
|
1232 void InitTest(); |
|
1233 void StartTestL(); |
|
1234 TVerdict HandleStateStreaming2(); |
|
1235 TVerdict HandleStateStreamingComplete1ErrInUse(); |
|
1236 TVerdict HandleStateResourceAvailableOS1(); |
|
1237 TVerdict HandleStateStreamingComplete2ErrUnderflow(); |
|
1238 TVerdict HandleStateOpenComplete2(); |
|
1239 TVerdict HandleStateOpenComplete1(); |
|
1240 private: |
|
1241 typedef TVerdict (CTestMmfAclntARN8022::*fp)();//Function pointer for a StateHandler |
|
1242 TFixedArray<fp,30> iStateHandlers; |
|
1243 }; |
|
1244 |
|
1245 /** |
|
1246 * Register (at the time of Play) and Receive Notification of a Resource Available Event. |
|
1247 * (when audio resource is currently available and subsequently unavailable, and then available) |
|
1248 * |
|
1249 * @class CTestMmfAclntARN8023 |
|
1250 * |
|
1251 */ |
|
1252 class CTestMmfAclntARN8023 : public CTestStepAudioOutputStreamARN2 |
|
1253 { |
|
1254 public: |
|
1255 static CTestMmfAclntARN8023* NewL( const TDesC& aTestName ); |
|
1256 virtual TVerdict DoTestL(); |
|
1257 void Fsm(TInt aClientNumber,TInt aEventCode, TInt aError=KErrNone); |
|
1258 |
|
1259 protected: |
|
1260 CTestMmfAclntARN8023( const TDesC& aTestName ); |
|
1261 TVerdict PerformTestL(); |
|
1262 private: |
|
1263 void InitTest(); |
|
1264 void StartTestL(); |
|
1265 TVerdict HandleStateStreaming1(); |
|
1266 TVerdict HandleStateStreaming2(); |
|
1267 TVerdict HandleStateStreamingComplete1ErrInUse(); |
|
1268 TVerdict HandleStateResourceAvailableOS1(); |
|
1269 TVerdict HandleStateStreamingComplete2ErrUnderflow(); |
|
1270 TVerdict HandleStateOpenComplete2(); |
|
1271 TVerdict HandleStateOpenComplete1(); |
|
1272 private: |
|
1273 typedef TVerdict (CTestMmfAclntARN8023::*fp)(); |
|
1274 TFixedArray<fp,30> iStateHandlers; |
|
1275 }; |
|
1276 |
|
1277 /** |
|
1278 * Registration (b4 File Open) and Cancellation of the notification request |
|
1279 * |
|
1280 * @class CTestMmfAclntARN8024 |
|
1281 * |
|
1282 */ |
|
1283 class CTestMmfAclntARN8024 : public CTestStepAudioOutputStreamARN |
|
1284 { |
|
1285 public: |
|
1286 static CTestMmfAclntARN8024* NewL( const TDesC& aTestName ); |
|
1287 virtual TVerdict DoTestL(); |
|
1288 virtual void FsmL(TMmfAudioOutputStreamEvents aEventCode, TInt aError=KErrNone); |
|
1289 |
|
1290 protected: |
|
1291 CTestMmfAclntARN8024( const TDesC& aTestName ); |
|
1292 TVerdict PerformTestL(); |
|
1293 }; |
|
1294 |
|
1295 /** |
|
1296 * Get the actual position from where the paused audio can be resumed. |
|
1297 * |
|
1298 * @class CTestMmfAclntARN8025 |
|
1299 * |
|
1300 */ |
|
1301 class CTestMmfAclntARN8025 : public CTestStepAudioOutputStreamARN2 |
|
1302 { |
|
1303 public: |
|
1304 static CTestMmfAclntARN8025* NewL( const TDesC& aTestName ); |
|
1305 virtual TVerdict DoTestL(); |
|
1306 void Fsm(TInt aClientNumber,TInt aEventCode, TInt aError=KErrNone); |
|
1307 |
|
1308 protected: |
|
1309 CTestMmfAclntARN8025( const TDesC& aTestName ); |
|
1310 TVerdict PerformTestL(); |
|
1311 private: |
|
1312 void InitTest(); |
|
1313 void StartTestL(); |
|
1314 TVerdict HandleStateStreaming1(); |
|
1315 TVerdict HandleStateStreaming2(); |
|
1316 TVerdict HandleStateStreamingComplete1ErrInUse(); |
|
1317 TVerdict HandleStateResourceAvailableOS1(); |
|
1318 TVerdict HandleStateStreamingComplete2ErrUnderflow(); |
|
1319 TVerdict HandleStateOpenComplete2(); |
|
1320 TVerdict HandleStateOpenComplete1(); |
|
1321 private: |
|
1322 typedef TVerdict (CTestMmfAclntARN8025::*fp)(); |
|
1323 TFixedArray<fp,30> iStateHandlers; |
|
1324 TTimeIntervalMicroSeconds iPositionStop; |
|
1325 TTimeIntervalMicroSeconds iPositionResume; |
|
1326 }; |
|
1327 |
|
1328 /** |
|
1329 * Call WillResumePlay() |
|
1330 * |
|
1331 * @class CTestMmfAclntARN8026 |
|
1332 * |
|
1333 */ |
|
1334 class CTestMmfAclntARN8026 : public CTestStepAudioOutputStreamARN |
|
1335 { |
|
1336 public: |
|
1337 static CTestMmfAclntARN8026* NewL( const TDesC& aTestName ); |
|
1338 virtual TVerdict DoTestL(); |
|
1339 virtual void FsmL(TMmfAudioOutputStreamEvents aEventCode, TInt aError=KErrNone); |
|
1340 virtual TBool FsmCheck(TMmfAudioOutputStreamEvents aEventCode, TInt aError=KErrNone); |
|
1341 |
|
1342 protected: |
|
1343 CTestMmfAclntARN8026( const TDesC& aTestName ); |
|
1344 TVerdict PerformTestL(); |
|
1345 }; |
|
1346 |
|
1347 |
|
1348 // |
|
1349 //NEGATIVE TESTS// |
|
1350 // |
|
1351 |
|
1352 /** |
|
1353 * Register for notification with an unsupported event type. |
|
1354 * |
|
1355 * @class CTestMmfAclntARN1321 |
|
1356 * |
|
1357 */ |
|
1358 class CTestMmfAclntARN1321 : public CTestStepAudioOutputStreamARN |
|
1359 { |
|
1360 public: |
|
1361 static CTestMmfAclntARN1321* NewL( const TDesC& aTestName ); |
|
1362 virtual TVerdict DoTestL(); |
|
1363 virtual void FsmL(TMmfAudioOutputStreamEvents aEventCode, TInt aError=KErrNone); |
|
1364 |
|
1365 protected: |
|
1366 CTestMmfAclntARN1321( const TDesC& aTestName ); |
|
1367 TVerdict PerformTestL(); |
|
1368 }; |
|
1369 |
|
1370 /** |
|
1371 * Cancel the request for notification with an unsupported event type. |
|
1372 * |
|
1373 * @class CTestMmfAclntARN1322 |
|
1374 * |
|
1375 */ |
|
1376 class CTestMmfAclntARN1322 : public CTestStepAudioOutputStreamARN |
|
1377 { |
|
1378 public: |
|
1379 static CTestMmfAclntARN1322* NewL( const TDesC& aTestName ); |
|
1380 virtual TVerdict DoTestL(); |
|
1381 virtual void FsmL(TMmfAudioOutputStreamEvents aEventCode, TInt aError=KErrNone); |
|
1382 |
|
1383 protected: |
|
1384 CTestMmfAclntARN1322( const TDesC& aTestName ); |
|
1385 TVerdict PerformTestL(); |
|
1386 }; |
|
1387 |
|
1388 /** |
|
1389 * Cancel when no resource Notification is requested. |
|
1390 * |
|
1391 * @class CTestMmfAclntARN1323 |
|
1392 * |
|
1393 */ |
|
1394 class CTestMmfAclntARN1323 : public CTestStepAudioOutputStreamARN |
|
1395 { |
|
1396 public: |
|
1397 static CTestMmfAclntARN1323* NewL( const TDesC& aTestName ); |
|
1398 virtual TVerdict DoTestL(); |
|
1399 virtual void FsmL(TMmfAudioOutputStreamEvents aEventCode, TInt aError=KErrNone); |
|
1400 |
|
1401 protected: |
|
1402 CTestMmfAclntARN1323( const TDesC& aTestName ); |
|
1403 TVerdict PerformTestL(); |
|
1404 }; |
|
1405 |
|
1406 /** |
|
1407 * Multiple Registration for notification for the same event type. |
|
1408 * |
|
1409 * @class CTestMmfAclntARN1324 |
|
1410 * |
|
1411 */ |
|
1412 class CTestMmfAclntARN1324 : public CTestStepAudioOutputStreamARN |
|
1413 { |
|
1414 public: |
|
1415 static CTestMmfAclntARN1324* NewL( const TDesC& aTestName ); |
|
1416 virtual TVerdict DoTestL(); |
|
1417 virtual void FsmL(TMmfAudioOutputStreamEvents aEventCode, TInt aError=KErrNone); |
|
1418 |
|
1419 protected: |
|
1420 CTestMmfAclntARN1324( const TDesC& aTestName ); |
|
1421 TVerdict PerformTestL(); |
|
1422 }; |
|
1423 |
|
1424 |
|
1425 //------------------------------------------------------------------------------ |
|
1426 //**************PREQ 797 - Multiple Audio Client Test Declarations************** |
|
1427 //------------------------------------------------------------------------------ |
|
1428 |
|
1429 |
|
1430 // |
|
1431 //BASE CLASS DECLARATIONS// |
|
1432 // |
|
1433 |
|
1434 /** |
|
1435 * Observer class to identify and pass events to the test step class |
|
1436 * |
|
1437 * @class MTestAudioResourceNotificationCallback |
|
1438 * |
|
1439 */ |
|
1440 class MTestAudioResourceNotificationCallback |
|
1441 { |
|
1442 public : |
|
1443 virtual void MarncResourceAvailableTest(TUid aNotificationEventId, const TDesC8& aNotificationData, CTestMdaAudioMultiClientCallbackSupport& aMdaAudioMultiClientCallbackSupport) = 0; |
|
1444 }; |
|
1445 |
|
1446 /** |
|
1447 * Support class to pass the events to the test step class using the MTestAudioResourceNotificationCallback |
|
1448 * |
|
1449 * @class CTestMdaAudioMultiClientCallbackSupport |
|
1450 * |
|
1451 */ |
|
1452 class CTestMdaAudioMultiClientCallbackSupport : public CBase, public MMMFAudioResourceNotificationCallback |
|
1453 { |
|
1454 public : |
|
1455 static CTestMdaAudioMultiClientCallbackSupport* NewL(MTestAudioResourceNotificationCallback& aCallback); |
|
1456 virtual void MarncResourceAvailable(TUid aNotificationEventId, const TDesC8& aNotificationData); |
|
1457 protected: |
|
1458 CTestMdaAudioMultiClientCallbackSupport(MTestAudioResourceNotificationCallback& aCallback); |
|
1459 void ConstructL(); |
|
1460 private : |
|
1461 MTestAudioResourceNotificationCallback& iCallback; |
|
1462 }; |
|
1463 |
|
1464 /** |
|
1465 * Base Class for ARN functionality for most ARN multiple client tests |
|
1466 * |
|
1467 * @class CTestMmfAclntMultiClientARN |
|
1468 * |
|
1469 */ |
|
1470 class CTestMmfAclntMultiClientARN : public CTestMmfAclntStep, public MMdaAudioPlayerCallback, public MMdaObjectStateChangeObserver, public MMdaAudioOutputStreamCallback, public MTestAudioResourceNotificationCallback |
|
1471 { |
|
1472 public: |
|
1473 // Enum to decide which Event has occured. |
|
1474 enum TMmfAudioMultiClientEvents |
|
1475 { |
|
1476 EIdleMulti = 0, |
|
1477 EMapcInitComplete, |
|
1478 EMapcPlayComplete, |
|
1479 EMoscoStateChangeEvent, |
|
1480 EMaoscOpenComplete, |
|
1481 EMaoscBufferCopied, |
|
1482 EMaoscPlayComplete, |
|
1483 EMarncResourceAvailablePlayer, |
|
1484 EMarncResourceAvailableRecorder, |
|
1485 EMarncResourceAvailableOS, |
|
1486 EImproperEvent |
|
1487 }; |
|
1488 |
|
1489 // Enum to decide on state |
|
1490 enum TMmfAudioMultiClientStates |
|
1491 { |
|
1492 EStateApInitComplete, |
|
1493 EStateApPlayComplete, |
|
1494 EStateApPlayCompleteKErrInUse, |
|
1495 EStateApResourceAvailable, |
|
1496 EStateRecoderOpen, |
|
1497 EStateRecoderPlaying, |
|
1498 EStateRecorderResumePlay, |
|
1499 EStateRecorderPlayComplete, |
|
1500 EStateRecorderrelease, |
|
1501 EStateAosOpenComplete, |
|
1502 EStateAosBufferCopiedKErrInUse, |
|
1503 EStateAosPlayCompleteKErrInUse, |
|
1504 EStateAosResourceAvailable |
|
1505 }; |
|
1506 public: |
|
1507 // Constructor |
|
1508 CTestMmfAclntMultiClientARN(const TDesC& aTestName, const TDesC& aSectName); |
|
1509 // Virtual methods for Preamble and Postamble. |
|
1510 virtual TVerdict DoTestStepPreambleL(); |
|
1511 virtual TVerdict DoTestStepPostambleL(); |
|
1512 // Virtual function to access test specific methods |
|
1513 virtual TVerdict DoTestStepL(); |
|
1514 // Pure function to access test specific methods |
|
1515 virtual TVerdict DoTestL()=0; |
|
1516 // from MMdaAudioPlayerCallback |
|
1517 virtual void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration); |
|
1518 virtual void MapcPlayComplete(TInt aError); |
|
1519 // from MMdaObjectStateChangeObserver |
|
1520 virtual void MoscoStateChangeEvent(CBase* aObject,TInt aPreviousState,TInt aCurrentState, TInt aErrorCode); |
|
1521 // from MTestAudioOutputStreamCallback |
|
1522 virtual void MaoscOpenComplete(TInt aError); |
|
1523 virtual void MaoscBufferCopied(TInt aError, const TDesC8& aBuffer); |
|
1524 virtual void MaoscPlayComplete(TInt aError); |
|
1525 // from MTestAudioResourceNotificationCallback |
|
1526 virtual void MarncResourceAvailableTest(TUid aNotificationEventId, const TDesC8& aNotificationData, CTestMdaAudioMultiClientCallbackSupport& aMdaAudioMultiClientCallbackSupport); |
|
1527 // Centralised State Handler |
|
1528 virtual void FsmL(TMmfAudioMultiClientEvents aEventCode, TInt aError=KErrNone, CMdaAudioClipUtility::TState aRecorderState=CMdaAudioClipUtility::ENotReady)=0; |
|
1529 virtual TBool FsmCheck(TMmfAudioMultiClientEvents aEventCode, TInt aError=KErrNone, CMdaAudioClipUtility::TState aRecorderState=CMdaAudioClipUtility::ENotReady); |
|
1530 protected: |
|
1531 // StateInit Function |
|
1532 void StateInit(); |
|
1533 // StateChange Function |
|
1534 void StateChange(TMmfAudioMultiClientEvents aExpectedEvent, TInt aExpectedError=KErrNone, CMdaAudioClipUtility::TState aExpectedRecorderState=CMdaAudioClipUtility::ENotReady); |
|
1535 // Audio Client Utilities declaration |
|
1536 CMdaAudioPlayerUtility* iTestAudioPlayer; |
|
1537 CMdaAudioRecorderUtility* iTestAudioRecorder; |
|
1538 CMdaAudioOutputStream* iTestAudioOutputStream; |
|
1539 // CTestMdaAudioMultiClientCallbackSupport instances |
|
1540 CTestMdaAudioMultiClientCallbackSupport* iMdaAudioPlayerCallbackSupport; |
|
1541 CTestMdaAudioMultiClientCallbackSupport* iMdaAudioRecorderCallbackSupport; |
|
1542 CTestMdaAudioMultiClientCallbackSupport* iMdaAudioOutputStreamCallbackSupport; |
|
1543 // Variables to hold the file names |
|
1544 TBuf<KSizeBuf> iFilenamePlayer; |
|
1545 TBuf<KSizeBuf> iFilenameRecorder; |
|
1546 TBuf<KSizeBuf> iFilenameOutputStream; |
|
1547 // Common Class Variables |
|
1548 TInt iError; |
|
1549 TInt iState; |
|
1550 TRequestStatus iRequestStatus; |
|
1551 CCallBackTimer* iCallBackTimer; |
|
1552 // for checking the expected states |
|
1553 TMmfAudioMultiClientEvents iExpectedEvent; |
|
1554 CMdaAudioClipUtility::TState iExpectedRecorderState; |
|
1555 TInt iExpectedError; |
|
1556 TMmfAudioMultiClientEvents iEventOccured; |
|
1557 // for Checking the duration |
|
1558 TTimeIntervalMicroSeconds iDuration; |
|
1559 TTimeIntervalMicroSeconds iPosition; |
|
1560 // for iAudioOutputStream |
|
1561 RFs iFs; |
|
1562 RFile iFile; |
|
1563 TInt iFileSize; |
|
1564 RBuf8 iBuf; |
|
1565 TBuf<KNameBufSize> iSectName; // Section name for retrieving filename |
|
1566 CMultiEventChecker* iEventChecker; |
|
1567 }; |
|
1568 |
|
1569 // |
|
1570 //POSITIVE TESTS// |
|
1571 // |
|
1572 |
|
1573 /** |
|
1574 * Receipt of Notification (on deleting the Audio Play Client instance of a Notified Client) |
|
1575 * of a Resource Available Event. |
|
1576 * |
|
1577 * @class CTestMmfAclntARN9001 |
|
1578 * |
|
1579 */ |
|
1580 class CTestMmfAclntARN9001 : public CTestMmfAclntMultiClientARN |
|
1581 { |
|
1582 public: |
|
1583 static CTestMmfAclntARN9001* NewL( const TDesC& aTestName, const TDesC& aSectName ); |
|
1584 virtual TVerdict DoTestL(); |
|
1585 virtual void FsmL(TMmfAudioMultiClientEvents aEventCode, TInt aError=KErrNone, CMdaAudioClipUtility::TState aRecorderState=CMdaAudioClipUtility::ENotReady); |
|
1586 virtual TBool FsmCheck(TMmfAudioMultiClientEvents aEventCode, TInt aError=KErrNone, CMdaAudioClipUtility::TState aRecorderState=CMdaAudioClipUtility::ENotReady); |
|
1587 |
|
1588 protected: |
|
1589 CTestMmfAclntARN9001( const TDesC& aTestName, const TDesC& aSectName ); |
|
1590 TVerdict PerformTestL(); |
|
1591 }; |
|
1592 |
|
1593 |
|
1594 /** |
|
1595 * Receipt of Notification (on completion of play of a Notifed Client) of a Resource Available Event. |
|
1596 * |
|
1597 * @class CTestMmfAclntARN9002 |
|
1598 * |
|
1599 */ |
|
1600 class CTestMmfAclntARN9002 : public CTestMmfAclntMultiClientARN |
|
1601 { |
|
1602 public: |
|
1603 static CTestMmfAclntARN9002* NewL( const TDesC& aTestName, const TDesC& aSectName ); |
|
1604 virtual TVerdict DoTestL(); |
|
1605 virtual void FsmL(TMmfAudioMultiClientEvents aEventCode, TInt aError=KErrNone, CMdaAudioClipUtility::TState aRecorderState=CMdaAudioClipUtility::ENotReady); |
|
1606 virtual void DecideFsmState(TInt aClientNumber,CMultiEventChecker::TClientUtilityType aClientType, TInt aEventCode, TInt aError=KErrNone,CMdaAudioClipUtility::TState aRecorderState=CMdaAudioClipUtility::ENotReady); |
|
1607 |
|
1608 protected: |
|
1609 CTestMmfAclntARN9002( const TDesC& aTestName, const TDesC& aSectName ); |
|
1610 TVerdict PerformTestL(); |
|
1611 private: |
|
1612 void InitTest(); |
|
1613 void StartTestL(); |
|
1614 TVerdict HandleStateApInitComplete(); |
|
1615 TVerdict HandleStateRecorderOpen(); |
|
1616 TVerdict HandleStateRecorderPlaying(); |
|
1617 TVerdict HandleApPlayCompleteKErrInUse(); |
|
1618 TVerdict HandleStateAosOpenComplete(); |
|
1619 TVerdict HandleStateAosBufferCopiedKErrInUse(); |
|
1620 TVerdict HandleStateAosPlayCompleteKErrInUse(); |
|
1621 TVerdict HandleStateRecorderrelease(); |
|
1622 TVerdict HandleStateApResourceAvailable(); |
|
1623 TVerdict HandleStateApPlayComplete(); |
|
1624 TVerdict HandleStateAosResourceAvailable(); |
|
1625 typedef TVerdict (CTestMmfAclntARN9002::*fp)();//Function pointer for a StateHandler |
|
1626 TFixedArray<fp,30> iStateHandlers; |
|
1627 }; |
|
1628 |
|
1629 /** |
|
1630 * Receipt of Notification (on stopping play of a Notitifed Client) of a Resource Available Event. |
|
1631 * |
|
1632 * @class CTestMmfAclntARN9003 |
|
1633 * |
|
1634 */ |
|
1635 class CTestMmfAclntARN9003 : public CTestMmfAclntMultiClientARN |
|
1636 { |
|
1637 public: |
|
1638 static CTestMmfAclntARN9003* NewL( const TDesC& aTestName, const TDesC& aSectName ); |
|
1639 virtual TVerdict DoTestL(); |
|
1640 virtual void FsmL(TMmfAudioMultiClientEvents aEventCode, TInt aError=KErrNone, CMdaAudioClipUtility::TState aRecorderState=CMdaAudioClipUtility::ENotReady); |
|
1641 protected: |
|
1642 CTestMmfAclntARN9003( const TDesC& aTestName, const TDesC& aSectName ); |
|
1643 TVerdict PerformTestL(); |
|
1644 }; |
|
1645 |
|
1646 /** |
|
1647 * Receipt of Notification (chronological order for equal priority clients) of a Resource Available Event. |
|
1648 * |
|
1649 * @class CTestMmfAclntARN9004 |
|
1650 * |
|
1651 */ |
|
1652 class CTestMmfAclntARN9004 : public CTestMmfAclntMultiClientARN |
|
1653 { |
|
1654 public: |
|
1655 static CTestMmfAclntARN9004* NewL( const TDesC& aTestName, const TDesC& aSectName ); |
|
1656 virtual TVerdict DoTestL(); |
|
1657 virtual void FsmL(TMmfAudioMultiClientEvents aEventCode, TInt aError=KErrNone, CMdaAudioClipUtility::TState aRecorderState=CMdaAudioClipUtility::ENotReady); |
|
1658 virtual TBool FsmCheck(TMmfAudioMultiClientEvents aEventCode, TInt aError=KErrNone, CMdaAudioClipUtility::TState aRecorderState=CMdaAudioClipUtility::ENotReady); |
|
1659 |
|
1660 protected: |
|
1661 CTestMmfAclntARN9004( const TDesC& aTestName, const TDesC& aSectName ); |
|
1662 TVerdict PerformTestL(); |
|
1663 }; |
|
1664 |
|
1665 /** |
|
1666 * Non Receipt of Notification (on calling WillResumePlay() of a notified client) |
|
1667 * of a Resource Available Event. |
|
1668 * |
|
1669 * @class CTestMmfAclntARN9005 |
|
1670 * |
|
1671 */ |
|
1672 class CTestMmfAclntARN9005 : public CTestMmfAclntMultiClientARN |
|
1673 { |
|
1674 public: |
|
1675 static CTestMmfAclntARN9005* NewL( const TDesC& aTestName, const TDesC& aSectName ); |
|
1676 virtual TVerdict DoTestL(); |
|
1677 virtual void FsmL(TMmfAudioMultiClientEvents aEventCode, TInt aError=KErrNone, CMdaAudioClipUtility::TState aRecorderState=CMdaAudioClipUtility::ENotReady); |
|
1678 virtual void DecideFsmState(TInt aClientNumber,CMultiEventChecker::TClientUtilityType aClientType, TInt aEventCode, TInt aError=KErrNone,CMdaAudioClipUtility::TState aRecorderState=CMdaAudioClipUtility::ENotReady); |
|
1679 protected: |
|
1680 CTestMmfAclntARN9005( const TDesC& aTestName, const TDesC& aSectName ); |
|
1681 TVerdict PerformTestL(); |
|
1682 private: |
|
1683 void InitTest(); |
|
1684 void StartTestL(); |
|
1685 TVerdict HandleStateApInitComplete(); |
|
1686 TVerdict HandleStateRecorderOpen(); |
|
1687 TVerdict HandleStateRecorderPlaying(); |
|
1688 TVerdict HandleApPlayCompleteKErrInUse(); |
|
1689 TVerdict HandleStateAosOpenComplete(); |
|
1690 TVerdict HandleStateAosBufferCopiedKErrInUse(); |
|
1691 TVerdict HandleStateAosPlayCompleteKErrInUse(); |
|
1692 TVerdict HandleStateRecorderrelease(); |
|
1693 TVerdict HandleStateApResourceAvailable(); |
|
1694 TVerdict HandleStateApPlayComplete(); |
|
1695 TVerdict HandleStateAosResourceAvailable(); |
|
1696 typedef TVerdict (CTestMmfAclntARN9005::*fp)();//Function pointer for a StateHandler |
|
1697 TFixedArray<fp,30> iStateHandlers; |
|
1698 }; |
|
1699 |
|
1700 /** |
|
1701 * Receipt of Notification (on timeout of a notified client, 1 sec assumed, call |
|
1702 * WillResumePlay() after 1 second) of a Resource Available Event. |
|
1703 * |
|
1704 * @class CTestMmfAclntARN9006 |
|
1705 * |
|
1706 */ |
|
1707 class CTestMmfAclntARN9006 : public CTestMmfAclntMultiClientARN |
|
1708 { |
|
1709 public: |
|
1710 static CTestMmfAclntARN9006* NewL( const TDesC& aTestName, const TDesC& aSectName ); |
|
1711 virtual TVerdict DoTestL(); |
|
1712 virtual void FsmL(TMmfAudioMultiClientEvents aEventCode, TInt aError=KErrNone, CMdaAudioClipUtility::TState aRecorderState=CMdaAudioClipUtility::ENotReady); |
|
1713 virtual void DecideFsmState(TInt aClientNumber,CMultiEventChecker::TClientUtilityType aClientType, TInt aEventCode, TInt aError=KErrNone,CMdaAudioClipUtility::TState aRecorderState=CMdaAudioClipUtility::ENotReady); |
|
1714 protected: |
|
1715 CTestMmfAclntARN9006( const TDesC& aTestName, const TDesC& aSectName ); |
|
1716 TVerdict PerformTestL(); |
|
1717 private: |
|
1718 void InitTest(); |
|
1719 void StartTestL(); |
|
1720 TVerdict HandleStateApInitComplete(); |
|
1721 TVerdict HandleStateRecorderOpen(); |
|
1722 TVerdict HandleStateRecorderPlaying(); |
|
1723 TVerdict HandleApPlayCompleteKErrInUse(); |
|
1724 TVerdict HandleStateAosOpenComplete(); |
|
1725 TVerdict HandleStateAosBufferCopiedKErrInUse(); |
|
1726 TVerdict HandleStateAosPlayCompleteKErrInUse(); |
|
1727 TVerdict HandleStateRecorderrelease(); |
|
1728 TVerdict HandleStateApResourceAvailable(); |
|
1729 TVerdict HandleStateAosResourceAvailable(); |
|
1730 typedef TVerdict (CTestMmfAclntARN9006::*fp)();//Function pointer for a StateHandler |
|
1731 TFixedArray<fp,30> iStateHandlers; |
|
1732 }; |
|
1733 |
|
1734 /** |
|
1735 * Receipt of Notification (on cancellation of the notification of a client that has |
|
1736 * requested for notification) of a Resource Available Event. [Cancel before receipt of Notification] |
|
1737 * |
|
1738 * @class CTestMmfAclntARN9007 |
|
1739 * |
|
1740 */ |
|
1741 class CTestMmfAclntARN9007 : public CTestMmfAclntMultiClientARN |
|
1742 { |
|
1743 public: |
|
1744 static CTestMmfAclntARN9007* NewL( const TDesC& aTestName, const TDesC& aSectName ); |
|
1745 virtual TVerdict DoTestL(); |
|
1746 virtual void FsmL(TMmfAudioMultiClientEvents aEventCode, TInt aError=KErrNone, CMdaAudioClipUtility::TState aRecorderState=CMdaAudioClipUtility::ENotReady); |
|
1747 virtual TBool FsmCheck(TMmfAudioMultiClientEvents aEventCode, TInt aError=KErrNone, CMdaAudioClipUtility::TState aRecorderState=CMdaAudioClipUtility::ENotReady); |
|
1748 |
|
1749 protected: |
|
1750 CTestMmfAclntARN9007( const TDesC& aTestName, const TDesC& aSectName ); |
|
1751 TVerdict PerformTestL(); |
|
1752 }; |
|
1753 |
|
1754 /** |
|
1755 * Receipt of Notification (on cancellation of notification of a client that has just |
|
1756 * received notification) of a Resource Available Event. [Cancel after receipt of Notification] |
|
1757 * |
|
1758 * @class CTestMmfAclntARN9008 |
|
1759 * |
|
1760 */ |
|
1761 class CTestMmfAclntARN9008 : public CTestMmfAclntMultiClientARN |
|
1762 { |
|
1763 public: |
|
1764 static CTestMmfAclntARN9008* NewL( const TDesC& aTestName, const TDesC& aSectName ); |
|
1765 virtual TVerdict DoTestL(); |
|
1766 virtual void FsmL(TMmfAudioMultiClientEvents aEventCode, TInt aError=KErrNone, CMdaAudioClipUtility::TState aRecorderState=CMdaAudioClipUtility::ENotReady); |
|
1767 virtual void DecideFsmState(TInt aClientNumber,CMultiEventChecker::TClientUtilityType aClientType, TInt aEventCode, TInt aError=KErrNone,CMdaAudioClipUtility::TState aRecorderState=CMdaAudioClipUtility::ENotReady); |
|
1768 |
|
1769 protected: |
|
1770 CTestMmfAclntARN9008( const TDesC& aTestName, const TDesC& aSectName ); |
|
1771 TVerdict PerformTestL(); |
|
1772 private: |
|
1773 void InitTest(); |
|
1774 void StartTestL(); |
|
1775 TVerdict HandleStateApInitComplete(); |
|
1776 TVerdict HandleStateApPlayComplete(); |
|
1777 TVerdict HandleStateRecorderOpen(); |
|
1778 TVerdict HandleStateRecorderPlaying(); |
|
1779 TVerdict HandleStateRecorderResumePlay(); |
|
1780 TVerdict HandleApPlayCompleteKErrInUse(); |
|
1781 TVerdict HandleStateAosOpenComplete(); |
|
1782 TVerdict HandleStateAosBufferCopiedKErrInUse(); |
|
1783 TVerdict HandleStateAosPlayCompleteKErrInUse(); |
|
1784 TVerdict HandleStateRecorderrelease(); |
|
1785 TVerdict HandleStateApResourceAvailable(); |
|
1786 TVerdict HandleStateAosResourceAvailable(); |
|
1787 TVerdict HandleStateRecorderPlayComplete(); |
|
1788 typedef TVerdict (CTestMmfAclntARN9008::*fp)();//Function pointer for a StateHandler |
|
1789 TFixedArray<fp,30> iStateHandlers; |
|
1790 }; |
|
1791 |
|
1792 #endif |