0
|
1 |
// Copyright (c) 2002-2010 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 |
//
|
|
15 |
|
|
16 |
#ifndef TSU_MMF_DEVSOUND_STEP_H
|
|
17 |
#define TSU_MMF_DEVSOUND_STEP_H
|
|
18 |
|
|
19 |
#include <testframework.h>
|
|
20 |
#include <mmf/server/sounddevice.h>
|
|
21 |
|
|
22 |
#include "TSU_MMF_DEVSOUND_SUITE.h"
|
|
23 |
#include "../TestInterface/TSU_MMF_DEVSOUND_TestInterface_ImplementationUID.hrh"
|
|
24 |
#include "../TestInterface1/TSU_MMF_DEVSOUND_TestInterface1_ImplementationUID.hrh"
|
|
25 |
#include "../TestInterface/TSU_MMF_DEVSOUND_TestInterface.h"
|
|
26 |
#include "../TestInterface1/TSU_MMF_DEVSOUND_TestInterface1.h"
|
|
27 |
#include <mmf/plugin/mmfdevsoundcustominterface.hrh>
|
|
28 |
|
|
29 |
const TInt KMaxVolume = 0xFFFF;
|
|
30 |
const TInt KMaxGain = 0xFFFF;
|
|
31 |
|
|
32 |
class CTestSuite;
|
|
33 |
class CTestSuiteDevSound;
|
|
34 |
|
|
35 |
/**
|
|
36 |
*
|
|
37 |
* CActiveListener provides the asynchronous operation
|
|
38 |
* of an active object
|
|
39 |
*
|
|
40 |
* @lib "TSU_MMF_DEVSOUND_SUITE.lib"
|
|
41 |
*
|
|
42 |
*
|
|
43 |
*/
|
|
44 |
class CActiveListener : public CActive
|
|
45 |
{
|
|
46 |
public:
|
|
47 |
CActiveListener() : CActive(CActive::EPriorityStandard)
|
|
48 |
{
|
|
49 |
CActiveScheduler::Add(this);
|
|
50 |
}
|
|
51 |
void InitialiseActiveListener()
|
|
52 |
{
|
|
53 |
iStatus = KRequestPending; SetActive();
|
|
54 |
}
|
|
55 |
~CActiveListener()
|
|
56 |
{
|
|
57 |
Cancel();
|
|
58 |
}
|
|
59 |
// From CActive
|
|
60 |
virtual void RunL()
|
|
61 |
{
|
|
62 |
CActiveScheduler::Stop();
|
|
63 |
}
|
|
64 |
virtual void DoCancel()
|
|
65 |
{
|
|
66 |
CActiveScheduler::Stop();
|
|
67 |
};
|
|
68 |
};
|
|
69 |
|
|
70 |
/**
|
|
71 |
*
|
|
72 |
* CTestStepDevSound - Test class that enables DevSound tests.
|
|
73 |
* It's a base class for all test steps.
|
|
74 |
*
|
|
75 |
* @lib "TSU_MMF_DEVSOUND_SUITE.lib"
|
|
76 |
*
|
|
77 |
*
|
|
78 |
*/
|
|
79 |
class CTestStepDevSound : public CTestStep, public MDevSoundObserver
|
|
80 |
{
|
|
81 |
public:
|
|
82 |
CTestStepDevSound();
|
|
83 |
~CTestStepDevSound();
|
|
84 |
static void CleanUp(TAny *aPtr);
|
|
85 |
void SetTestSuite(const CTestSuiteDevSound* aTestSuite);
|
|
86 |
|
|
87 |
protected:
|
|
88 |
virtual TVerdict DoTestStepPreambleL();
|
|
89 |
virtual TVerdict DoTestStepPostambleL();
|
|
90 |
|
|
91 |
// Callback methods from MDevSoundObserver mixin
|
|
92 |
void InitializeComplete (TInt aError);
|
|
93 |
void ToneFinished (TInt aError);
|
|
94 |
void BufferToBeFilled (CMMFBuffer* aBuffer);
|
|
95 |
void PlayError (TInt aError);
|
|
96 |
void BufferToBeEmptied (CMMFBuffer* aBuffer);
|
|
97 |
void RecordError (TInt aError);
|
|
98 |
void ConvertError (TInt aError);
|
|
99 |
void DeviceMessage (TUid aMessageType, const TDesC8& aMsg);
|
|
100 |
|
|
101 |
// Test methods (called by test cases)
|
|
102 |
TVerdict TestInitialize(TMMFState aMode);
|
|
103 |
TVerdict TestInitialize(TFourCC& aDataType, TMMFState aMode);
|
|
104 |
TVerdict TestInitialize(TUid aHwDeviceUid, TMMFState aMode);
|
|
105 |
TVerdict TestCaps();
|
|
106 |
TVerdict TestPlayTone(TInt aFreq, TTimeIntervalMicroSeconds aDur);
|
|
107 |
TVerdict TestPlayDTMFString(TPtrC aDTMFString);
|
|
108 |
void TestSetVolume(TInt aVol);
|
|
109 |
void TestSetGain(TInt aGain);
|
|
110 |
TVerdict TestSetVolRamp(TInt aVol, TInt aDur);
|
|
111 |
TInt TestMaxVolume();
|
|
112 |
TInt TestMaxGain();
|
|
113 |
TInt TestVolume();
|
|
114 |
TInt TestGain();
|
|
115 |
TVerdict TestPlayInit();
|
|
116 |
TVerdict TestPlayData();
|
|
117 |
TVerdict TestRecordInit();
|
|
118 |
TVerdict TestRecordInitCapsNotMatch();
|
|
119 |
TVerdict TestRecordData();
|
|
120 |
TVerdict TestRecordDataCapsNotMatch();
|
|
121 |
|
|
122 |
|
|
123 |
// Utility Methods
|
|
124 |
void ResetCallbacks();
|
|
125 |
TInt GetCallbackTotal();
|
|
126 |
TVerdict TestDigitalPlayback(TInt aNumSamples, TDesC& aFilename);
|
|
127 |
TVerdict TestDigitalRecord(TInt aNumSamples, TDesC& aFilename);
|
|
128 |
TVerdict TestDigitalPlayback(TInt aNumSamples, TDesC& aFilename, TFourCC& aDataType);
|
|
129 |
TVerdict TestDigitalRecord(TInt aNumSamples, TDesC& aFilename, TFourCC& aDataType);
|
|
130 |
|
|
131 |
protected:
|
|
132 |
|
|
133 |
typedef enum TCallback
|
|
134 |
{
|
|
135 |
EInitComplete,
|
|
136 |
EToneFinished,
|
|
137 |
EBuffToFill,
|
|
138 |
EPlayError,
|
|
139 |
EBuffToEmpty,
|
|
140 |
ERecError,
|
|
141 |
EConvertMsg,
|
|
142 |
EDeviceMsg
|
|
143 |
};
|
|
144 |
|
|
145 |
TFixedArray<TInt, 7> iCallbackArray;
|
|
146 |
|
|
147 |
// pointer to suite which owns this test
|
|
148 |
const CTestSuiteDevSound* iDevSoundTestSuite;
|
|
149 |
|
|
150 |
CActiveScheduler* iAS;
|
|
151 |
CActiveListener* iAL;
|
|
152 |
CMMFDevSound* iMMFDevSound;
|
|
153 |
TInt iExpectedValue;
|
|
154 |
TInt iCallbackError;
|
|
155 |
CMMFBuffer* iBuffer;
|
|
156 |
};
|
|
157 |
|
|
158 |
// DevSound events
|
|
159 |
enum TMmfDevSoundEvents
|
|
160 |
{
|
|
161 |
EDevSoundInit = 0,
|
|
162 |
EDevSoundPlayInit,
|
|
163 |
EDevSoundPlayData,
|
|
164 |
EDevSoundEmptyBuffer
|
|
165 |
};
|
|
166 |
enum TCallback
|
|
167 |
{
|
|
168 |
EInitComplete = 0,
|
|
169 |
EToneFinished,
|
|
170 |
EBuffToFill,
|
|
171 |
EPlayError,
|
|
172 |
EBuffToEmpty,
|
|
173 |
ERecError,
|
|
174 |
EConvertMsg,
|
|
175 |
EDeviceMsg
|
|
176 |
};
|
|
177 |
/**
|
|
178 |
*
|
|
179 |
* CTestStepDevSoundCustomInterface.
|
|
180 |
*
|
|
181 |
*
|
|
182 |
* @lib "TSU_MMF_DEVSOUND_SUITE.lib"
|
|
183 |
*
|
|
184 |
*
|
|
185 |
*/
|
|
186 |
class CTestStepDevSoundCustomInterface : public CTestStep, public MDevSoundObserver
|
|
187 |
{
|
|
188 |
public:
|
|
189 |
CTestStepDevSoundCustomInterface();
|
|
190 |
~CTestStepDevSoundCustomInterface();
|
|
191 |
void SetTestSuite(const CTestSuiteDevSound* aTestSuite);
|
|
192 |
|
|
193 |
protected:
|
|
194 |
virtual TVerdict DoTestStepPreambleL();
|
|
195 |
virtual TVerdict DoTestStepPostambleL();
|
|
196 |
virtual TVerdict RunTest();
|
|
197 |
// Executes events of DevSound
|
|
198 |
void FsmL(TMmfDevSoundEvents aDevSoundEvent);
|
|
199 |
// Callback methods from MDevSoundObserver mixin
|
|
200 |
void InitializeComplete(TInt aError);
|
|
201 |
void ToneFinished(TInt aError);
|
|
202 |
void BufferToBeFilled(CMMFBuffer* aBuffer);
|
|
203 |
void PlayError(TInt aError);
|
|
204 |
void BufferToBeEmptied(CMMFBuffer* aBuffer);
|
|
205 |
void RecordError(TInt aError);
|
|
206 |
void ConvertError(TInt aError);
|
|
207 |
void DeviceMessage(TUid aMessageType, const TDesC8& aMsg);
|
|
208 |
|
|
209 |
// Utility Methods
|
|
210 |
void ResetCallbacks();
|
|
211 |
TInt GetCallbackTotal();
|
|
212 |
|
|
213 |
protected:
|
|
214 |
|
|
215 |
TFixedArray<TInt, 7> iCallbackArray;
|
|
216 |
|
|
217 |
// pointer to suite which owns this test
|
|
218 |
const CTestSuiteDevSound* iDevSoundTestSuite;
|
|
219 |
|
|
220 |
CActiveScheduler* iAS;
|
|
221 |
CMMFDevSound* iMMFDevSound;
|
|
222 |
TInt iExpectedValue;
|
|
223 |
TInt iCallbackError;
|
|
224 |
CMMFBuffer* iBuffer;
|
|
225 |
RFile iFile;
|
|
226 |
RFs iFs;
|
|
227 |
//The sequence of methods called in this test - 1.Initilaize DevSound
|
|
228 |
// 2.PlayInitL, 3.Play 4.EmptyBuffers .Continue sequence 3 to 4
|
|
229 |
//This variable is used to count number of buffers in the sequence of call from 3 to 4
|
|
230 |
TInt iBufferCount;
|
|
231 |
//To know the last buffer
|
|
232 |
TBool iLastBuffer;
|
|
233 |
};
|
|
234 |
|
|
235 |
//------------------------------------------------------------------
|
|
236 |
|
|
237 |
class CTestStepDevSoundInitializePlay : public CTestStepDevSound
|
|
238 |
{
|
|
239 |
public:
|
|
240 |
CTestStepDevSoundInitializePlay();
|
|
241 |
TVerdict DoTestStepL();
|
|
242 |
};
|
|
243 |
|
|
244 |
//------------------------------------------------------------------
|
|
245 |
|
|
246 |
class CTestStepDevSoundInitializeHwDeviceUidPlay : public CTestStepDevSound
|
|
247 |
{
|
|
248 |
public:
|
|
249 |
CTestStepDevSoundInitializeHwDeviceUidPlay();
|
|
250 |
TVerdict DoTestStepL();
|
|
251 |
};
|
|
252 |
|
|
253 |
//------------------------------------------------------------------
|
|
254 |
|
|
255 |
class CTestStepDevSoundInitializeFourCCPlay : public CTestStepDevSound
|
|
256 |
{
|
|
257 |
public:
|
|
258 |
CTestStepDevSoundInitializeFourCCPlay();
|
|
259 |
TVerdict DoTestStepL();
|
|
260 |
};
|
|
261 |
|
|
262 |
//------------------------------------------------------------------
|
|
263 |
|
|
264 |
class CTestStepDevSoundInitializeRecord : public CTestStepDevSound
|
|
265 |
{
|
|
266 |
public:
|
|
267 |
CTestStepDevSoundInitializeRecord();
|
|
268 |
TVerdict DoTestStepL();
|
|
269 |
};
|
|
270 |
|
|
271 |
//------------------------------------------------------------------
|
|
272 |
|
|
273 |
class CTestStepDevSoundInitializeHwDeviceUidRecord : public CTestStepDevSound
|
|
274 |
{
|
|
275 |
public:
|
|
276 |
CTestStepDevSoundInitializeHwDeviceUidRecord();
|
|
277 |
TVerdict DoTestStepL();
|
|
278 |
};
|
|
279 |
|
|
280 |
//------------------------------------------------------------------
|
|
281 |
|
|
282 |
class CTestStepDevSoundInitializeFourCCRecord : public CTestStepDevSound
|
|
283 |
{
|
|
284 |
public:
|
|
285 |
CTestStepDevSoundInitializeFourCCRecord();
|
|
286 |
TVerdict DoTestStepL();
|
|
287 |
};
|
|
288 |
|
|
289 |
//------------------------------------------------------------------
|
|
290 |
|
|
291 |
class CTestStepDevSoundInitializeInvalidFourCC : public CTestStepDevSound
|
|
292 |
{
|
|
293 |
public:
|
|
294 |
CTestStepDevSoundInitializeInvalidFourCC();
|
|
295 |
TVerdict DoTestStepL();
|
|
296 |
};
|
|
297 |
|
|
298 |
//------------------------------------------------------------------
|
|
299 |
|
|
300 |
class CTestStepDevSoundCheckCaps : public CTestStepDevSound
|
|
301 |
{
|
|
302 |
public:
|
|
303 |
CTestStepDevSoundCheckCaps();
|
|
304 |
TVerdict DoTestStepL();
|
|
305 |
};
|
|
306 |
|
|
307 |
//------------------------------------------------------------------
|
|
308 |
|
|
309 |
class CTestStepDevSoundSimpleTone : public CTestStepDevSound
|
|
310 |
{
|
|
311 |
public:
|
|
312 |
CTestStepDevSoundSimpleTone();
|
|
313 |
TVerdict DoTestStepL();
|
|
314 |
};
|
|
315 |
|
|
316 |
//------------------------------------------------------------------
|
|
317 |
|
|
318 |
class CTestStepDevSoundDTMFTones : public CTestStepDevSound
|
|
319 |
{
|
|
320 |
public:
|
|
321 |
CTestStepDevSoundDTMFTones();
|
|
322 |
TVerdict DoTestStepL();
|
|
323 |
};
|
|
324 |
|
|
325 |
//------------------------------------------------------------------
|
|
326 |
|
|
327 |
class CTestStepDevSoundSimpleToneChangeVolume : public CTestStepDevSound
|
|
328 |
{
|
|
329 |
public:
|
|
330 |
CTestStepDevSoundSimpleToneChangeVolume();
|
|
331 |
TVerdict DoTestStepL();
|
|
332 |
};
|
|
333 |
|
|
334 |
//------------------------------------------------------------------
|
|
335 |
|
|
336 |
class CTestStepDevSoundDTMFTonesInvalidStrings : public CTestStepDevSound
|
|
337 |
{
|
|
338 |
public:
|
|
339 |
CTestStepDevSoundDTMFTonesInvalidStrings();
|
|
340 |
TVerdict DoTestStepL();
|
|
341 |
};
|
|
342 |
|
|
343 |
//------------------------------------------------------------------
|
|
344 |
|
|
345 |
class CTestStepDevSoundSimpleToneInvalidFreq : public CTestStepDevSound
|
|
346 |
{
|
|
347 |
public:
|
|
348 |
CTestStepDevSoundSimpleToneInvalidFreq();
|
|
349 |
TVerdict DoTestStepL();
|
|
350 |
};
|
|
351 |
|
|
352 |
//------------------------------------------------------------------
|
|
353 |
|
|
354 |
class CTestStepDevSoundSimpleToneInvalidDuration : public CTestStepDevSound
|
|
355 |
{
|
|
356 |
public:
|
|
357 |
CTestStepDevSoundSimpleToneInvalidDuration();
|
|
358 |
TVerdict DoTestStepL();
|
|
359 |
};
|
|
360 |
|
|
361 |
//------------------------------------------------------------------
|
|
362 |
|
|
363 |
class CTestStepDevSoundPlayInit : public CTestStepDevSound
|
|
364 |
{
|
|
365 |
public:
|
|
366 |
CTestStepDevSoundPlayInit();
|
|
367 |
TVerdict DoTestStepL();
|
|
368 |
};
|
|
369 |
|
|
370 |
//------------------------------------------------------------------
|
|
371 |
|
|
372 |
class CTestStepDevSoundPlay1BufferPCM16 : public CTestStepDevSound
|
|
373 |
{
|
|
374 |
public:
|
|
375 |
CTestStepDevSoundPlay1BufferPCM16();
|
|
376 |
TVerdict DoTestStepL();
|
|
377 |
};
|
|
378 |
|
|
379 |
//------------------------------------------------------------------
|
|
380 |
|
|
381 |
class CTestStepDevSoundPlay5BuffersPCM16 : public CTestStepDevSound
|
|
382 |
{
|
|
383 |
public:
|
|
384 |
CTestStepDevSoundPlay5BuffersPCM16();
|
|
385 |
TVerdict DoTestStepL();
|
|
386 |
};
|
|
387 |
|
|
388 |
//------------------------------------------------------------------
|
|
389 |
|
|
390 |
class CTestStepDevSoundPlayEOFPCM16 : public CTestStepDevSound
|
|
391 |
{
|
|
392 |
public:
|
|
393 |
CTestStepDevSoundPlayEOFPCM16();
|
|
394 |
TVerdict DoTestStepL();
|
|
395 |
};
|
|
396 |
|
|
397 |
//------------------------------------------------------------------
|
|
398 |
|
|
399 |
class CTestStepDevSoundPlay1BufferPCM8 : public CTestStepDevSound
|
|
400 |
{
|
|
401 |
public:
|
|
402 |
CTestStepDevSoundPlay1BufferPCM8();
|
|
403 |
TVerdict DoTestStepL();
|
|
404 |
};
|
|
405 |
|
|
406 |
//------------------------------------------------------------------
|
|
407 |
|
|
408 |
class CTestStepDevSoundPlay5BuffersPCM8 : public CTestStepDevSound
|
|
409 |
{
|
|
410 |
public:
|
|
411 |
CTestStepDevSoundPlay5BuffersPCM8();
|
|
412 |
TVerdict DoTestStepL();
|
|
413 |
};
|
|
414 |
|
|
415 |
//------------------------------------------------------------------
|
|
416 |
|
|
417 |
class CTestStepDevSoundPlayEOFPCM8 : public CTestStepDevSound
|
|
418 |
{
|
|
419 |
public:
|
|
420 |
CTestStepDevSoundPlayEOFPCM8();
|
|
421 |
TVerdict DoTestStepL();
|
|
422 |
};
|
|
423 |
|
|
424 |
//------------------------------------------------------------------
|
|
425 |
|
|
426 |
class CTestStepDevSoundPlayGarbageEOF : public CTestStepDevSound
|
|
427 |
{
|
|
428 |
public:
|
|
429 |
CTestStepDevSoundPlayGarbageEOF();
|
|
430 |
TVerdict DoTestStepL();
|
|
431 |
};
|
|
432 |
|
|
433 |
//------------------------------------------------------------------
|
|
434 |
|
|
435 |
class CTestStepDevSoundMaxGain : public CTestStepDevSound
|
|
436 |
{
|
|
437 |
public:
|
|
438 |
CTestStepDevSoundMaxGain();
|
|
439 |
TVerdict DoTestStepL();
|
|
440 |
};
|
|
441 |
|
|
442 |
//------------------------------------------------------------------
|
|
443 |
|
|
444 |
class CTestStepDevSoundMaxVolume : public CTestStepDevSound
|
|
445 |
{
|
|
446 |
public:
|
|
447 |
CTestStepDevSoundMaxVolume();
|
|
448 |
TVerdict DoTestStepL();
|
|
449 |
};
|
|
450 |
|
|
451 |
//------------------------------------------------------------------
|
|
452 |
|
|
453 |
class CTestStepDevSoundSetGain : public CTestStepDevSound
|
|
454 |
{
|
|
455 |
public:
|
|
456 |
CTestStepDevSoundSetGain();
|
|
457 |
TVerdict DoTestStepL();
|
|
458 |
};
|
|
459 |
|
|
460 |
//------------------------------------------------------------------
|
|
461 |
|
|
462 |
class CTestStepDevSoundSetVolume : public CTestStepDevSound
|
|
463 |
{
|
|
464 |
public:
|
|
465 |
CTestStepDevSoundSetVolume();
|
|
466 |
TVerdict DoTestStepL();
|
|
467 |
};
|
|
468 |
|
|
469 |
//------------------------------------------------------------------
|
|
470 |
|
|
471 |
class CTestStepDevSoundRecord1BufferPCM16 : public CTestStepDevSound
|
|
472 |
{
|
|
473 |
public:
|
|
474 |
CTestStepDevSoundRecord1BufferPCM16();
|
|
475 |
TVerdict DoTestStepL();
|
|
476 |
};
|
|
477 |
|
|
478 |
//------------------------------------------------------------------
|
|
479 |
class CTestStepDevSoundRecord10BuffersPCM16 : public CTestStepDevSound
|
|
480 |
{
|
|
481 |
public:
|
|
482 |
CTestStepDevSoundRecord10BuffersPCM16();
|
|
483 |
TVerdict DoTestStepL();
|
|
484 |
};
|
|
485 |
|
|
486 |
//------------------------------------------------------------------
|
|
487 |
|
|
488 |
class CTestStepDevSoundRecord1BufferPCM8 : public CTestStepDevSound
|
|
489 |
{
|
|
490 |
public:
|
|
491 |
CTestStepDevSoundRecord1BufferPCM8();
|
|
492 |
TVerdict DoTestStepL();
|
|
493 |
};
|
|
494 |
|
|
495 |
//------------------------------------------------------------------
|
|
496 |
|
|
497 |
class CTestStepDevSoundRecord10BuffersPCM8 : public CTestStepDevSound
|
|
498 |
{
|
|
499 |
public:
|
|
500 |
CTestStepDevSoundRecord10BuffersPCM8();
|
|
501 |
TVerdict DoTestStepL();
|
|
502 |
};
|
|
503 |
|
|
504 |
//------------------------------------------------------------------
|
|
505 |
|
|
506 |
class CTestStepDevSoundRecordInitNoUECap : public CTestStepDevSound
|
|
507 |
{
|
|
508 |
public:
|
|
509 |
CTestStepDevSoundRecordInitNoUECap(TBool aHasMMDDCap);
|
|
510 |
TVerdict DoTestStepL();
|
|
511 |
};
|
|
512 |
|
|
513 |
//------------------------------------------------------------------
|
|
514 |
|
|
515 |
class CTestStepDevSoundRecordInitWithUECap : public CTestStepDevSound
|
|
516 |
{
|
|
517 |
public:
|
|
518 |
CTestStepDevSoundRecordInitWithUECap(TBool aHasAllCaps);
|
|
519 |
TVerdict DoTestStepL();
|
|
520 |
};
|
|
521 |
|
|
522 |
//------------------------------------------------------------------
|
|
523 |
|
|
524 |
class CTestStepDevSoundRecordDataWithUECap : public CTestStepDevSound
|
|
525 |
{
|
|
526 |
public:
|
|
527 |
CTestStepDevSoundRecordDataWithUECap(TBool aHasAllCaps);
|
|
528 |
TVerdict DoTestStepL();
|
|
529 |
};
|
|
530 |
|
|
531 |
//------------------------------------------------------------------
|
|
532 |
|
|
533 |
class CTestStepDevSoundSetConfigStereo : public CTestStepDevSound
|
|
534 |
{
|
|
535 |
public:
|
|
536 |
CTestStepDevSoundSetConfigStereo();
|
|
537 |
TVerdict DoTestStepL();
|
|
538 |
};
|
|
539 |
|
|
540 |
//------------------------------------------------------------------
|
|
541 |
|
|
542 |
class CTestStepDevSoundSetConfigSampleRate : public CTestStepDevSound
|
|
543 |
{
|
|
544 |
public:
|
|
545 |
CTestStepDevSoundSetConfigSampleRate();
|
|
546 |
TVerdict DoTestStepL();
|
|
547 |
};
|
|
548 |
|
|
549 |
//------------------------------------------------------------------
|
|
550 |
|
|
551 |
class CTestStepDevSoundGetSupportedInputDataTypes : public CTestStepDevSound
|
|
552 |
{
|
|
553 |
public:
|
|
554 |
CTestStepDevSoundGetSupportedInputDataTypes();
|
|
555 |
TVerdict DoTestStepL();
|
|
556 |
};
|
|
557 |
|
|
558 |
//------------------------------------------------------------------
|
|
559 |
|
|
560 |
class CTestStepDevSoundGetSupportedOutputDataTypes : public CTestStepDevSound
|
|
561 |
{
|
|
562 |
public:
|
|
563 |
CTestStepDevSoundGetSupportedOutputDataTypes();
|
|
564 |
TVerdict DoTestStepL();
|
|
565 |
};
|
|
566 |
|
|
567 |
//------------------------------------------------------------------
|
|
568 |
|
|
569 |
class CTestStepDevSoundGetSupportedInputDataTypesOOM : public CTestStepDevSound
|
|
570 |
{
|
|
571 |
public:
|
|
572 |
CTestStepDevSoundGetSupportedInputDataTypesOOM();
|
|
573 |
TVerdict DoTestStepL();
|
|
574 |
};
|
|
575 |
|
|
576 |
//------------------------------------------------------------------
|
|
577 |
|
|
578 |
class CTestStepDevSoundGetSupportedOutputDataTypesOOM : public CTestStepDevSound
|
|
579 |
{
|
|
580 |
public:
|
|
581 |
CTestStepDevSoundGetSupportedOutputDataTypesOOM();
|
|
582 |
TVerdict DoTestStepL();
|
|
583 |
};
|
|
584 |
|
|
585 |
//------------------------------------------------------------------
|
|
586 |
|
|
587 |
class CTestStepDevSoundPlayPauseTone : public RAsyncTestStep, public MDevSoundObserver
|
|
588 |
{
|
|
589 |
public:
|
|
590 |
static CTestStepDevSoundPlayPauseTone* NewL(CTestSuite* aSuite);
|
|
591 |
|
|
592 |
void Fsm();
|
|
593 |
void FsmL();
|
|
594 |
|
|
595 |
// from RAsyncTestStep
|
|
596 |
void KickoffTestL();
|
|
597 |
void CloseTest();
|
|
598 |
|
|
599 |
// from MDevSoundObserver
|
|
600 |
void InitializeComplete(TInt aError);
|
|
601 |
void ToneFinished(TInt aError);
|
|
602 |
void BufferToBeFilled(CMMFBuffer* aBuffer);
|
|
603 |
void PlayError(TInt aError);
|
|
604 |
void BufferToBeEmptied(CMMFBuffer* aBuffer);
|
|
605 |
void RecordError(TInt aError);
|
|
606 |
void ConvertError(TInt aError);
|
|
607 |
void DeviceMessage(TUid aMessageType, const TDesC8& aMsg);
|
|
608 |
|
|
609 |
private:
|
|
610 |
CTestStepDevSoundPlayPauseTone(CTestSuite* aSuite);
|
|
611 |
void TestPlayToneL();
|
|
612 |
private:
|
|
613 |
CMMFDevSound* iMMFAudioDevSound;
|
|
614 |
CMMFDevSound* iMMFToneDevSound;
|
|
615 |
RFs iFs;
|
|
616 |
RFile iInputFile;
|
|
617 |
enum TTestState
|
|
618 |
{
|
|
619 |
EStateInitialiseAudioDevSound,
|
|
620 |
EStateInitialiseToneDevSound,
|
|
621 |
EStatePlayInit,
|
|
622 |
EStatePlayData,
|
|
623 |
EStatePlayTone
|
|
624 |
};
|
|
625 |
TTestState iTestState;
|
|
626 |
CMMFBuffer* iBuffer;
|
|
627 |
TInt iBufferCount;
|
|
628 |
TBool iTonePlayKickedOff;
|
|
629 |
};
|
|
630 |
|
|
631 |
//------------------------------------------------------------------
|
|
632 |
|
|
633 |
class CTestStepDevSoundPlayPauseTone2 : public RAsyncTestStep, public MDevSoundObserver
|
|
634 |
{
|
|
635 |
public:
|
|
636 |
static CTestStepDevSoundPlayPauseTone2* NewL(CTestSuite* aSuite);
|
|
637 |
|
|
638 |
void Fsm();
|
|
639 |
void FsmL();
|
|
640 |
|
|
641 |
// from RAsyncTestStep
|
|
642 |
void KickoffTestL();
|
|
643 |
void CloseTest();
|
|
644 |
|
|
645 |
// from MDevSoundObserver
|
|
646 |
void InitializeComplete(TInt aError);
|
|
647 |
void ToneFinished(TInt aError);
|
|
648 |
void BufferToBeFilled(CMMFBuffer* aBuffer);
|
|
649 |
void PlayError(TInt aError);
|
|
650 |
void BufferToBeEmptied(CMMFBuffer* aBuffer);
|
|
651 |
void RecordError(TInt aError);
|
|
652 |
void ConvertError(TInt aError);
|
|
653 |
void DeviceMessage(TUid aMessageType, const TDesC8& aMsg);
|
|
654 |
|
|
655 |
private:
|
|
656 |
CTestStepDevSoundPlayPauseTone2(CTestSuite* aSuite);
|
|
657 |
void TestPlayToneL();
|
|
658 |
private:
|
|
659 |
CMMFDevSound* iMMFAudioDevSound;
|
|
660 |
CMMFDevSound* iMMFToneDevSound;
|
|
661 |
RFs iFs;
|
|
662 |
RFile iInputFile;
|
|
663 |
enum TTestState
|
|
664 |
{
|
|
665 |
EStateInitialiseAudioDevSound,
|
|
666 |
EStateInitialiseToneDevSound,
|
|
667 |
EStatePlayInit,
|
|
668 |
EStatePlayData,
|
|
669 |
EStatePlayTone
|
|
670 |
};
|
|
671 |
TTestState iTestState;
|
|
672 |
CMMFBuffer* iBuffer;
|
|
673 |
TInt iBufferCount;
|
|
674 |
TBool iTonePlayKickedOff;
|
|
675 |
};
|
|
676 |
|
|
677 |
//------------------------------------------------------------------
|
|
678 |
|
|
679 |
class CTestStepDevSoundPlayPauseTone3 : public RAsyncTestStep, public MDevSoundObserver
|
|
680 |
{
|
|
681 |
public:
|
|
682 |
static CTestStepDevSoundPlayPauseTone3* NewL(CTestSuite* aSuite);
|
|
683 |
|
|
684 |
void Fsm();
|
|
685 |
void FsmL();
|
|
686 |
|
|
687 |
// from RAsyncTestStep
|
|
688 |
void KickoffTestL();
|
|
689 |
void CloseTest();
|
|
690 |
|
|
691 |
// from MDevSoundObserver
|
|
692 |
void InitializeComplete(TInt aError);
|
|
693 |
void ToneFinished(TInt aError);
|
|
694 |
void BufferToBeFilled(CMMFBuffer* aBuffer);
|
|
695 |
void PlayError(TInt aError);
|
|
696 |
void BufferToBeEmptied(CMMFBuffer* aBuffer);
|
|
697 |
void RecordError(TInt aError);
|
|
698 |
void ConvertError(TInt aError);
|
|
699 |
void DeviceMessage(TUid aMessageType, const TDesC8& aMsg);
|
|
700 |
|
|
701 |
private:
|
|
702 |
CTestStepDevSoundPlayPauseTone3(CTestSuite* aSuite);
|
|
703 |
void TestPlayToneL(TBool aLowPriority = ETrue);
|
|
704 |
private:
|
|
705 |
CMMFDevSound* iMMFAudioDevSound;
|
|
706 |
CMMFDevSound* iMMFLowPriorityToneDevSound;
|
|
707 |
CMMFDevSound* iMMFHighPriorityToneDevSound;
|
|
708 |
RFs iFs;
|
|
709 |
RFile iInputFile;
|
|
710 |
enum TTestState
|
|
711 |
{
|
|
712 |
EStateInitialiseAudioDevSound,
|
|
713 |
EStateInitialiseLowPriorityToneDevSound,
|
|
714 |
EStateInitialiseHighPriorityToneDevSound,
|
|
715 |
EStatePlayInit,
|
|
716 |
EStatePlayData,
|
|
717 |
EStatePlayTone
|
|
718 |
};
|
|
719 |
TTestState iTestState;
|
|
720 |
CMMFBuffer* iBuffer;
|
|
721 |
TInt iBufferCount;
|
|
722 |
TBool iLowPriorityTonePlayKickedOff;
|
|
723 |
TBool iHighPriorityTonePlayKickedOff;
|
|
724 |
};
|
|
725 |
|
|
726 |
//------------------------------------------------------------------
|
|
727 |
|
|
728 |
class RTestStepDevSoundToneTone : public RAsyncTestStep, public MDevSoundObserver
|
|
729 |
{
|
|
730 |
public:
|
|
731 |
static RTestStepDevSoundToneTone* NewL(CTestSuite* aSuite);
|
|
732 |
static TInt TimerCallBack(TAny* aPtr);
|
|
733 |
|
|
734 |
void Fsm();
|
|
735 |
void FsmL();
|
|
736 |
|
|
737 |
// from RAsyncTestStep
|
|
738 |
void KickoffTestL();
|
|
739 |
void CloseTest();
|
|
740 |
|
|
741 |
// from MDevSoundObserver
|
|
742 |
void InitializeComplete(TInt aError);
|
|
743 |
void ToneFinished(TInt aError);
|
|
744 |
void BufferToBeFilled(CMMFBuffer* aBuffer);
|
|
745 |
void PlayError(TInt aError);
|
|
746 |
void BufferToBeEmptied(CMMFBuffer* aBuffer);
|
|
747 |
void RecordError(TInt aError);
|
|
748 |
void ConvertError(TInt aError);
|
|
749 |
void DeviceMessage(TUid aMessageType, const TDesC8& aMsg);
|
|
750 |
|
|
751 |
private:
|
|
752 |
RTestStepDevSoundToneTone(CTestSuite* aSuite);
|
|
753 |
void TestPlayToneL(TBool aLowPriority = ETrue);
|
|
754 |
private:
|
|
755 |
CMMFDevSound* iMMFLowPriorityToneDevSound;
|
|
756 |
CMMFDevSound* iMMFHighPriorityToneDevSound;
|
|
757 |
enum TTestState
|
|
758 |
{
|
|
759 |
EStateInitialiseLowPriorityToneDevSound,
|
|
760 |
EStateInitialiseHighPriorityToneDevSound,
|
|
761 |
EStatePlayingHighPriorityTone,
|
|
762 |
EStatePlayingLowPriorityTone
|
|
763 |
};
|
|
764 |
TTestState iTestState;
|
|
765 |
CPeriodic* iTimer;
|
|
766 |
};
|
|
767 |
|
|
768 |
//------------------------------------------------------------------
|
|
769 |
|
|
770 |
class RTestStepDevSoundRecordRecord : public RAsyncTestStep, public MDevSoundObserver
|
|
771 |
{
|
|
772 |
public:
|
|
773 |
static RTestStepDevSoundRecordRecord* NewL(CTestSuite* aSuite);
|
|
774 |
static TInt TimerCallBack(TAny* aPtr);
|
|
775 |
|
|
776 |
void Fsm();
|
|
777 |
void FsmL();
|
|
778 |
|
|
779 |
// from RAsyncTestStep
|
|
780 |
void KickoffTestL();
|
|
781 |
void CloseTest();
|
|
782 |
|
|
783 |
// from MDevSoundObserver
|
|
784 |
void InitializeComplete(TInt aError);
|
|
785 |
void ToneFinished(TInt aError);
|
|
786 |
void BufferToBeFilled(CMMFBuffer* aBuffer);
|
|
787 |
void PlayError(TInt aError);
|
|
788 |
void BufferToBeEmptied(CMMFBuffer* aBuffer);
|
|
789 |
void RecordError(TInt aError);
|
|
790 |
void ConvertError(TInt aError);
|
|
791 |
void DeviceMessage(TUid aMessageType, const TDesC8& aMsg);
|
|
792 |
|
|
793 |
private:
|
|
794 |
RTestStepDevSoundRecordRecord(CTestSuite* aSuite);
|
|
795 |
//void TestPlayToneL(TBool aLowPriority = ETrue);
|
|
796 |
private:
|
|
797 |
CMMFDevSound* iMMFLowPriorityRecordDevSound;
|
|
798 |
CMMFDevSound* iMMFHighPriorityRecordDevSound;
|
|
799 |
enum TTestState
|
|
800 |
{
|
|
801 |
EStateInitialiseLowPriorityRecordDevSound,
|
|
802 |
EStateInitialiseHighPriorityRecordDevSound,
|
|
803 |
EStateRecordingHighPriorityAudio,
|
|
804 |
EStateRecordingLowPriorityAudio
|
|
805 |
};
|
|
806 |
TTestState iTestState;
|
|
807 |
CPeriodic* iTimer;
|
|
808 |
};
|
|
809 |
|
|
810 |
//------------------------------------------------------------------
|
|
811 |
|
|
812 |
class RTestStepDevSoundToneReplay : public RAsyncTestStep, public MDevSoundObserver
|
|
813 |
{
|
|
814 |
public:
|
|
815 |
static RTestStepDevSoundToneReplay* NewL(CTestSuite* aSuite);
|
|
816 |
static TInt TimerCallBack(TAny* aPtr);
|
|
817 |
|
|
818 |
void Fsm();
|
|
819 |
void FsmL();
|
|
820 |
|
|
821 |
// from RAsyncTestStep
|
|
822 |
void KickoffTestL();
|
|
823 |
void CloseTest();
|
|
824 |
|
|
825 |
// from MDevSoundObserver
|
|
826 |
void InitializeComplete(TInt aError);
|
|
827 |
void ToneFinished(TInt aError);
|
|
828 |
void BufferToBeFilled(CMMFBuffer* aBuffer);
|
|
829 |
void PlayError(TInt aError);
|
|
830 |
void BufferToBeEmptied(CMMFBuffer* aBuffer);
|
|
831 |
void RecordError(TInt aError);
|
|
832 |
void ConvertError(TInt aError);
|
|
833 |
void DeviceMessage(TUid aMessageType, const TDesC8& aMsg);
|
|
834 |
|
|
835 |
private:
|
|
836 |
RTestStepDevSoundToneReplay(CTestSuite* aSuite);
|
|
837 |
void TestPlayToneL(TBool aLowPriority = ETrue);
|
|
838 |
|
|
839 |
private:
|
|
840 |
CMMFDevSound* iMMFLowPriorityToneDevSound;
|
|
841 |
CMMFDevSound* iMMFHighPriorityToneDevSound;
|
|
842 |
enum TTestState
|
|
843 |
{
|
|
844 |
EStateInitialiseLowPriorityToneDevSound,
|
|
845 |
EStateInitialiseHighPriorityToneDevSound,
|
|
846 |
EStatePlayingLowPriorityTone,
|
|
847 |
EStatePlayingHighPriorityTone,
|
|
848 |
EStateReplayingLowPriorityTone,
|
|
849 |
EStateWaitingAfterStop,
|
|
850 |
};
|
|
851 |
TTestState iTestState;
|
|
852 |
CPeriodic* iTimer;
|
|
853 |
};
|
|
854 |
|
|
855 |
//------------------------------------------------------------------
|
|
856 |
|
|
857 |
class RTestStepDevSoundRecordRerecord : public RAsyncTestStep, public MDevSoundObserver
|
|
858 |
{
|
|
859 |
public:
|
|
860 |
static RTestStepDevSoundRecordRerecord* NewL(CTestSuite* aSuite);
|
|
861 |
static TInt TimerCallBack(TAny* aPtr);
|
|
862 |
|
|
863 |
void Fsm();
|
|
864 |
void FsmL();
|
|
865 |
|
|
866 |
// from RAsyncTestStep
|
|
867 |
void KickoffTestL();
|
|
868 |
void CloseTest();
|
|
869 |
|
|
870 |
// from MDevSoundObserver
|
|
871 |
void InitializeComplete(TInt aError);
|
|
872 |
void ToneFinished(TInt aError);
|
|
873 |
void BufferToBeFilled(CMMFBuffer* aBuffer);
|
|
874 |
void PlayError(TInt aError);
|
|
875 |
void BufferToBeEmptied(CMMFBuffer* aBuffer);
|
|
876 |
void RecordError(TInt aError);
|
|
877 |
void ConvertError(TInt aError);
|
|
878 |
void DeviceMessage(TUid aMessageType, const TDesC8& aMsg);
|
|
879 |
|
|
880 |
private:
|
|
881 |
RTestStepDevSoundRecordRerecord(CTestSuite* aSuite);
|
|
882 |
void TestPlayToneL(TBool aLowPriority = ETrue);
|
|
883 |
|
|
884 |
private:
|
|
885 |
CMMFDevSound* iMMFLowPriorityRecordDevSound;
|
|
886 |
CMMFDevSound* iMMFHighPriorityToneDevSound;
|
|
887 |
enum TTestState
|
|
888 |
{
|
|
889 |
EStateInitialiseLowPriorityRecordDevSound,
|
|
890 |
EStateInitialiseHighPriorityToneDevSound,
|
|
891 |
EStateRecordingLowPriority,
|
|
892 |
EStatePlayingHighPriorityTone,
|
|
893 |
EStateRerecordingLowPriority,
|
|
894 |
EStateWaitingAfterStop,
|
|
895 |
};
|
|
896 |
TTestState iTestState;
|
|
897 |
CPeriodic* iTimer;
|
|
898 |
TInt iBuffersRecordedCount;
|
|
899 |
};
|
|
900 |
|
|
901 |
//------------------------------------------------------------------
|
|
902 |
|
|
903 |
class RTestStepDevSoundPlayReplay : public RAsyncTestStep, public MDevSoundObserver
|
|
904 |
{
|
|
905 |
public:
|
|
906 |
static RTestStepDevSoundPlayReplay* NewL(CTestSuite* aSuite);
|
|
907 |
static TInt TimerCallBack(TAny* aPtr);
|
|
908 |
|
|
909 |
void Fsm();
|
|
910 |
void FsmL();
|
|
911 |
|
|
912 |
// from RAsyncTestStep
|
|
913 |
void KickoffTestL();
|
|
914 |
void CloseTest();
|
|
915 |
|
|
916 |
// from MDevSoundObserver
|
|
917 |
void InitializeComplete(TInt aError);
|
|
918 |
void ToneFinished(TInt aError);
|
|
919 |
void BufferToBeFilled(CMMFBuffer* aBuffer);
|
|
920 |
void PlayError(TInt aError);
|
|
921 |
void BufferToBeEmptied(CMMFBuffer* aBuffer);
|
|
922 |
void RecordError(TInt aError);
|
|
923 |
void ConvertError(TInt aError);
|
|
924 |
void DeviceMessage(TUid aMessageType, const TDesC8& aMsg);
|
|
925 |
|
|
926 |
private:
|
|
927 |
RTestStepDevSoundPlayReplay(CTestSuite* aSuite);
|
|
928 |
void TestPlayToneL(TBool aLowPriority = ETrue);
|
|
929 |
|
|
930 |
private:
|
|
931 |
CMMFDevSound* iMMFLowPriorityPlayDevSound;
|
|
932 |
CMMFDevSound* iMMFHighPriorityToneDevSound;
|
|
933 |
enum TTestState
|
|
934 |
{
|
|
935 |
EStateInitialiseLowPriorityPlayDevSound,
|
|
936 |
EStateInitialiseHighPriorityToneDevSound,
|
|
937 |
EStatePlayingLowPriority,
|
|
938 |
EStatePlayingHighPriorityTone,
|
|
939 |
EStateReplayingLowPriority,
|
|
940 |
EStateWaitingAfterStop,
|
|
941 |
};
|
|
942 |
TTestState iTestState;
|
|
943 |
CPeriodic* iTimer;
|
|
944 |
RFile iInputFile;
|
|
945 |
RFs iFs;
|
|
946 |
TInt iBuffersPlayedCount;
|
|
947 |
};
|
|
948 |
|
|
949 |
//------------------------------------------------------------------
|
|
950 |
|
|
951 |
/**
|
|
952 |
*
|
|
953 |
*
|
|
954 |
* Check that the SampleRate supported for tone play is 8000Hz only. Fix for DEF054803
|
|
955 |
*
|
|
956 |
*/
|
|
957 |
class CTestStepDevSoundCheckSampleRateforTone : public CTestStepDevSound
|
|
958 |
{
|
|
959 |
public:
|
|
960 |
CTestStepDevSoundCheckSampleRateforTone();
|
|
961 |
TVerdict DoTestStepL();
|
|
962 |
};
|
|
963 |
|
|
964 |
//------------------------------------------------------------------
|
|
965 |
|
|
966 |
|
|
967 |
//------------------------------------------------------------------
|
|
968 |
|
|
969 |
class RTestStepBasicCustomInterface : public RTestStep
|
|
970 |
{
|
|
971 |
public:
|
|
972 |
static RTestStepBasicCustomInterface* NewL();
|
|
973 |
|
|
974 |
// from RTestStep
|
|
975 |
TVerdict DoTestStepL();
|
|
976 |
|
|
977 |
protected:
|
|
978 |
TVerdict TestCustomInterface(MMMFDevSoundTestCustomInterface* aInterface);
|
|
979 |
RTestStepBasicCustomInterface();
|
|
980 |
};
|
|
981 |
|
|
982 |
//------------------------------------------------------------------
|
|
983 |
|
|
984 |
class RTestStepBasicCustomInterfaceAlloc : public RTestStepBasicCustomInterface
|
|
985 |
{
|
|
986 |
public:
|
|
987 |
static RTestStepBasicCustomInterfaceAlloc* NewL();
|
|
988 |
|
|
989 |
// from RTestStep
|
|
990 |
TVerdict DoTestStepL();
|
|
991 |
|
|
992 |
protected:
|
|
993 |
RTestStepBasicCustomInterfaceAlloc();
|
|
994 |
};
|
|
995 |
|
|
996 |
|
|
997 |
class CTestStepDevSoundEmptyBuffersPos : public CTestStepDevSoundCustomInterface
|
|
998 |
{
|
|
999 |
public:
|
|
1000 |
CTestStepDevSoundEmptyBuffersPos();
|
|
1001 |
TVerdict DoTestStepL();
|
|
1002 |
};
|
|
1003 |
|
|
1004 |
class CTestStepDevSoundEmptyBuffersNeg1 : public CTestStepDevSoundCustomInterface
|
|
1005 |
{
|
|
1006 |
public:
|
|
1007 |
CTestStepDevSoundEmptyBuffersNeg1();
|
|
1008 |
TVerdict DoTestStepL();
|
|
1009 |
void FsmL(TMmfDevSoundEvents aDevSoundEvent);
|
|
1010 |
void InitializeComplete(TInt aError);
|
|
1011 |
};
|
|
1012 |
|
|
1013 |
class CTestStepDevSoundEmptyBuffersNeg2 : public CTestStepDevSoundCustomInterface
|
|
1014 |
{
|
|
1015 |
public:
|
|
1016 |
CTestStepDevSoundEmptyBuffersNeg2();
|
|
1017 |
TVerdict DoTestStepL();
|
|
1018 |
};
|
|
1019 |
|
|
1020 |
class CTestStepDevSoundCITest;
|
|
1021 |
class CFsmHelper : public CActive
|
|
1022 |
{
|
|
1023 |
public:
|
|
1024 |
static CFsmHelper* NewL();
|
|
1025 |
~CFsmHelper();
|
|
1026 |
void Start();
|
|
1027 |
TRequestStatus* GetStatus();
|
|
1028 |
TVerdict GetResult();
|
|
1029 |
void SetDevSoundPointer(CMMFDevSound* aMMFDevSound);
|
|
1030 |
void SetDevSoundTestPointer(CTestStepDevSoundCITest* aMMFDevSndTestPointer);
|
|
1031 |
private:
|
|
1032 |
CFsmHelper();
|
|
1033 |
void ConstructL();
|
|
1034 |
private://From CActive
|
|
1035 |
void RunL();
|
|
1036 |
void DoCancel();
|
|
1037 |
private:
|
|
1038 |
enum TEventStatus
|
|
1039 |
{
|
|
1040 |
EDevSoundInit1,
|
|
1041 |
EDevSoundInit2,
|
|
1042 |
EAddDelayClient2,
|
|
1043 |
EClient2Idle
|
|
1044 |
};
|
|
1045 |
private:
|
|
1046 |
TEventStatus iEventStatus;
|
|
1047 |
TVerdict iTestResult;
|
|
1048 |
TEventStatus iClientStatus;
|
|
1049 |
TRequestStatus iRequestStatus ;
|
|
1050 |
CLog* iLog;
|
|
1051 |
MMMFDevSoundCustomInterfaceBitRate* iTestInterface;
|
|
1052 |
CMMFDevSound* iMMFDevSound;
|
|
1053 |
CTestStepDevSoundCITest* iTestPointer;
|
|
1054 |
};
|
|
1055 |
|
|
1056 |
class CTestStepDevSoundCITest : public CTestStepDevSoundCustomInterface
|
|
1057 |
{
|
|
1058 |
public:
|
|
1059 |
CTestStepDevSoundCITest();
|
|
1060 |
TVerdict DoTestStepL();
|
|
1061 |
void InitializeComplete(TInt aError);
|
|
1062 |
CFsmHelper* iFsmHelper;
|
|
1063 |
virtual void Close();
|
|
1064 |
|
|
1065 |
private:
|
|
1066 |
MMMFDevSoundTestCustomInterface* iTestInterface;
|
|
1067 |
TInt iInitComplete;
|
|
1068 |
};
|
|
1069 |
|
|
1070 |
#ifdef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
|
|
1071 |
|
|
1072 |
class CTestStepDevSoundServerSideAlloc : public CTestStepDevSoundCustomInterface
|
|
1073 |
{
|
|
1074 |
public:
|
|
1075 |
CTestStepDevSoundServerSideAlloc();
|
|
1076 |
TVerdict DoTestStepL();
|
|
1077 |
void AllocLoopTestL();
|
|
1078 |
void InitializeComplete(TInt aError);
|
|
1079 |
TInt MethodToTest();
|
|
1080 |
};
|
|
1081 |
|
|
1082 |
#endif
|
|
1083 |
|
|
1084 |
//test case for PDEF117811 Ref DevSound policy updating on error condition is inconsistent
|
|
1085 |
class CTestDevSoundObserver;
|
|
1086 |
class RDevSoundPolicyUpdateTest : public RAsyncTestStep
|
|
1087 |
{
|
|
1088 |
public:
|
|
1089 |
enum TTestEvent
|
|
1090 |
{
|
|
1091 |
EDevSoundInitComplete,
|
|
1092 |
EBTBF,
|
|
1093 |
EBTBE,
|
|
1094 |
EPlayError,
|
|
1095 |
ETonePlayError,
|
|
1096 |
ERecordError
|
|
1097 |
};
|
|
1098 |
enum TClientId
|
|
1099 |
{
|
|
1100 |
EObserver1,
|
|
1101 |
EObserver2
|
|
1102 |
};
|
|
1103 |
enum TStage
|
|
1104 |
{
|
|
1105 |
EPlayData,
|
|
1106 |
EStartPlay,
|
|
1107 |
EStartRecord,
|
|
1108 |
ERecordData,
|
|
1109 |
EStartPlayTune,
|
|
1110 |
EStartDualPlayTone,
|
|
1111 |
EStartPlayDTMFString,
|
|
1112 |
EStartPlayToneSequence
|
|
1113 |
};
|
|
1114 |
enum TTestState
|
|
1115 |
{
|
|
1116 |
//different stages are used to cover various functions in CMMFDevSoundSvrImp, where
|
|
1117 |
//changes are done as part of fix. Refer in .cpp file for more details about the test.
|
|
1118 |
//stage1 - test CMMFDevSoundSvrImp::PlayData error
|
|
1119 |
E1_InitDevSound1, //initialise DevSound1
|
|
1120 |
E1_PlayInitDevSound1, //Play init DevSound1
|
|
1121 |
//PlayData on DevSound1; this should result in KErrAbort due to error in
|
|
1122 |
//CMMFSwCodecWrapper::ThisHwBufferFilled()
|
|
1123 |
E1_Simulate_hw_ThisHwBufferFilled_error,
|
|
1124 |
E1_InitDevSound2, //initialise DevSound2
|
|
1125 |
E1_PlayInitDevSound2, //playData on DevSound2
|
|
1126 |
|
|
1127 |
//stage2- test CMMFDevSoundSvrImp::StartPlayL error
|
|
1128 |
//stage2_1
|
|
1129 |
E2_1_InitDevSound1,
|
|
1130 |
E2_Simulate_hw_SetConfig_Error,
|
|
1131 |
E2_1_PlayInitDevSound2,
|
|
1132 |
//stage2_2
|
|
1133 |
E2_2_InitDevSound1,
|
|
1134 |
E2_Simulate_hw_Start_Error,
|
|
1135 |
E2_2_PlayInitDevSound2,
|
|
1136 |
|
|
1137 |
//stage3 - test CMMFDevSoundSvrImp::StartRecord error
|
|
1138 |
E3_1_InitDevSound1,
|
|
1139 |
E3_1_InitDevSound2,
|
|
1140 |
E3_Simulate_hw_SetConfig_Error,
|
|
1141 |
E3_1_PlayInitDevSound2,
|
|
1142 |
E3_2_InitDevSound1,
|
|
1143 |
E3_Simulate_hw_Start_Error,
|
|
1144 |
E3_2_PlayInitDevSound1,
|
|
1145 |
|
|
1146 |
//stage4 - test CMMFDevSoundSvrImp::RecordData error
|
|
1147 |
E4_InitDevSound1,
|
|
1148 |
E4_RecordInitDevSound1,
|
|
1149 |
E4_Simulate_hw_ThisHwBufferEmptied_error,
|
|
1150 |
E4_RecordInitDevSound2,
|
|
1151 |
|
|
1152 |
//stage5 - test CMMFDevSoundSvrImp::StartPlayTone; covers error from SetPlayFormat
|
|
1153 |
E5_InitDevSound1,
|
|
1154 |
E5_Simulate_hw_SetConfig_error, //from StartPlayToneL
|
|
1155 |
E5_InitDevSound2,
|
|
1156 |
E5_PlayInitDevSound2,
|
|
1157 |
|
|
1158 |
//stage6 - test CMMFDevSoundSvrImp::StartDualPlayTone
|
|
1159 |
E6_InitDevSound1,
|
|
1160 |
E6_Simulate_hw_SetConfig_error, //from StartDualPlayToneL
|
|
1161 |
E6_PlayInitDevSound2,
|
|
1162 |
|
|
1163 |
//stage7 - test CMMFDevSoundSvrImp::StartPlayDTMFString
|
|
1164 |
E7_Simulate_hw_SetConfig_error, //from StartPlayDTMFString
|
|
1165 |
E7_PlayInitDevSound2,
|
|
1166 |
|
|
1167 |
//stage8- test CMMFDevSoundSvrImp::StartPlayToneSequence
|
|
1168 |
E8_Simulate_hw_SetConfig_error,
|
|
1169 |
E8_PlayInitDevSound2
|
|
1170 |
};
|
|
1171 |
|
|
1172 |
static RDevSoundPolicyUpdateTest* NewL(const TDesC& aStepName);
|
|
1173 |
// from RAsyncTestStep
|
|
1174 |
void KickoffTestL();
|
|
1175 |
void CloseTest();
|
|
1176 |
|
|
1177 |
void Fsm(TClientId aClientId, TTestEvent aTestEvent, TInt aError);
|
|
1178 |
void FsmL(TClientId aClientId, TTestEvent aTestEvent, TInt aError);
|
|
1179 |
|
|
1180 |
//FSM s for different stages of testing. Each stage is to test a function in
|
|
1181 |
//Devsound server.
|
|
1182 |
void PlayData_FsmL(TClientId aClientId, TTestEvent aTestEvent, TInt aError);
|
|
1183 |
void StartPlay_FsmL(TClientId aClientId, TTestEvent aTestEvent, TInt aError);
|
|
1184 |
void StartRecord_FsmL(TClientId aClientId, TTestEvent aTestEvent, TInt aError);
|
|
1185 |
void RecordData_FsmL(TClientId aClientId, TTestEvent aTestEvent, TInt aError);
|
|
1186 |
void StartPlayTone_FsmL(TClientId aClientId, TTestEvent aTestEvent, TInt aError);
|
|
1187 |
void StartPlayDualTone_FsmL(TClientId aClientId, TTestEvent aTestEvent, TInt aError);
|
|
1188 |
void StartPlayDTMFString_FsmL(TClientId aClientId, TTestEvent aTestEvent, TInt aError);
|
|
1189 |
void StartPlayToneSequence_FsmL(TClientId aClientId, TTestEvent aTestEvent, TInt aError);
|
|
1190 |
private:
|
|
1191 |
RDevSoundPolicyUpdateTest(const TDesC& aStepName);
|
|
1192 |
CMMFDevSound* iMMFDevSound1;
|
|
1193 |
CMMFDevSound* iMMFDevSound2;
|
|
1194 |
CTestDevSoundObserver* iDevSoundObserver1;
|
|
1195 |
CTestDevSoundObserver* iDevSoundObserver2;
|
|
1196 |
TInt iTestState;
|
|
1197 |
TStage iStage;
|
|
1198 |
TUid iTestHwDevice1Uid;
|
|
1199 |
TUid iTestHwDevice2Uid;
|
|
1200 |
TUid iTestHwDevice3Uid;
|
|
1201 |
};
|
|
1202 |
|
|
1203 |
class CTestDevSoundObserver : public CBase, public MDevSoundObserver
|
|
1204 |
{
|
|
1205 |
public:
|
|
1206 |
static CTestDevSoundObserver* NewL(RDevSoundPolicyUpdateTest* aParent, RDevSoundPolicyUpdateTest::TClientId aClientId);
|
|
1207 |
// from MDevSoundObserver
|
|
1208 |
void InitializeComplete(TInt aError);
|
|
1209 |
void ToneFinished(TInt aError);
|
|
1210 |
void BufferToBeFilled(CMMFBuffer* aBuffer);
|
|
1211 |
void PlayError(TInt aError);
|
|
1212 |
void BufferToBeEmptied(CMMFBuffer* aBuffer);
|
|
1213 |
void RecordError(TInt aError);
|
|
1214 |
void ConvertError(TInt aError);
|
|
1215 |
void DeviceMessage(TUid aMessageType, const TDesC8& aMsg);
|
|
1216 |
private:
|
|
1217 |
CTestDevSoundObserver(RDevSoundPolicyUpdateTest* aParent, RDevSoundPolicyUpdateTest::TClientId aClientId);
|
|
1218 |
RDevSoundPolicyUpdateTest* iParent;
|
|
1219 |
RDevSoundPolicyUpdateTest::TClientId iSelfId;
|
|
1220 |
};
|
|
1221 |
|
|
1222 |
|
|
1223 |
const TInt KMaxStringLength = 255; // Used to define DTMF length
|
|
1224 |
|
|
1225 |
class MStoppableTestStep
|
|
1226 |
{
|
|
1227 |
public:
|
|
1228 |
virtual void CallStopTest(TInt aError) = 0;
|
|
1229 |
};
|
|
1230 |
|
|
1231 |
/*
|
|
1232 |
Base class for all DevSound Volume ramp tests
|
|
1233 |
*/
|
|
1234 |
class RDevSoundTestBase: public RAsyncTestStep, public MDevSoundObserver, public MStoppableTestStep
|
|
1235 |
{
|
|
1236 |
public:
|
|
1237 |
// DevSound events
|
|
1238 |
enum TMmfDevSoundEvent
|
|
1239 |
{
|
|
1240 |
EEventInitialize = 0,
|
|
1241 |
EEventInitComplete,
|
|
1242 |
EEventBTBF,
|
|
1243 |
EEventBTBE,
|
|
1244 |
EEventTimerComplete
|
|
1245 |
};
|
|
1246 |
|
|
1247 |
// DevSound states
|
|
1248 |
enum TMmfDevSoundState
|
|
1249 |
{
|
|
1250 |
EStateInitial = 0,
|
|
1251 |
EStateCreated,
|
|
1252 |
EStateInitializing,
|
|
1253 |
EStatePlaying,
|
|
1254 |
EStateRecording,
|
|
1255 |
EStatePause
|
|
1256 |
};
|
|
1257 |
|
|
1258 |
enum TPanicCodes
|
|
1259 |
{
|
|
1260 |
EFsmIncorrectErrorPassed = 0,
|
|
1261 |
EInvalidCallbackCall
|
|
1262 |
};
|
|
1263 |
|
|
1264 |
// from RAsyncTestStep
|
|
1265 |
void KickoffTestL();
|
|
1266 |
void CloseTest();
|
|
1267 |
virtual void CallStopTest(TInt aError);
|
|
1268 |
|
|
1269 |
protected:
|
|
1270 |
RDevSoundTestBase(const TDesC& aTestName);
|
|
1271 |
virtual void DoKickoffTestL() = 0;
|
|
1272 |
virtual void DoTimerCallback();
|
|
1273 |
static TInt TimerCallback(TAny*);
|
|
1274 |
void StartTimer(TTimeIntervalMicroSeconds32 aWaitTime);
|
|
1275 |
// from MDevSoundObserver
|
|
1276 |
void InitializeComplete(TInt aError);
|
|
1277 |
void ToneFinished(TInt aError);
|
|
1278 |
void BufferToBeFilled(CMMFBuffer* aBuffer);
|
|
1279 |
void PlayError(TInt aError);
|
|
1280 |
void BufferToBeEmptied(CMMFBuffer* aBuffer);
|
|
1281 |
void RecordError(TInt aError);
|
|
1282 |
void ConvertError(TInt aError);
|
|
1283 |
void DeviceMessage(TUid aMessageType, const TDesC8& aMsg);
|
|
1284 |
void SendEventToClient(const TMMFEvent& aEvent);
|
|
1285 |
|
|
1286 |
// Executes events of DevSound using a Finite State Machine
|
|
1287 |
virtual void Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError) = 0;
|
|
1288 |
void Panic(TInt aReason);
|
|
1289 |
|
|
1290 |
protected:
|
|
1291 |
TMmfDevSoundState iDevSoundState;
|
|
1292 |
CMMFDevSound* iMMFDevSound;
|
|
1293 |
CPeriodic* iTimer;
|
|
1294 |
};
|
|
1295 |
|
|
1296 |
class RDevSoundDualToneVolumeRampTest : public RDevSoundTestBase
|
|
1297 |
{
|
|
1298 |
public:
|
|
1299 |
static RDevSoundDualToneVolumeRampTest* NewL(const TDesC& aTestName);
|
|
1300 |
private:
|
|
1301 |
RDevSoundDualToneVolumeRampTest(const TDesC& aTestName);
|
|
1302 |
void Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError);
|
|
1303 |
void DoKickoffTestL();
|
|
1304 |
|
|
1305 |
private:
|
|
1306 |
TInt iVolumeRamp;
|
|
1307 |
TInt iDuration;
|
|
1308 |
TInt iFrequencyTone1;
|
|
1309 |
TInt iFrequencyTone2;
|
|
1310 |
};
|
|
1311 |
|
|
1312 |
|
|
1313 |
|
|
1314 |
class RDevSoundDTMFStringVolumeRampTest : public RDevSoundTestBase
|
|
1315 |
{
|
|
1316 |
public:
|
|
1317 |
static RDevSoundDTMFStringVolumeRampTest* NewL(const TDesC& aTestName);
|
|
1318 |
private:
|
|
1319 |
RDevSoundDTMFStringVolumeRampTest(const TDesC& aTestName);
|
|
1320 |
void Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError);
|
|
1321 |
void DoKickoffTestL();
|
|
1322 |
|
|
1323 |
private:
|
|
1324 |
TInt iVolumeRamp;
|
|
1325 |
TBuf16<KMaxStringLength> iDTMFString;
|
|
1326 |
};
|
|
1327 |
|
|
1328 |
class RDevSoundToneSequenceVolumeRampTest : public RDevSoundTestBase
|
|
1329 |
{
|
|
1330 |
public:
|
|
1331 |
static RDevSoundToneSequenceVolumeRampTest* NewL(const TDesC& aTestName);
|
|
1332 |
private:
|
|
1333 |
RDevSoundToneSequenceVolumeRampTest(const TDesC& aTestName);
|
|
1334 |
void Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError);
|
|
1335 |
void DoKickoffTestL();
|
|
1336 |
|
|
1337 |
private:
|
|
1338 |
TInt iVolumeRamp;
|
|
1339 |
};
|
|
1340 |
|
|
1341 |
class RDevSoundDualToneSetVolumeRampWhilePlayingTest : public RDevSoundTestBase
|
|
1342 |
{
|
|
1343 |
public:
|
|
1344 |
static RDevSoundDualToneSetVolumeRampWhilePlayingTest* NewL(const TDesC& aTestName);
|
|
1345 |
private:
|
|
1346 |
RDevSoundDualToneSetVolumeRampWhilePlayingTest(const TDesC& aTestName);
|
|
1347 |
void Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError);
|
|
1348 |
void DoKickoffTestL();
|
|
1349 |
void DoTimerCallback();
|
|
1350 |
void ToneFinished(TInt aError);
|
|
1351 |
|
|
1352 |
private:
|
|
1353 |
TInt iVolume;
|
|
1354 |
TInt iVolumeRamp;
|
|
1355 |
TInt iDuration;
|
|
1356 |
TInt iFrequencyTone1;
|
|
1357 |
TInt iFrequencyTone2;
|
|
1358 |
TBool iTonePlayedTwice;
|
|
1359 |
TTime iStartTime;
|
|
1360 |
TTime iEndTime;
|
|
1361 |
TTimeIntervalMicroSeconds iPlayToneTime;
|
|
1362 |
TInt iTimesToneFinishedCalled;
|
|
1363 |
};
|
|
1364 |
|
|
1365 |
class RDevSoundDTMFStringSetVolumeRampWhilePlayingTest : public RDevSoundTestBase
|
|
1366 |
{
|
|
1367 |
public:
|
|
1368 |
static RDevSoundDTMFStringSetVolumeRampWhilePlayingTest* NewL(const TDesC& aTestName);
|
|
1369 |
private:
|
|
1370 |
RDevSoundDTMFStringSetVolumeRampWhilePlayingTest(const TDesC& aTestName);
|
|
1371 |
void Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError);
|
|
1372 |
void DoKickoffTestL();
|
|
1373 |
void DoTimerCallback();
|
|
1374 |
void ToneFinished(TInt aError);
|
|
1375 |
|
|
1376 |
private:
|
|
1377 |
TInt iVolume;
|
|
1378 |
TInt iVolumeRamp;
|
|
1379 |
TBool iFirstToneFinishedCall;
|
|
1380 |
TBuf16<KMaxStringLength> iDTMFString;
|
|
1381 |
TInt iDTMFPauses;
|
|
1382 |
TInt iDTMFTones;
|
|
1383 |
TTime iStartTime;
|
|
1384 |
TTime iEndTime;
|
|
1385 |
TTimeIntervalMicroSeconds iPlayToneTime;
|
|
1386 |
TInt iTimesToneFinishedCalled;
|
|
1387 |
};
|
|
1388 |
|
|
1389 |
class RDevSoundToneSequenceSetVolumeRampWhilePlayingTest : public RDevSoundTestBase
|
|
1390 |
{
|
|
1391 |
public:
|
|
1392 |
static RDevSoundToneSequenceSetVolumeRampWhilePlayingTest* NewL(const TDesC& aTestName);
|
|
1393 |
private:
|
|
1394 |
RDevSoundToneSequenceSetVolumeRampWhilePlayingTest(const TDesC& aTestName);
|
|
1395 |
void Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError);
|
|
1396 |
void DoKickoffTestL();
|
|
1397 |
void DoTimerCallback();
|
|
1398 |
void ToneFinished(TInt aError);
|
|
1399 |
|
|
1400 |
private:
|
|
1401 |
TInt iVolume;
|
|
1402 |
TInt iVolumeRamp;
|
|
1403 |
TBool iFirstToneFinishedCall;
|
|
1404 |
};
|
|
1405 |
|
|
1406 |
//Test case for PDEF121315 - Cannot update the observer specified with InitializeL
|
|
1407 |
class CMultiInitTestDevSoundObserver;
|
|
1408 |
class RDevSoundMultiInitTest : public RAsyncTestStep
|
|
1409 |
{
|
|
1410 |
public:
|
|
1411 |
enum EMultiInitTestEvent
|
|
1412 |
{
|
|
1413 |
EDevSoundInitComplete,
|
|
1414 |
EBTBF
|
|
1415 |
};
|
|
1416 |
enum EClientId
|
|
1417 |
{
|
|
1418 |
EObserver1,
|
|
1419 |
EObserver2
|
|
1420 |
};
|
|
1421 |
enum ETestState
|
|
1422 |
{
|
|
1423 |
//states for testing CMMFDevSound::InitializeL(MDevSoundObserver& aDevSoundObserver, TMMFState aMode)
|
|
1424 |
EInit1Observer1, //DevSound initialised with Observer1
|
|
1425 |
EInit1Observer2, //DevSound initialised with Observer2
|
|
1426 |
//states for testing - CMMFDevSound::InitializeL(MDevSoundObserver& aDevSoundObserver, TUid aHWDev, TMMFState aMode);
|
|
1427 |
EInit2Observer1, //DevSound initialised with Observer1
|
|
1428 |
EInit2Observer2, //DevSound initialised with Observer2
|
|
1429 |
//states for testing - CMMFDevSound::InitializeL(MDevSoundObserver& aDevSoundObserver, TFourCC aDesiredFourCC, TMMFState aMode);
|
|
1430 |
EInit3Observer1, //DevSound initialised with Observer1
|
|
1431 |
EInit3Observer2 //DevSound initialised with Observer2
|
|
1432 |
};
|
|
1433 |
|
|
1434 |
static RDevSoundMultiInitTest* NewL(const TDesC& aStepName);
|
|
1435 |
// from RAsyncTestStep
|
|
1436 |
void KickoffTestL();
|
|
1437 |
void CloseTest();
|
|
1438 |
|
|
1439 |
void Fsm(EClientId aClientId, EMultiInitTestEvent aTestEvent, TInt aError);
|
|
1440 |
void FsmL(EClientId aClientId, EMultiInitTestEvent aTestEvent, TInt aError);
|
|
1441 |
private:
|
|
1442 |
RDevSoundMultiInitTest(const TDesC& aStepName);
|
|
1443 |
CMMFDevSound* iMMFDevSound;
|
|
1444 |
CMultiInitTestDevSoundObserver* iDevSoundObserver1;
|
|
1445 |
CMultiInitTestDevSoundObserver* iDevSoundObserver2;
|
|
1446 |
TInt iTestState;
|
|
1447 |
};
|
|
1448 |
|
|
1449 |
class CMultiInitTestDevSoundObserver : public CBase, public MDevSoundObserver
|
|
1450 |
{
|
|
1451 |
public:
|
|
1452 |
static CMultiInitTestDevSoundObserver* NewL(RDevSoundMultiInitTest* aParent, RDevSoundMultiInitTest::EClientId aClientId);
|
|
1453 |
// from MDevSoundObserver
|
|
1454 |
void InitializeComplete(TInt aError);
|
|
1455 |
void ToneFinished(TInt aError);
|
|
1456 |
void BufferToBeFilled(CMMFBuffer* aBuffer);
|
|
1457 |
void PlayError(TInt aError);
|
|
1458 |
void BufferToBeEmptied(CMMFBuffer* aBuffer);
|
|
1459 |
void RecordError(TInt aError);
|
|
1460 |
void ConvertError(TInt aError);
|
|
1461 |
void DeviceMessage(TUid aMessageType, const TDesC8& aMsg);
|
|
1462 |
private:
|
|
1463 |
CMultiInitTestDevSoundObserver(RDevSoundMultiInitTest* aParent, RDevSoundMultiInitTest::EClientId aClientId);
|
|
1464 |
RDevSoundMultiInitTest* iParent;
|
|
1465 |
RDevSoundMultiInitTest::EClientId iSelfId;
|
|
1466 |
};
|
|
1467 |
|
|
1468 |
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
1469 |
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
1470 |
//////////// TruePause Devsound /////////////
|
|
1471 |
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
1472 |
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
1473 |
|
|
1474 |
/*
|
|
1475 |
*========================================================================================================
|
|
1476 |
* Constant declarations
|
|
1477 |
*========================================================================================================
|
|
1478 |
*/
|
|
1479 |
|
|
1480 |
const TInt KSizeBuf = 256;
|
|
1481 |
const TInt KMinimumPriority = -100;
|
|
1482 |
const TInt KMaximumPriority = 100;
|
|
1483 |
const TInt K8Bits = 8;
|
|
1484 |
const TInt KTFourCC = 4;
|
|
1485 |
const TInt KMaxSampleRateStringLength = 21;
|
|
1486 |
const TInt KMaxChannelsStringLength = 10;
|
|
1487 |
const TInt KDTMFTonedefaultToneOn = 250000;
|
|
1488 |
const TInt KDTMFTonedefaultToneOff = 50000;
|
|
1489 |
const TInt KDTMFTonedefaultPauseLength = 250000;
|
|
1490 |
const TInt K25Percent = 4;
|
|
1491 |
const TInt KPanicLength = 16;
|
|
1492 |
|
|
1493 |
_LIT(KMsgErrorFourccLength,"Error in getting parameter length from INI file %d");
|
|
1494 |
_LIT(KPlayErrorText, "PlayError");
|
|
1495 |
_LIT(KRecordErrorText, "RecordError");
|
|
1496 |
_LIT(KToneFinishedText, "ToneFinished");
|
|
1497 |
|
|
1498 |
_LIT(KEMMFSampleRate8000Hz,"EMMFSampleRate8000Hz");
|
|
1499 |
_LIT(KEMMFSampleRate11025Hz,"EMMFSampleRate11025Hz");
|
|
1500 |
_LIT(KEMMFSampleRate16000Hz,"EMMFSampleRate16000Hz");
|
|
1501 |
_LIT(KEMMFSampleRate22050Hz,"EMMFSampleRate22050Hz");
|
|
1502 |
_LIT(KEMMFSampleRate32000Hz,"EMMFSampleRate32000Hz");
|
|
1503 |
_LIT(KEMMFSampleRate44100Hz,"EMMFSampleRate44100Hz");
|
|
1504 |
_LIT(KEMMFSampleRate48000Hz,"EMMFSampleRate48000Hz");
|
|
1505 |
_LIT(KEMMFSampleRate88200Hz,"EMMFSampleRate88200Hz");
|
|
1506 |
_LIT(KEMMFSampleRate96000Hz,"EMMFSampleRate96000Hz");
|
|
1507 |
_LIT(KEMMFSampleRate12000Hz,"EMMFSampleRate12000Hz");
|
|
1508 |
_LIT(KEMMFSampleRate24000Hz,"EMMFSampleRate24000Hz");
|
|
1509 |
_LIT(KEMMFSampleRate64000Hz,"EMMFSampleRate64000Hz");
|
|
1510 |
|
|
1511 |
_LIT(KEMMFMono,"EMMFMono");
|
|
1512 |
_LIT(KEMMFStereo,"EMMFStereo");
|
|
1513 |
|
|
1514 |
// Section name keys
|
|
1515 |
_LIT(KSampleRate, "SampleRate");
|
|
1516 |
_LIT(KSampleRate2, "SampleRate2");
|
|
1517 |
_LIT(KChannel, "Channel");
|
|
1518 |
_LIT(KFilename, "Filename");
|
|
1519 |
_LIT(KDurationEvent, "DurationEvent");
|
|
1520 |
_LIT(KOtherFilename, "OtherFilename");
|
|
1521 |
_LIT(KRRecordBalance, "RRecordBalance");
|
|
1522 |
_LIT(KLRecordBalance, "LRecordBalance");
|
|
1523 |
_LIT(KGain, "Gain");
|
|
1524 |
_LIT(KLSpeakerBalance, "LSpeakerBalance");
|
|
1525 |
_LIT(KRSpeakerBalance, "RSpeakerBalance");
|
|
1526 |
_LIT(KInvalidToneSequence,"InvalidToneSequence");
|
|
1527 |
_LIT(KFourccCode, "FourccCode");
|
|
1528 |
_LIT(KRecordDataFollowingResume, "RecordDataFollowingResume");
|
|
1529 |
_LIT(KRecordDataPriorToResume, "RecordDataPriorToResume");
|
|
1530 |
_LIT(KCheckForNoDataAfterResume, "CheckForNoDataAfterResume");
|
|
1531 |
_LIT(KCallResumeAfterResume, "CallResumeAfterResume ");
|
|
1532 |
|
|
1533 |
enum TPanicCodes
|
|
1534 |
{
|
|
1535 |
EFsmIncorrectErrorPassed = 0,
|
|
1536 |
EInvalidCallbackCall
|
|
1537 |
};
|
|
1538 |
|
|
1539 |
// DevSound events
|
|
1540 |
enum TMmfDevSoundEvent
|
|
1541 |
{
|
|
1542 |
EEventInitialize = 0,
|
|
1543 |
EEventInitComplete,
|
|
1544 |
EEventBTBF,
|
|
1545 |
EEventBTBE,
|
|
1546 |
EEventTimerComplete
|
|
1547 |
};
|
|
1548 |
|
|
1549 |
// DevSound states
|
|
1550 |
enum TMmfDevSoundState
|
|
1551 |
{
|
|
1552 |
EStateInitial = 0,
|
|
1553 |
EStateCreated,
|
|
1554 |
EStateInitializing,
|
|
1555 |
EStatePlaying,
|
|
1556 |
EStateRecording,
|
|
1557 |
EStatePause
|
|
1558 |
};
|
|
1559 |
|
|
1560 |
// User defined "devSound client" error codes
|
|
1561 |
enum TMmfDevSoundClientErrorCodes
|
|
1562 |
{
|
|
1563 |
EInvalidClientFSMEvent = 1,
|
|
1564 |
EInvalidClientFSMState,
|
|
1565 |
EReadFileErrorInClient,
|
|
1566 |
EWriteFileErrorInClient
|
|
1567 |
};
|
|
1568 |
|
|
1569 |
// Panic function
|
|
1570 |
static void Panic(const TDesC &aCategory, TInt aReason)
|
|
1571 |
{
|
|
1572 |
User::Panic(aCategory, aReason);
|
|
1573 |
}
|
|
1574 |
|
|
1575 |
/*
|
|
1576 |
*========================================================================================================
|
|
1577 |
* Audio play client
|
|
1578 |
*========================================================================================================
|
|
1579 |
*/
|
|
1580 |
|
|
1581 |
class MA3FDevsoundPlayAudioClientObserver
|
|
1582 |
{
|
|
1583 |
public:
|
|
1584 |
virtual void ClientInitializeCompleteCallback(TInt aError) = 0;
|
|
1585 |
virtual void ClientBufferToBeFilledCallback(TInt aError) = 0;
|
|
1586 |
virtual void ClientPlayErrorCallback(TInt aError, TBool aLastBuffer) = 0;
|
|
1587 |
virtual void ClientPlayHandleOpenFileErrorInValidEventOrStateCallBack(TMmfDevSoundClientErrorCodes aError)=0;
|
|
1588 |
};
|
|
1589 |
|
|
1590 |
class CA3FDevSoundPlayClient : public CBase, public MDevSoundObserver
|
|
1591 |
{
|
|
1592 |
public:
|
|
1593 |
static CA3FDevSoundPlayClient* NewL(MA3FDevsoundPlayAudioClientObserver &aObserver,TFourCC aFourccCode, RFs& aFs, CTestSuite* aSuite = NULL);
|
|
1594 |
virtual ~CA3FDevSoundPlayClient();
|
|
1595 |
// New functions
|
|
1596 |
void SetPriority(TInt priority);
|
|
1597 |
TInt PlayInit(const TDesC& aFileName);
|
|
1598 |
TInt PlayAudio();
|
|
1599 |
void StopPlay();
|
|
1600 |
private:
|
|
1601 |
CA3FDevSoundPlayClient(MA3FDevsoundPlayAudioClientObserver &aObserver, TFourCC aFourccCode, RFs& aFs, CTestSuite* aSuite);
|
|
1602 |
void ConstructL();
|
|
1603 |
TInt Fsm(TMmfDevSoundEvent aDevSoundEvent);
|
|
1604 |
// from MDevSoundObserver
|
|
1605 |
void BufferToBeFilled(CMMFBuffer *aBuffer);
|
|
1606 |
void BufferToBeEmptied(CMMFBuffer *aBuffer);
|
|
1607 |
void DeviceMessage(TUid aMessageType, const TDesC8& aMsg);
|
|
1608 |
void ConvertError(TInt aError);
|
|
1609 |
void InitializeComplete(TInt aError);
|
|
1610 |
void PlayError(TInt aError);
|
|
1611 |
void RecordError(TInt aError);
|
|
1612 |
void ToneFinished(TInt aError);
|
|
1613 |
void LogExtra(const TText8* aFile, TInt aLine, TInt aSeverity,
|
|
1614 |
TRefByValue<const TDesC16> aFmt,...);
|
|
1615 |
TMmfDevSoundState iDevSoundState;
|
|
1616 |
CMMFDevSound* iDevSound;
|
|
1617 |
MA3FDevsoundPlayAudioClientObserver &iObserver;
|
|
1618 |
CMMFBuffer* iBuffer;
|
|
1619 |
TFileName iFilename;
|
|
1620 |
// Handle to a file server session
|
|
1621 |
RFs iFs;
|
|
1622 |
// Handle for the audio file for playing
|
|
1623 |
RFile iFile;
|
|
1624 |
TFourCC iFourccCode;
|
|
1625 |
CTestSuite* iSuite;
|
|
1626 |
};
|
|
1627 |
|
|
1628 |
/*
|
|
1629 |
* TIntegrationTestLog16OverflowClient
|
|
1630 |
*/
|
|
1631 |
class TIntegrationTestLog16OverflowClient :public TDes16Overflow
|
|
1632 |
{
|
|
1633 |
public:
|
|
1634 |
// TDes16Overflow pure virtual
|
|
1635 |
virtual void Overflow(TDes16& aDes);
|
|
1636 |
};
|
|
1637 |
|
|
1638 |
/*
|
|
1639 |
*========================================================================================================
|
|
1640 |
* Base class for TruePause DevSound test steps in this suite.
|
|
1641 |
*========================================================================================================
|
|
1642 |
*/
|
|
1643 |
|
|
1644 |
class CAsyncWriteBufferToFile;
|
|
1645 |
|
|
1646 |
class RA3FDevSoundTestBase: public RAsyncTestStep, public MDevSoundObserver, public MStoppableTestStep
|
|
1647 |
{
|
|
1648 |
public:
|
|
1649 |
// from RAsyncTestStep
|
|
1650 |
void KickoffTestL();
|
|
1651 |
void CloseTest();
|
|
1652 |
virtual void CallStopTest(TInt aError);
|
|
1653 |
protected:
|
|
1654 |
RA3FDevSoundTestBase(const TDesC& aTestName);
|
|
1655 |
virtual void DoKickoffTestL() = 0;
|
|
1656 |
virtual void DoTimerCallback();
|
|
1657 |
static TInt TimerCallback(TAny*);
|
|
1658 |
void StartTimer(TTimeIntervalMicroSeconds32 aWaitTime);
|
|
1659 |
// Executes events of DevSound using a Finite State Machine
|
|
1660 |
virtual void Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError) = 0;
|
|
1661 |
// from MDevSoundObserver
|
|
1662 |
void InitializeComplete(TInt aError);
|
|
1663 |
void ToneFinished(TInt aError);
|
|
1664 |
void BufferToBeFilled(CMMFBuffer* aBuffer);
|
|
1665 |
void PlayError(TInt aError);
|
|
1666 |
void BufferToBeEmptied(CMMFBuffer* aBuffer);
|
|
1667 |
void RecordError(TInt aError);
|
|
1668 |
void ConvertError(TInt aError);
|
|
1669 |
void DeviceMessage(TUid aMessageType, const TDesC8& aMsg);
|
|
1670 |
void SendEventToClient(const TMMFEvent& aEvent);
|
|
1671 |
void SampleRateFromTIntToTMMFSampleRate(TInt aSampleRate, TMMFSampleRate &aESampleRate);
|
|
1672 |
void SampleRateFromTUintToString(TUint aSampleRate, TDes& aStringSampleRate);
|
|
1673 |
void ChannelsFromTUintToString(TUint aChannels, TDes& aStringChannels);
|
|
1674 |
void EncodingFromStringToTFourCC(const TDesC& aFourCCString);
|
|
1675 |
void PrintSupportedCapabilities(TUint aSampleRate,TUint aChannel);
|
|
1676 |
protected:
|
|
1677 |
TBuf<KSizeBuf> iFourCCString;
|
|
1678 |
TFourCC iFourCCCode;
|
|
1679 |
TMmfDevSoundState iDevSoundState;
|
|
1680 |
CMMFDevSound* iMMFDevSound;
|
|
1681 |
CPeriodic* iTimer;
|
|
1682 |
CMMFBuffer* iBuffer;
|
|
1683 |
// Handle for the audio file for playing and recording
|
|
1684 |
RFile iFile;
|
|
1685 |
// Handle to a file server session
|
|
1686 |
RFs iFs;
|
|
1687 |
CAsyncWriteBufferToFile* iAsyncWriteBTFAO;
|
|
1688 |
};
|
|
1689 |
|
|
1690 |
class TSampleRateToTMMFSampleRate
|
|
1691 |
{
|
|
1692 |
public:
|
|
1693 |
TInt iTIntSampleRate;
|
|
1694 |
TMMFSampleRate iTMMFSampleRate;
|
|
1695 |
};
|
|
1696 |
|
|
1697 |
class TSampleRateToString
|
|
1698 |
{
|
|
1699 |
public:
|
|
1700 |
TUint iTUIntSampleRate;
|
|
1701 |
TPtrC iTPtrSampleRate;
|
|
1702 |
};
|
|
1703 |
|
|
1704 |
class TChannelsToString
|
|
1705 |
{
|
|
1706 |
public:
|
|
1707 |
TUint iTUIntChannels;
|
|
1708 |
TPtrC iTPtrChannels;
|
|
1709 |
};
|
|
1710 |
|
|
1711 |
/*
|
|
1712 |
*========================================================================================================
|
|
1713 |
* CAsyncWriteBufferToFile
|
|
1714 |
*========================================================================================================
|
|
1715 |
*/
|
|
1716 |
|
|
1717 |
class CAsyncWriteBufferToFile : public CActive
|
|
1718 |
{
|
|
1719 |
public:
|
|
1720 |
static CAsyncWriteBufferToFile* NewL(RFile& aFile, CMMFDevSound* aDevSound, MStoppableTestStep* aTestStep);
|
|
1721 |
~CAsyncWriteBufferToFile();
|
|
1722 |
void Start(CMMFDataBuffer* aBuffer);
|
|
1723 |
|
|
1724 |
private:
|
|
1725 |
CAsyncWriteBufferToFile(RFile& aFile, CMMFDevSound* aDevSound, MStoppableTestStep* aTestStep);
|
|
1726 |
void ConstructL();
|
|
1727 |
virtual void DoCancel();
|
|
1728 |
virtual void RunL();
|
|
1729 |
virtual TInt RunError(TInt aError);
|
|
1730 |
|
|
1731 |
private:
|
|
1732 |
RFile& iFile;
|
|
1733 |
CMMFDevSound* iDevSound;
|
|
1734 |
MStoppableTestStep* iTestStep;
|
|
1735 |
};
|
|
1736 |
|
|
1737 |
/*
|
|
1738 |
*========================================================================================================
|
|
1739 |
* Play base class
|
|
1740 |
*========================================================================================================
|
|
1741 |
*/
|
|
1742 |
|
|
1743 |
class RA3FDevSoundTestPlay : public RA3FDevSoundTestBase
|
|
1744 |
{
|
|
1745 |
protected:
|
|
1746 |
RA3FDevSoundTestPlay(const TDesC& aTestName);
|
|
1747 |
~RA3FDevSoundTestPlay();
|
|
1748 |
void Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError);
|
|
1749 |
void DoTimerCallback();
|
|
1750 |
protected:
|
|
1751 |
TFileName iFilename;
|
|
1752 |
TFileName iOtherFilename;
|
|
1753 |
TInt iSampleRate;
|
|
1754 |
TInt iSampleRate2;
|
|
1755 |
TInt iChannels;
|
|
1756 |
TInt iLSpeakerBalance;
|
|
1757 |
TInt iRSpeakerBalance;
|
|
1758 |
TInt iVolume;
|
|
1759 |
|
|
1760 |
TBool iClientRejectedClause;
|
|
1761 |
TBool iClientPreemptedClause;
|
|
1762 |
TBool iStopClause;
|
|
1763 |
TBool iVolumeBalanceClause;
|
|
1764 |
TBool iConfigClause;
|
|
1765 |
TBool iCompletePlayBack;
|
|
1766 |
TBool iInitAfterPauseClause;
|
|
1767 |
TInt iErrExpected;
|
|
1768 |
|
|
1769 |
TMMFSampleRate iESampleRate;
|
|
1770 |
TMMFCapabilities iCapabilitiesSet;
|
|
1771 |
CA3FDevSoundPlayClient* iDevsoundPlayClient;
|
|
1772 |
};
|
|
1773 |
|
|
1774 |
/*
|
|
1775 |
*========================================================================================================
|
|
1776 |
* Record base class
|
|
1777 |
*========================================================================================================
|
|
1778 |
*/
|
|
1779 |
|
|
1780 |
class RA3FDevSoundTestRecord : public RA3FDevSoundTestBase
|
|
1781 |
{
|
|
1782 |
protected:
|
|
1783 |
RA3FDevSoundTestRecord(const TDesC& aTestName);
|
|
1784 |
void Reset();
|
|
1785 |
~RA3FDevSoundTestRecord();
|
|
1786 |
void Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError);
|
|
1787 |
void DoTimerCallback();
|
|
1788 |
void BufferToBeEmptied(CMMFBuffer* aBuffer);
|
|
1789 |
protected:
|
|
1790 |
TInt iDuration;
|
|
1791 |
TInt iSampleRate;
|
|
1792 |
TInt iSampleRate2;
|
|
1793 |
TInt iLRecordBalance;
|
|
1794 |
TInt iRRecordBalance;
|
|
1795 |
TInt iChannels;
|
|
1796 |
TInt iGain;
|
|
1797 |
TBool isSecondTimeRecording;
|
|
1798 |
TBool iNoWaitLastBufferClause;
|
|
1799 |
TBool iPCMFormatClause;
|
|
1800 |
TBool iGainBalanceClause;
|
|
1801 |
TBool iConfigClause;
|
|
1802 |
TMMFSampleRate iESampleRate;
|
|
1803 |
TMMFCapabilities iCapabilitiesSet;
|
|
1804 |
TBool iFollowingResume;
|
|
1805 |
TBool iRecordDataFollowingResume;
|
|
1806 |
TBool iRecordDataPriorToResume;
|
|
1807 |
TBool iCheckForNoDataAfterResume;
|
|
1808 |
TBool iInitAfterPauseClause;
|
|
1809 |
TBool iResumeAfterResume;
|
|
1810 |
};
|
|
1811 |
|
|
1812 |
/*
|
|
1813 |
*========================================================================================================
|
|
1814 |
* Tone base class
|
|
1815 |
*========================================================================================================
|
|
1816 |
*/
|
|
1817 |
|
|
1818 |
class RA3FDevSoundTestTone : public RA3FDevSoundTestBase
|
|
1819 |
{
|
|
1820 |
protected:
|
|
1821 |
RA3FDevSoundTestTone(const TDesC& aTestName);
|
|
1822 |
~RA3FDevSoundTestTone();
|
|
1823 |
void Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError);
|
|
1824 |
void DoTimerCallback();
|
|
1825 |
protected:
|
|
1826 |
enum TPlayToneType
|
|
1827 |
{
|
|
1828 |
EPlayTone,
|
|
1829 |
EPlayDualTone,
|
|
1830 |
EPlayDTMFString,
|
|
1831 |
EPlayToneSequence
|
|
1832 |
};
|
|
1833 |
protected:
|
|
1834 |
TInt iDuration;
|
|
1835 |
TInt iDurationEvent;
|
|
1836 |
TInt iFrequencyTone1;
|
|
1837 |
TInt iFrequencyTone2;
|
|
1838 |
TInt iLSpeakerBalance;
|
|
1839 |
TInt iRSpeakerBalance;
|
|
1840 |
TInt iVolume;
|
|
1841 |
TBool iVolumeBalanceClause;
|
|
1842 |
TBool iPaused;
|
|
1843 |
TBuf16<KMaxStringLength> iDTMFString;
|
|
1844 |
TInt iDTMFPauses;
|
|
1845 |
TInt iDTMFTones;
|
|
1846 |
TPlayToneType iPlayToneType;
|
|
1847 |
};
|
|
1848 |
|
|
1849 |
/*
|
|
1850 |
*========================================================================================================
|
|
1851 |
* MM-MMF-DEVSOUND-U-0081-HP
|
|
1852 |
*/
|
|
1853 |
|
|
1854 |
class RA3FDevSoundPauseAndResumePlayingTest : public RA3FDevSoundTestPlay
|
|
1855 |
{
|
|
1856 |
public:
|
|
1857 |
static RA3FDevSoundPauseAndResumePlayingTest* NewL(const TDesC& aTestName);
|
|
1858 |
private:
|
|
1859 |
RA3FDevSoundPauseAndResumePlayingTest(const TDesC& aTestName);
|
|
1860 |
void DoKickoffTestL();
|
|
1861 |
};
|
|
1862 |
|
|
1863 |
/*
|
|
1864 |
*========================================================================================================
|
|
1865 |
* MM-MMF-DEVSOUND-U-0082-HP
|
|
1866 |
*/
|
|
1867 |
class RA3FDevSoundPlayRejectionTestWhilePausing : public RA3FDevSoundTestPlay, public MA3FDevsoundPlayAudioClientObserver
|
|
1868 |
{
|
|
1869 |
public:
|
|
1870 |
static RA3FDevSoundPlayRejectionTestWhilePausing* NewL(const TDesC& aTestName);
|
|
1871 |
private:
|
|
1872 |
RA3FDevSoundPlayRejectionTestWhilePausing(const TDesC& aTestName);
|
|
1873 |
void DoKickoffTestL();
|
|
1874 |
void PlayError(TInt aError);
|
|
1875 |
void ClientInitializeCompleteCallback(TInt aError);
|
|
1876 |
void ClientBufferToBeFilledCallback(TInt aError);
|
|
1877 |
void ClientPlayErrorCallback(TInt aError, TBool aLastBuffer);
|
|
1878 |
void ClientPlayHandleOpenFileErrorInValidEventOrStateCallBack(TMmfDevSoundClientErrorCodes aError);
|
|
1879 |
};
|
|
1880 |
|
|
1881 |
/*
|
|
1882 |
*========================================================================================================
|
|
1883 |
* MM-MMF-DEVSOUND-U-0083-HP
|
|
1884 |
*/
|
|
1885 |
class RA3FDevSoundPlayPreemptionTestWhilePausing : public RA3FDevSoundTestPlay, public MA3FDevsoundPlayAudioClientObserver
|
|
1886 |
{
|
|
1887 |
public:
|
|
1888 |
static RA3FDevSoundPlayPreemptionTestWhilePausing* NewL(const TDesC& aTestName);
|
|
1889 |
private:
|
|
1890 |
RA3FDevSoundPlayPreemptionTestWhilePausing(const TDesC& aTestName);
|
|
1891 |
void DoKickoffTestL();
|
|
1892 |
void PlayError(TInt aError);
|
|
1893 |
void ClientInitializeCompleteCallback(TInt aError);
|
|
1894 |
void ClientBufferToBeFilledCallback(TInt aError);
|
|
1895 |
void ClientPlayErrorCallback(TInt aError, TBool aLastBuffer);
|
|
1896 |
void ClientPlayHandleOpenFileErrorInValidEventOrStateCallBack(TMmfDevSoundClientErrorCodes aError);
|
|
1897 |
};
|
|
1898 |
|
|
1899 |
/*
|
|
1900 |
*========================================================================================================
|
|
1901 |
* MM-MMF-DEVSOUND-U-0084-HP
|
|
1902 |
*/
|
|
1903 |
class RA3FDevSoundPlayPauseAndStopPlayingTest : public RA3FDevSoundTestPlay
|
|
1904 |
{
|
|
1905 |
public:
|
|
1906 |
static RA3FDevSoundPlayPauseAndStopPlayingTest* NewL(const TDesC& aTestName);
|
|
1907 |
private:
|
|
1908 |
RA3FDevSoundPlayPauseAndStopPlayingTest(const TDesC& aTestName);
|
|
1909 |
void DoKickoffTestL();
|
|
1910 |
void BufferToBeFilled(CMMFBuffer* aBuffer);
|
|
1911 |
};
|
|
1912 |
|
|
1913 |
/*
|
|
1914 |
*========================================================================================================
|
|
1915 |
* MM-MMF-DEVSOUND-U-0085-HP
|
|
1916 |
*/
|
|
1917 |
class RA3FDevSoundPauseSetVolumeBalanceAndResumePlayingTest : public RA3FDevSoundTestPlay
|
|
1918 |
{
|
|
1919 |
public:
|
|
1920 |
static RA3FDevSoundPauseSetVolumeBalanceAndResumePlayingTest* NewL(const TDesC& aTestName);
|
|
1921 |
private:
|
|
1922 |
RA3FDevSoundPauseSetVolumeBalanceAndResumePlayingTest(const TDesC& aTestName);
|
|
1923 |
void DoKickoffTestL();
|
|
1924 |
void BufferToBeFilled(CMMFBuffer* aBuffer);
|
|
1925 |
};
|
|
1926 |
|
|
1927 |
/*
|
|
1928 |
*========================================================================================================
|
|
1929 |
* MM-MMF-DEVSOUND-U-0086-HP
|
|
1930 |
*/
|
|
1931 |
class RA3FDevSoundPauseSetConfigAndResumePlayingTest : public RA3FDevSoundTestPlay
|
|
1932 |
{
|
|
1933 |
public:
|
|
1934 |
static RA3FDevSoundPauseSetConfigAndResumePlayingTest* NewL(const TDesC& aTestName);
|
|
1935 |
private:
|
|
1936 |
RA3FDevSoundPauseSetConfigAndResumePlayingTest(const TDesC& aTestName);
|
|
1937 |
void DoKickoffTestL();
|
|
1938 |
};
|
|
1939 |
|
|
1940 |
/*
|
|
1941 |
*========================================================================================================
|
|
1942 |
* MM-MMF-DEVSOUND-U-0087-HP
|
|
1943 |
*/
|
|
1944 |
|
|
1945 |
class RNonA3FDevSoundPauseAndResumePlayingTest : public RA3FDevSoundTestPlay
|
|
1946 |
{
|
|
1947 |
public:
|
|
1948 |
static RNonA3FDevSoundPauseAndResumePlayingTest* NewL(const TDesC& aTestName);
|
|
1949 |
private:
|
|
1950 |
RNonA3FDevSoundPauseAndResumePlayingTest(const TDesC& aTestName);
|
|
1951 |
void DoKickoffTestL();
|
|
1952 |
};
|
|
1953 |
|
|
1954 |
/*
|
|
1955 |
*========================================================================================================
|
|
1956 |
* MM-MMF-DEVSOUND-U-0088-HP
|
|
1957 |
*/
|
|
1958 |
|
|
1959 |
class RA3FDevSoundPauseAndResumeRecordingPCMTest : public RA3FDevSoundTestRecord
|
|
1960 |
{
|
|
1961 |
public:
|
|
1962 |
static RA3FDevSoundPauseAndResumeRecordingPCMTest* NewL(const TDesC& aTestName);
|
|
1963 |
protected:
|
|
1964 |
RA3FDevSoundPauseAndResumeRecordingPCMTest(const TDesC& aTestName);
|
|
1965 |
void DoKickoffTestL();
|
|
1966 |
};
|
|
1967 |
|
|
1968 |
/*
|
|
1969 |
*========================================================================================================
|
|
1970 |
* MM-MMF-DEVSOUND-U-0089-HP
|
|
1971 |
*/
|
|
1972 |
|
|
1973 |
class RA3FDevSoundPauseAndResumeRecordingPCMDoNotWaitForLastBufferTest : public RA3FDevSoundTestRecord
|
|
1974 |
{
|
|
1975 |
public:
|
|
1976 |
static RA3FDevSoundPauseAndResumeRecordingPCMDoNotWaitForLastBufferTest* NewL(const TDesC& aTestName);
|
|
1977 |
protected:
|
|
1978 |
RA3FDevSoundPauseAndResumeRecordingPCMDoNotWaitForLastBufferTest(const TDesC& aTestName);
|
|
1979 |
void DoKickoffTestL();
|
|
1980 |
};
|
|
1981 |
|
|
1982 |
/*
|
|
1983 |
*========================================================================================================
|
|
1984 |
* MM-MMF-DEVSOUND-U-0090-HP
|
|
1985 |
*/
|
|
1986 |
|
|
1987 |
class RA3FDevSoundPauseAndResumeRecordingNonPCMTest : public RA3FDevSoundTestRecord
|
|
1988 |
{
|
|
1989 |
public:
|
|
1990 |
static RA3FDevSoundPauseAndResumeRecordingNonPCMTest* NewL(const TDesC& aTestName);
|
|
1991 |
protected:
|
|
1992 |
RA3FDevSoundPauseAndResumeRecordingNonPCMTest(const TDesC& aTestName);
|
|
1993 |
void DoKickoffTestL();
|
|
1994 |
};
|
|
1995 |
|
|
1996 |
/*
|
|
1997 |
*========================================================================================================
|
|
1998 |
* MM-MMF-DEVSOUND-U-0091-HP
|
|
1999 |
*/
|
|
2000 |
|
|
2001 |
class RA3FDevSoundPauseSetGainBalanceAndResumeRecordingPCMTest : public RA3FDevSoundTestRecord
|
|
2002 |
{
|
|
2003 |
public:
|
|
2004 |
static RA3FDevSoundPauseSetGainBalanceAndResumeRecordingPCMTest* NewL(const TDesC& aTestName);
|
|
2005 |
protected:
|
|
2006 |
RA3FDevSoundPauseSetGainBalanceAndResumeRecordingPCMTest(const TDesC& aTestName);
|
|
2007 |
void DoKickoffTestL();
|
|
2008 |
};
|
|
2009 |
|
|
2010 |
/*
|
|
2011 |
*========================================================================================================
|
|
2012 |
* MM-MMF-DEVSOUND-U-0092-HP
|
|
2013 |
*/
|
|
2014 |
|
|
2015 |
class RA3FDevSoundPauseSetConfigAndResumeRecordingPCMTest : public RA3FDevSoundTestRecord
|
|
2016 |
{
|
|
2017 |
public:
|
|
2018 |
static RA3FDevSoundPauseSetConfigAndResumeRecordingPCMTest* NewL(const TDesC& aTestName);
|
|
2019 |
protected:
|
|
2020 |
RA3FDevSoundPauseSetConfigAndResumeRecordingPCMTest(const TDesC& aTestName);
|
|
2021 |
void DoKickoffTestL();
|
|
2022 |
};
|
|
2023 |
|
|
2024 |
/*
|
|
2025 |
*========================================================================================================
|
|
2026 |
* MM-MMF-DEVSOUND-U-0093-HP
|
|
2027 |
*/
|
|
2028 |
|
|
2029 |
class RA3FDevSoundTonePlayTonePauseAndResume : public RA3FDevSoundTestTone
|
|
2030 |
{
|
|
2031 |
public:
|
|
2032 |
static RA3FDevSoundTonePlayTonePauseAndResume* NewL(const TDesC& aTestName);
|
|
2033 |
private:
|
|
2034 |
RA3FDevSoundTonePlayTonePauseAndResume(const TDesC& aTestName);
|
|
2035 |
void DoKickoffTestL();
|
|
2036 |
void ToneFinished(TInt aError);
|
|
2037 |
};
|
|
2038 |
|
|
2039 |
/*
|
|
2040 |
*========================================================================================================
|
|
2041 |
* MM-MMF-DEVSOUND-U-0094-HP
|
|
2042 |
*/
|
|
2043 |
|
|
2044 |
class RA3FDevSoundTonePlayDualTonePauseAndResume : public RA3FDevSoundTestTone
|
|
2045 |
{
|
|
2046 |
public:
|
|
2047 |
static RA3FDevSoundTonePlayDualTonePauseAndResume* NewL(const TDesC& aTestName);
|
|
2048 |
private:
|
|
2049 |
RA3FDevSoundTonePlayDualTonePauseAndResume(const TDesC& aTestName);
|
|
2050 |
void DoKickoffTestL();
|
|
2051 |
void ToneFinished(TInt aError);
|
|
2052 |
};
|
|
2053 |
|
|
2054 |
/*
|
|
2055 |
*========================================================================================================
|
|
2056 |
* MM-MMF-DEVSOUND-U-0095-HP
|
|
2057 |
*/
|
|
2058 |
|
|
2059 |
class RA3FDevSoundTonePlayDTMFStringPauseAndResume : public RA3FDevSoundTestTone
|
|
2060 |
{
|
|
2061 |
public:
|
|
2062 |
static RA3FDevSoundTonePlayDTMFStringPauseAndResume* NewL(const TDesC& aTestName);
|
|
2063 |
private:
|
|
2064 |
RA3FDevSoundTonePlayDTMFStringPauseAndResume(const TDesC& aTestName);
|
|
2065 |
void DoKickoffTestL();
|
|
2066 |
void ToneFinished(TInt aError);
|
|
2067 |
};
|
|
2068 |
|
|
2069 |
/*
|
|
2070 |
*========================================================================================================
|
|
2071 |
* MM-MMF-DEVSOUND-U-0096-HP
|
|
2072 |
*/
|
|
2073 |
|
|
2074 |
class RA3FDevSoundTonePlayToneSequencePauseAndResume : public RA3FDevSoundTestTone
|
|
2075 |
{
|
|
2076 |
public:
|
|
2077 |
static RA3FDevSoundTonePlayToneSequencePauseAndResume* NewL(const TDesC& aTestName);
|
|
2078 |
private:
|
|
2079 |
RA3FDevSoundTonePlayToneSequencePauseAndResume(const TDesC& aTestName);
|
|
2080 |
void DoKickoffTestL();
|
|
2081 |
};
|
|
2082 |
|
|
2083 |
/*
|
|
2084 |
*========================================================================================================
|
|
2085 |
* MM-MMF-DEVSOUND-U-0097-HP
|
|
2086 |
*/
|
|
2087 |
|
|
2088 |
class RA3FDevSoundTonePlayToneSetVolumeBalancePauseAndResume : public RA3FDevSoundTestTone
|
|
2089 |
{
|
|
2090 |
public:
|
|
2091 |
static RA3FDevSoundTonePlayToneSetVolumeBalancePauseAndResume* NewL(const TDesC& aTestName);
|
|
2092 |
private:
|
|
2093 |
RA3FDevSoundTonePlayToneSetVolumeBalancePauseAndResume(const TDesC& aTestName);
|
|
2094 |
void DoKickoffTestL();
|
|
2095 |
void ToneFinished(TInt aError);
|
|
2096 |
};
|
|
2097 |
|
|
2098 |
/*
|
|
2099 |
*========================================================================================================
|
|
2100 |
* MM-MMF-DEVSOUND-U-0098-HP
|
|
2101 |
*/
|
|
2102 |
|
|
2103 |
class RA3FDevSoundTonePlayToneSequenceSetVolumeBalancePauseAndResume : public RA3FDevSoundTestTone
|
|
2104 |
{
|
|
2105 |
public:
|
|
2106 |
static RA3FDevSoundTonePlayToneSequenceSetVolumeBalancePauseAndResume* NewL(const TDesC& aTestName);
|
|
2107 |
private:
|
|
2108 |
RA3FDevSoundTonePlayToneSequenceSetVolumeBalancePauseAndResume(const TDesC& aTestName);
|
|
2109 |
void DoKickoffTestL();
|
|
2110 |
};
|
|
2111 |
|
|
2112 |
|
|
2113 |
/*
|
|
2114 |
*========================================================================================================
|
|
2115 |
* MM-MMF-DEVSOUND-U-0099-HP
|
|
2116 |
*/
|
|
2117 |
class RA3FDevSoundPlayPauseFlushResumeTest : public RA3FDevSoundTestBase
|
|
2118 |
{
|
|
2119 |
public:
|
|
2120 |
static RA3FDevSoundPlayPauseFlushResumeTest* NewL(const TDesC& aTestName);
|
|
2121 |
private:
|
|
2122 |
RA3FDevSoundPlayPauseFlushResumeTest(const TDesC& aTestName);
|
|
2123 |
|
|
2124 |
//from RA3FDevSoundTestBase
|
|
2125 |
virtual void DoKickoffTestL();
|
|
2126 |
virtual void DoTimerCallback();
|
|
2127 |
virtual void Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError);
|
|
2128 |
|
|
2129 |
private:
|
|
2130 |
TFileName iFileName;
|
|
2131 |
};
|
|
2132 |
|
|
2133 |
|
|
2134 |
const TInt KTimerCallBackFinished = 0x12345;
|
|
2135 |
|
|
2136 |
/*
|
|
2137 |
*========================================================================================================
|
|
2138 |
* MM-MMF-DEVSOUND-U-0103-HP
|
|
2139 |
*/
|
|
2140 |
|
|
2141 |
// For testing SMP SAFE condition for Custom Interface
|
|
2142 |
class RTestStepMultipleCustomInterface : public RTestStep
|
|
2143 |
{
|
|
2144 |
public:
|
|
2145 |
static RTestStepMultipleCustomInterface* NewL();
|
|
2146 |
|
|
2147 |
// from RTestStep
|
|
2148 |
TVerdict DoTestStepL();
|
|
2149 |
TVerdict DoTestStepPostambleL();
|
|
2150 |
|
|
2151 |
protected:
|
|
2152 |
TVerdict TestCustomInterfaceL(MMMFDevSoundTestCustomInterface* aInterface1, MMMFDevSoundTestCustomInterface* aInterface2);
|
|
2153 |
RTestStepMultipleCustomInterface();
|
|
2154 |
|
|
2155 |
public:
|
|
2156 |
TInt iTimerFlag;
|
|
2157 |
TInt iAsyncCompleteFlag;
|
|
2158 |
|
|
2159 |
private:
|
|
2160 |
CPeriodic* iPeriodic;
|
|
2161 |
};
|
|
2162 |
|
|
2163 |
/*
|
|
2164 |
*========================================================================================================
|
|
2165 |
* MM-MMF-DEVSOUND-U-0104-HP
|
|
2166 |
*/
|
|
2167 |
|
|
2168 |
// Test that overflows during recording are ignored by the framework
|
|
2169 |
class RTestStepRecordOverflow : public RDevSoundTestBase
|
|
2170 |
{
|
|
2171 |
public:
|
|
2172 |
static RTestStepRecordOverflow* NewL(const TDesC& aTestName);
|
|
2173 |
~RTestStepRecordOverflow();
|
|
2174 |
void Fsm(TMmfDevSoundEvent aDevSoundEvent, TInt aError);
|
|
2175 |
void DoKickoffTestL();
|
|
2176 |
virtual void BufferToBeEmptied(CMMFBuffer* aBuffer);
|
|
2177 |
void HandleCallbackTimeout();
|
|
2178 |
static TInt TimerCallBack(TAny* aPtr);
|
|
2179 |
private:
|
|
2180 |
RTestStepRecordOverflow(const TDesC& aTestName);
|
|
2181 |
private:
|
|
2182 |
TInt iBuffersReceived;
|
|
2183 |
RFs iFs;
|
|
2184 |
RFile iFile;
|
|
2185 |
CAsyncWriteBufferToFile* iAsyncWriteBTFAO;
|
|
2186 |
CPeriodic* iSimulateOverflowTimer;
|
|
2187 |
TInt iLastSamplesRecorded;
|
|
2188 |
};
|
|
2189 |
|
|
2190 |
/*
|
|
2191 |
*========================================================================================================
|
|
2192 |
* MM-MMF-DEVSOUND-U-0105-HP
|
|
2193 |
*/
|
|
2194 |
|
|
2195 |
class RA3FDevSoundPauseAndInitRecordingPCMTest : public RA3FDevSoundTestRecord
|
|
2196 |
{
|
|
2197 |
public:
|
|
2198 |
static RA3FDevSoundPauseAndInitRecordingPCMTest* NewL(const TDesC& aTestName);
|
|
2199 |
protected:
|
|
2200 |
RA3FDevSoundPauseAndInitRecordingPCMTest(const TDesC& aTestName);
|
|
2201 |
void DoKickoffTestL();
|
|
2202 |
};
|
|
2203 |
|
|
2204 |
|
|
2205 |
/*
|
|
2206 |
*========================================================================================================
|
|
2207 |
* MM-MMF-DEVSOUND-U-0199-HP
|
|
2208 |
*/
|
|
2209 |
|
|
2210 |
class RA3FDevSoundPauseAndResumeAndInitPlayingTest : public RA3FDevSoundTestPlay
|
|
2211 |
{
|
|
2212 |
public:
|
|
2213 |
static RA3FDevSoundPauseAndResumeAndInitPlayingTest* NewL(const TDesC& aTestName);
|
|
2214 |
private:
|
|
2215 |
RA3FDevSoundPauseAndResumeAndInitPlayingTest(const TDesC& aTestName);
|
|
2216 |
void DoKickoffTestL();
|
|
2217 |
};
|
|
2218 |
|
|
2219 |
/*
|
|
2220 |
*========================================================================================================
|
|
2221 |
*/
|
6
|
2222 |
|
|
2223 |
//
|
|
2224 |
// MM-MMF-DEVSOUND-U-0300-HP
|
|
2225 |
//
|
|
2226 |
|
|
2227 |
// these delarations should be the same as in tsu_mmf_devsound_starttest.h
|
|
2228 |
_LIT(KStartToolTestSvrName, "!StartToolSvr");
|
|
2229 |
const TInt KStartToolTestCaseErrorCode = -999;
|
|
2230 |
|
|
2231 |
class RA3FDevSoundSvrStartToolTest : public RAsyncTestStep
|
|
2232 |
{
|
|
2233 |
public:
|
|
2234 |
static RA3FDevSoundSvrStartToolTest* NewL(const TDesC& aTestName);
|
|
2235 |
private:
|
|
2236 |
RA3FDevSoundSvrStartToolTest(const TDesC& aTestName);
|
|
2237 |
// from RAsyncTestStep
|
|
2238 |
void KickoffTestL();
|
|
2239 |
void CloseTest();
|
|
2240 |
};
|
|
2241 |
|
|
2242 |
class RSrvStartTestSession : public RSessionBase
|
|
2243 |
// virtually dummy client session, try to connect to server which is expected to fail
|
|
2244 |
{
|
|
2245 |
public:
|
|
2246 |
TInt CreateSession();
|
|
2247 |
};
|
0
|
2248 |
|
|
2249 |
/**
|
|
2250 |
*
|
|
2251 |
* CMultipleAsyncListener provides the asynchronous operation
|
|
2252 |
* of an active object. Used for ensuring that only when two async calls
|
|
2253 |
* are complete, only then CActiveScheduler::Stop is called.
|
|
2254 |
*
|
|
2255 |
* @lib "TSU_MMF_DEVSOUND_SUITE.lib"
|
|
2256 |
*
|
|
2257 |
*
|
|
2258 |
*/
|
|
2259 |
class CMultipleAsyncListener : public CActive
|
|
2260 |
{
|
|
2261 |
public:
|
|
2262 |
CMultipleAsyncListener(RTestStepMultipleCustomInterface* aMultipleCustomInterface) : CActive(CActive::EPriorityStandard),iMultipleCustomInterface(aMultipleCustomInterface)
|
|
2263 |
{
|
|
2264 |
CActiveScheduler::Add(this);
|
|
2265 |
}
|
|
2266 |
void InitialiseActiveListener()
|
|
2267 |
{
|
|
2268 |
iStatus = KRequestPending; SetActive();
|
|
2269 |
}
|
|
2270 |
~CMultipleAsyncListener()
|
|
2271 |
{
|
|
2272 |
Cancel();
|
|
2273 |
}
|
|
2274 |
// From CActive
|
|
2275 |
virtual void RunL()
|
|
2276 |
{
|
|
2277 |
iMultipleCustomInterface->iAsyncCompleteFlag++;
|
|
2278 |
if(iMultipleCustomInterface->iAsyncCompleteFlag == 2)
|
|
2279 |
{
|
|
2280 |
CActiveScheduler::Stop();
|
|
2281 |
}
|
|
2282 |
}
|
|
2283 |
virtual void DoCancel()
|
|
2284 |
{
|
|
2285 |
|
|
2286 |
};
|
|
2287 |
|
|
2288 |
public:
|
|
2289 |
|
|
2290 |
RTestStepMultipleCustomInterface* iMultipleCustomInterface;
|
|
2291 |
};
|
|
2292 |
|
|
2293 |
|
|
2294 |
//------------------------------------------------------------------
|
|
2295 |
|
|
2296 |
#endif// __TSU_MMF_DEVSOUND_STEP_H__
|
|
2297 |
|