0
|
1 |
// Copyright (c) 2002-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 |
// This file contains an example Test step implementation
|
|
15 |
// This demonstrates the various functions provided
|
|
16 |
// by the CTestStep base class which are available within
|
|
17 |
// a test step
|
|
18 |
//
|
|
19 |
//
|
|
20 |
|
|
21 |
// EPOC includes
|
|
22 |
#include <e32base.h>
|
|
23 |
#include <e32test.h>
|
|
24 |
#include <e32keys.h>
|
|
25 |
#include <c32comm.h>
|
|
26 |
#include <f32file.h>
|
|
27 |
#include <etel.h>
|
|
28 |
#include <etelmm.h>
|
|
29 |
#include <testframework.h>
|
|
30 |
|
|
31 |
#include <mdaaudiosampleplayer.h>
|
|
32 |
//#include <MdaAudioSampleEditor.h>
|
|
33 |
//#include <MdaAudioTonePlayer.h>
|
|
34 |
|
|
35 |
// Test system includes
|
|
36 |
#include <testframework.h>
|
|
37 |
|
|
38 |
// Specific includes for this test suite
|
|
39 |
#include "TestStepUnitMMFAudClient.h"
|
|
40 |
#include "TestSuiteUnitMMFAudClient.h"
|
|
41 |
|
|
42 |
// Specific includes for these test steps
|
|
43 |
#include "TestStepPlayerManip.h"
|
|
44 |
|
|
45 |
#include "mmfclientaudioplayer.h"
|
|
46 |
#include "../../ctlfrm/TS_Codes.h"
|
|
47 |
|
|
48 |
_LIT(KAudioControllerName,"Symbian Audio Wav Test controller");
|
|
49 |
|
|
50 |
// --------------------------------------------
|
|
51 |
|
|
52 |
/**
|
|
53 |
*
|
|
54 |
* Static constructor for CTestStepPlayerPosition.
|
|
55 |
*
|
|
56 |
*
|
|
57 |
* @return "CTestStepPlayerPosition*"
|
|
58 |
* The constructed CTestStepPlayerPosition
|
|
59 |
*
|
|
60 |
* @xxxx
|
|
61 |
*
|
|
62 |
*/
|
|
63 |
CTestStepPlayerPosition* CTestStepPlayerPosition::NewL()
|
|
64 |
{
|
|
65 |
CTestStepPlayerPosition* self = new(ELeave) CTestStepPlayerPosition;
|
|
66 |
return self;
|
|
67 |
}
|
|
68 |
|
|
69 |
/**
|
|
70 |
*
|
|
71 |
* Test step constructor.
|
|
72 |
* Each test step initialises its own name.
|
|
73 |
*
|
|
74 |
* @xxxx
|
|
75 |
*
|
|
76 |
*/
|
|
77 |
CTestStepPlayerPosition::CTestStepPlayerPosition() : iHasPlayed(EFalse)
|
|
78 |
{
|
|
79 |
iTestStepResult = EPass;
|
|
80 |
// store the name of this test case
|
|
81 |
// this is the name that is used by the script file
|
|
82 |
iTestStepName = _L("MM-MMF-ACLNT-U-0035-CP");
|
|
83 |
}
|
|
84 |
|
|
85 |
/**
|
|
86 |
*
|
|
87 |
* Test step destructor.
|
|
88 |
*
|
|
89 |
* @xxxx
|
|
90 |
*
|
|
91 |
*/
|
|
92 |
CTestStepPlayerPosition::~CTestStepPlayerPosition()
|
|
93 |
{
|
|
94 |
}
|
|
95 |
/**
|
|
96 |
* Implementation of the MMdaAudioPlayerCallback interface functions
|
|
97 |
**/
|
|
98 |
void CTestStepPlayerPosition::MapcInitComplete(TInt aError,
|
|
99 |
const TTimeIntervalMicroSeconds &/*aDuration*/)
|
|
100 |
{
|
|
101 |
iError = aError;
|
|
102 |
CActiveScheduler::Stop();
|
|
103 |
}
|
|
104 |
|
|
105 |
void CTestStepPlayerPosition::MapcPlayComplete(TInt aError)
|
|
106 |
{
|
|
107 |
iError = aError;
|
|
108 |
if (iError == KErrNone)
|
|
109 |
iHasPlayed = ETrue;
|
|
110 |
CActiveScheduler::Stop();
|
|
111 |
}
|
|
112 |
|
|
113 |
/**
|
|
114 |
*
|
|
115 |
* Test step Preamble.
|
|
116 |
*
|
|
117 |
* @xxxx
|
|
118 |
*
|
|
119 |
*/
|
|
120 |
enum TVerdict CTestStepPlayerPosition::DoTestStepPreambleL(void)
|
|
121 |
{
|
|
122 |
enum TVerdict verdict;
|
|
123 |
// this installs the scheduler
|
|
124 |
verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL();
|
|
125 |
|
|
126 |
// Printing to the console and log file
|
|
127 |
INFO_PRINTF1(_L("MM-MMF-ACLNT-U-0035-CP"));
|
|
128 |
INFO_PRINTF1(_L("this test is getting and setting the postion of a sound file after openning it, and playing it. GetPosition()"));
|
|
129 |
|
|
130 |
iError = KErrNone; //KErrTimedOut;
|
|
131 |
|
|
132 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioPlayFName1"), iFileName))
|
|
133 |
{
|
|
134 |
//INFO_PRINTF2(_L("file name %s not found..."), fileptr);
|
|
135 |
return EInconclusive;
|
|
136 |
}
|
|
137 |
|
|
138 |
iPlayer = CMMFMdaAudioPlayerUtility::NewFilePlayerL(iFileName, *this);
|
|
139 |
CActiveScheduler::Start();
|
|
140 |
User::After(1000000);
|
|
141 |
|
|
142 |
if (iPlayer == NULL ||
|
|
143 |
iError != KErrNone )
|
|
144 |
return EInconclusive;
|
|
145 |
|
|
146 |
//store Duration
|
|
147 |
iDuration = iPlayer->Duration();
|
|
148 |
if (iDuration <= TTimeIntervalMicroSeconds(0) )
|
|
149 |
return EInconclusive;
|
|
150 |
|
|
151 |
// check if player openned the file successfully
|
|
152 |
TInt err1 = KErrNone;
|
|
153 |
TInt state = 0;
|
|
154 |
err1 = GetAudPlayerState(iPlayer, state);
|
|
155 |
if ( err1 != KErrNone ||
|
|
156 |
state != CMMFMdaAudioPlayerUtility::EStopped )
|
|
157 |
return EInconclusive;
|
|
158 |
|
|
159 |
return verdict;
|
|
160 |
}
|
|
161 |
|
|
162 |
/**
|
|
163 |
*
|
|
164 |
* Test step Postamble.
|
|
165 |
*
|
|
166 |
* @xxxx
|
|
167 |
*
|
|
168 |
*/
|
|
169 |
enum TVerdict CTestStepPlayerPosition::DoTestStepPostambleL(void)
|
|
170 |
{
|
|
171 |
delete iPlayer;
|
|
172 |
iPlayer = NULL;
|
|
173 |
//[ Destroy the scheduler ]
|
|
174 |
delete iPlayer;
|
|
175 |
return CTestStepUnitMMFAudClient::DoTestStepPostambleL();
|
|
176 |
}
|
|
177 |
|
|
178 |
/**
|
|
179 |
*
|
|
180 |
* Do the test step.
|
|
181 |
* Each test step must supply an implementation for DoTestStepL.
|
|
182 |
*
|
|
183 |
* @return "TVerdict"
|
|
184 |
* The result of the test step
|
|
185 |
*
|
|
186 |
* @xxxx
|
|
187 |
*
|
|
188 |
*/
|
|
189 |
TVerdict CTestStepPlayerPosition::DoTestStepL()
|
|
190 |
{
|
|
191 |
iTestStepResult = EPass;
|
|
192 |
TInt err;
|
|
193 |
TTimeIntervalMicroSeconds pos;
|
|
194 |
//__MM_HEAP_MARK;
|
|
195 |
|
|
196 |
// check if position 0 before playing
|
|
197 |
err = iPlayer->GetPosition(pos);
|
|
198 |
if (err != KErrNone ||
|
|
199 |
pos != TTimeIntervalMicroSeconds(0))
|
|
200 |
return EFail;
|
|
201 |
|
|
202 |
// set position and check
|
|
203 |
iPlayer->SetPosition(TTimeIntervalMicroSeconds(500000));
|
|
204 |
err = iPlayer->GetPosition(pos);
|
|
205 |
if (err != KErrNone ||
|
|
206 |
pos != TTimeIntervalMicroSeconds(500000))
|
|
207 |
return EFail;
|
|
208 |
|
|
209 |
// set position and check
|
|
210 |
iPlayer->SetPosition(TTimeIntervalMicroSeconds(10000));
|
|
211 |
err = iPlayer->GetPosition(pos);
|
|
212 |
if (err != KErrNone ||
|
|
213 |
pos != TTimeIntervalMicroSeconds(10000))
|
|
214 |
return EFail;
|
|
215 |
|
|
216 |
// play pause and check
|
|
217 |
iPlayer->Play();
|
|
218 |
CActiveScheduler::Start();
|
|
219 |
|
|
220 |
|
|
221 |
//INC24264
|
|
222 |
err = iPlayer->GetPosition(pos);
|
|
223 |
if ((err == KErrNone) || (pos <= TTimeIntervalMicroSeconds(0)))
|
|
224 |
return iTestStepResult = EPass;
|
|
225 |
|
|
226 |
|
|
227 |
// stop it after 200 milisecs, not accurate though
|
|
228 |
/*User::After(200000);
|
|
229 |
iPlayer->Pause();
|
|
230 |
|
|
231 |
// check position again, we don't have an accurate opsition
|
|
232 |
err = iPlayer->GetPosition(pos);
|
|
233 |
if (err != KErrNone ||
|
|
234 |
pos <= TTimeIntervalMicroSeconds(0) ||
|
|
235 |
pos > iDuration )
|
|
236 |
return EFail;*/
|
|
237 |
|
|
238 |
delete iPlayer;
|
|
239 |
iPlayer = NULL;
|
|
240 |
//__MM_HEAP_MARKEND;
|
|
241 |
|
|
242 |
INFO_PRINTF1(_L("finished with this test step"));
|
|
243 |
// test steps return a result
|
|
244 |
return iTestStepResult;
|
|
245 |
}
|
|
246 |
|
|
247 |
//
|
|
248 |
// class CTestStepPlayerPlayWindow
|
|
249 |
// --------------------------------------------
|
|
250 |
//
|
|
251 |
/**
|
|
252 |
*
|
|
253 |
* Static constructor for CTestStepPlayerPlayWindow.
|
|
254 |
*
|
|
255 |
*
|
|
256 |
* @return "CTestStepPlayerPlayWindow*"
|
|
257 |
* The constructed CTestStepPlayerPlayWindow
|
|
258 |
*
|
|
259 |
* @xxxx
|
|
260 |
*
|
|
261 |
*/
|
|
262 |
CTestStepPlayerPlayWindow* CTestStepPlayerPlayWindow::NewL()
|
|
263 |
{
|
|
264 |
CTestStepPlayerPlayWindow* self = new(ELeave) CTestStepPlayerPlayWindow;
|
|
265 |
return self;
|
|
266 |
}
|
|
267 |
|
|
268 |
/**
|
|
269 |
*
|
|
270 |
* Test step constructor.
|
|
271 |
* Each test step initialises its own name.
|
|
272 |
*
|
|
273 |
* @xxxx
|
|
274 |
*
|
|
275 |
*/
|
|
276 |
CTestStepPlayerPlayWindow::CTestStepPlayerPlayWindow() : iHasPlayed(EFalse)
|
|
277 |
{
|
|
278 |
iTestStepResult = EPass;
|
|
279 |
// store the name of this test case
|
|
280 |
// this is the name that is used by the script file
|
|
281 |
iTestStepName = _L("MM-MMF-ACLNT-U-0050-CP");
|
|
282 |
}
|
|
283 |
|
|
284 |
/**
|
|
285 |
*
|
|
286 |
* Test step destructor.
|
|
287 |
*
|
|
288 |
* @xxxx
|
|
289 |
*
|
|
290 |
*/
|
|
291 |
CTestStepPlayerPlayWindow::~CTestStepPlayerPlayWindow()
|
|
292 |
{
|
|
293 |
}
|
|
294 |
/**
|
|
295 |
* Implementation of the MMdaAudioPlayerCallback interface functions
|
|
296 |
**/
|
|
297 |
void CTestStepPlayerPlayWindow::MapcInitComplete(TInt aError,
|
|
298 |
const TTimeIntervalMicroSeconds &/*aDuration*/)
|
|
299 |
{
|
|
300 |
iError = aError;
|
|
301 |
CActiveScheduler::Stop();
|
|
302 |
}
|
|
303 |
|
|
304 |
void CTestStepPlayerPlayWindow::MapcPlayComplete(TInt aError)
|
|
305 |
{
|
|
306 |
iError = aError;
|
|
307 |
if (iError == KErrNone)
|
|
308 |
iHasPlayed = ETrue;
|
|
309 |
CActiveScheduler::Stop();
|
|
310 |
}
|
|
311 |
|
|
312 |
/**
|
|
313 |
*
|
|
314 |
* Test step Preamble.
|
|
315 |
*
|
|
316 |
* @xxxx
|
|
317 |
*
|
|
318 |
*/
|
|
319 |
enum TVerdict CTestStepPlayerPlayWindow::DoTestStepPreambleL(void)
|
|
320 |
{
|
|
321 |
enum TVerdict verdict;
|
|
322 |
// this installs the scheduler
|
|
323 |
verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL();
|
|
324 |
|
|
325 |
// Printing to the console and log file
|
|
326 |
INFO_PRINTF1(_L("MM-MMF-ACLNT-U-0050-CP"));
|
|
327 |
INFO_PRINTF1(_L("this test is setting and clearing the Play Window of a sound file after openning it [Set|Clear]PlayWindow()"));
|
|
328 |
|
|
329 |
iError = KErrNone; //KErrTimedOut;
|
|
330 |
|
|
331 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioPlayFName1"), iFileName))
|
|
332 |
{
|
|
333 |
//INFO_PRINTF2(_L("file name %s not found..."), fileptr);
|
|
334 |
return EInconclusive;
|
|
335 |
}
|
|
336 |
|
|
337 |
iPlayer = CMMFMdaAudioPlayerUtility::NewFilePlayerL(iFileName, *this);
|
|
338 |
CActiveScheduler::Start();
|
|
339 |
User::After(1000000);
|
|
340 |
|
|
341 |
if (iPlayer == NULL ||
|
|
342 |
iError != KErrNone )
|
|
343 |
return EInconclusive;
|
|
344 |
|
|
345 |
//store Duration
|
|
346 |
iDuration = iPlayer->Duration();
|
|
347 |
if (iDuration <= TTimeIntervalMicroSeconds(0) )
|
|
348 |
return EInconclusive;
|
|
349 |
|
|
350 |
iBeginning = TTimeIntervalMicroSeconds( 0 );
|
|
351 |
iMiddle = TTimeIntervalMicroSeconds( iPlayer->Duration().Int64() / 2 );
|
|
352 |
iEnd = iPlayer->Duration();
|
|
353 |
|
|
354 |
// check if player openned the file successfully
|
|
355 |
TInt err1 = KErrNone;
|
|
356 |
TInt state = 0;
|
|
357 |
err1 = GetAudPlayerState(iPlayer, state);
|
|
358 |
if ( err1 != KErrNone ||
|
|
359 |
state != CMMFMdaAudioPlayerUtility::EStopped )
|
|
360 |
return EInconclusive;
|
|
361 |
|
|
362 |
return verdict;
|
|
363 |
}
|
|
364 |
|
|
365 |
/**
|
|
366 |
*
|
|
367 |
* Test step Postamble.
|
|
368 |
*
|
|
369 |
* @xxxx
|
|
370 |
*
|
|
371 |
*/
|
|
372 |
enum TVerdict CTestStepPlayerPlayWindow::DoTestStepPostambleL(void)
|
|
373 |
{
|
|
374 |
delete iPlayer;
|
|
375 |
iPlayer = NULL;
|
|
376 |
//[ Destroy the scheduler ]
|
|
377 |
return CTestStepUnitMMFAudClient::DoTestStepPostambleL();
|
|
378 |
}
|
|
379 |
|
|
380 |
/**
|
|
381 |
*
|
|
382 |
* Do the test step.
|
|
383 |
* Each test step must supply an implementation for DoTestStepL.
|
|
384 |
*
|
|
385 |
* @return "TVerdict"
|
|
386 |
* The result of the test step
|
|
387 |
*
|
|
388 |
* @xxxx
|
|
389 |
*
|
|
390 |
*/
|
|
391 |
TVerdict CTestStepPlayerPlayWindow::DoTestStepL()
|
|
392 |
{
|
|
393 |
TInt err;
|
|
394 |
//__MM_HEAP_MARK;
|
|
395 |
|
|
396 |
|
|
397 |
TRAP(err, iPlayer->SetPlayWindow(iBeginning, iMiddle) );
|
|
398 |
iPlayer->Play();
|
|
399 |
// Wait for a MapcPlayComplete() callback
|
|
400 |
// calling User::After(1200000) is no good because the active scheduler
|
|
401 |
// is not running so no RunL()'s can work
|
|
402 |
// i.e. nothing can come back from controller & the AudioPlayer utility's
|
|
403 |
// state will not get updated.
|
|
404 |
//User::After(1200000); // wrong
|
|
405 |
CActiveScheduler::Start();
|
|
406 |
if (err != KErrNone) // no way to check programmatically without access to the controller
|
|
407 |
//|| iPlayer->Duration() != TTimeIntervalMicroSeconds(iMiddle.Int64()-iBeginning.Int64()) )
|
|
408 |
return EInconclusive;
|
|
409 |
|
|
410 |
TRAP(err, iPlayer->ClearPlayWindow() );
|
|
411 |
if (err != KErrNone )
|
|
412 |
return EFail;
|
|
413 |
iPlayer->Play();
|
|
414 |
CActiveScheduler::Start();
|
|
415 |
|
|
416 |
if (iError!= KErrNone)
|
|
417 |
{
|
|
418 |
INFO_PRINTF2(_L("iPlayer->Play() failed, iError = %d"), iError);
|
|
419 |
return EFail;
|
|
420 |
}
|
|
421 |
|
|
422 |
delete iPlayer;
|
|
423 |
iPlayer = NULL;
|
|
424 |
//__MM_HEAP_MARKEND;
|
|
425 |
|
|
426 |
INFO_PRINTF1(_L("finished with this test step"));
|
|
427 |
// test steps return a result
|
|
428 |
return iTestStepResult;
|
|
429 |
}
|
|
430 |
|
|
431 |
//
|
|
432 |
// class CTestStepPlayerBalance
|
|
433 |
// --------------------------------------------
|
|
434 |
//
|
|
435 |
/**
|
|
436 |
*
|
|
437 |
* Static constructor for CTestStepPlayerBalance.
|
|
438 |
*
|
|
439 |
*
|
|
440 |
* @return "CTestStepPlayerBalance*"
|
|
441 |
* The constructed CTestStepPlayerBalance
|
|
442 |
*
|
|
443 |
* @xxxx
|
|
444 |
*
|
|
445 |
*/
|
|
446 |
CTestStepPlayerBalance* CTestStepPlayerBalance::NewL()
|
|
447 |
{
|
|
448 |
CTestStepPlayerBalance* self = new(ELeave) CTestStepPlayerBalance;
|
|
449 |
return self;
|
|
450 |
}
|
|
451 |
|
|
452 |
/**
|
|
453 |
*
|
|
454 |
* Test step constructor.
|
|
455 |
* Each test step initialises its own name.
|
|
456 |
*
|
|
457 |
* @xxxx
|
|
458 |
*
|
|
459 |
*/
|
|
460 |
CTestStepPlayerBalance::CTestStepPlayerBalance()
|
|
461 |
{
|
|
462 |
iTestStepResult = EPass;
|
|
463 |
// store the name of this test case
|
|
464 |
// this is the name that is used by the script file
|
|
465 |
iTestStepName = _L("MM-MMF-ACLNT-U-0052-HP");
|
|
466 |
}
|
|
467 |
|
|
468 |
/**
|
|
469 |
*
|
|
470 |
* Test step destructor.
|
|
471 |
*
|
|
472 |
* @xxxx
|
|
473 |
*
|
|
474 |
*/
|
|
475 |
CTestStepPlayerBalance::~CTestStepPlayerBalance()
|
|
476 |
{
|
|
477 |
}
|
|
478 |
/**
|
|
479 |
* Implementation of the MMdaAudioPlayerCallback interface functions
|
|
480 |
**/
|
|
481 |
void CTestStepPlayerBalance::MapcInitComplete(TInt aError,
|
|
482 |
const TTimeIntervalMicroSeconds &/*aDuration*/)
|
|
483 |
{
|
|
484 |
iError = aError;
|
|
485 |
CActiveScheduler::Stop();
|
|
486 |
}
|
|
487 |
|
|
488 |
void CTestStepPlayerBalance::MapcPlayComplete(TInt aError)
|
|
489 |
{
|
|
490 |
iError = aError;
|
|
491 |
CActiveScheduler::Stop();
|
|
492 |
}
|
|
493 |
|
|
494 |
/**
|
|
495 |
*
|
|
496 |
* Test step Preamble.
|
|
497 |
*
|
|
498 |
* @xxxx
|
|
499 |
*
|
|
500 |
*/
|
|
501 |
enum TVerdict CTestStepPlayerBalance::DoTestStepPreambleL(void)
|
|
502 |
{
|
|
503 |
enum TVerdict verdict;
|
|
504 |
// this installs the scheduler
|
|
505 |
verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL();
|
|
506 |
|
|
507 |
// Printing to the console and log file
|
|
508 |
INFO_PRINTF1(_L("MM-MMF-ACLNT-U-0052-HP"));
|
|
509 |
INFO_PRINTF1(_L("this test is setting and getting the balance of a sound: [Set|Get]Balance()"));
|
|
510 |
|
|
511 |
iError = KErrNone; //KErrTimedOut;
|
|
512 |
|
|
513 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioPlayFName1"), iFileName))
|
|
514 |
{
|
|
515 |
//INFO_PRINTF2(_L("file name %s not found..."), fileptr);
|
|
516 |
return EInconclusive;
|
|
517 |
}
|
|
518 |
|
|
519 |
iPlayer = CMMFMdaAudioPlayerUtility::NewFilePlayerL(iFileName, *this);
|
|
520 |
CActiveScheduler::Start();
|
|
521 |
User::After(1000000);
|
|
522 |
|
|
523 |
if (iPlayer == NULL ||
|
|
524 |
iError != KErrNone )
|
|
525 |
return EInconclusive;
|
|
526 |
|
|
527 |
//store Duration
|
|
528 |
iDuration = iPlayer->Duration();
|
|
529 |
if (iDuration <= TTimeIntervalMicroSeconds(0) )
|
|
530 |
return EInconclusive;
|
|
531 |
|
|
532 |
|
|
533 |
return verdict;
|
|
534 |
}
|
|
535 |
|
|
536 |
/**
|
|
537 |
*
|
|
538 |
* Test step Postamble.
|
|
539 |
*
|
|
540 |
* @xxxx
|
|
541 |
*
|
|
542 |
*/
|
|
543 |
enum TVerdict CTestStepPlayerBalance::DoTestStepPostambleL(void)
|
|
544 |
{
|
|
545 |
delete iPlayer;
|
|
546 |
iPlayer = NULL;
|
|
547 |
//[ Destroy the scheduler ]
|
|
548 |
return CTestStepUnitMMFAudClient::DoTestStepPostambleL();
|
|
549 |
}
|
|
550 |
|
|
551 |
/**
|
|
552 |
*
|
|
553 |
* Do the test step.
|
|
554 |
* Each test step must supply an implementation for DoTestStepL.
|
|
555 |
*
|
|
556 |
* @return "TVerdict"
|
|
557 |
* The result of the test step
|
|
558 |
*
|
|
559 |
* @xxxx
|
|
560 |
*
|
|
561 |
*/
|
|
562 |
TVerdict CTestStepPlayerBalance::DoTestStepL()
|
|
563 |
{
|
|
564 |
TInt err;
|
|
565 |
TInt balance = 0; // KMMFBalanceCenter
|
|
566 |
|
|
567 |
// test 1
|
|
568 |
err = iPlayer->SetBalance(); // default KMMFBalanceCenter = 0
|
|
569 |
if (err != KErrNone) // we expect this to return KErrNone in Typhoon
|
|
570 |
return EFail;
|
|
571 |
|
|
572 |
err = iPlayer->GetBalance(balance);
|
|
573 |
if (err != KErrNone ||
|
|
574 |
balance != 0)
|
|
575 |
return EFail;
|
|
576 |
|
|
577 |
|
|
578 |
// test 2
|
|
579 |
err = iPlayer->SetBalance(KMMFBalanceMaxLeft); // -100
|
|
580 |
if (err != KErrNone)
|
|
581 |
return EFail;
|
|
582 |
|
|
583 |
err = iPlayer->GetBalance(balance);
|
|
584 |
if (err != KErrNone ||
|
|
585 |
balance != KMMFBalanceMaxLeft)
|
|
586 |
return EFail;
|
|
587 |
|
|
588 |
// test 3
|
|
589 |
err = iPlayer->SetBalance(KMMFBalanceMaxRight);
|
|
590 |
if (err != KErrNone)
|
|
591 |
return EFail;
|
|
592 |
|
|
593 |
err = iPlayer->GetBalance(balance);
|
|
594 |
if (err != KErrNone ||
|
|
595 |
balance != KMMFBalanceMaxRight)
|
|
596 |
return EFail;
|
|
597 |
|
|
598 |
// test 4
|
|
599 |
err = iPlayer->SetBalance(KMMFBalanceMaxRight/2);
|
|
600 |
if (err != KErrNone)
|
|
601 |
return EFail;
|
|
602 |
|
|
603 |
err = iPlayer->GetBalance(balance);
|
|
604 |
if (err != KErrNone ||
|
|
605 |
balance != KMMFBalanceMaxRight/2)
|
|
606 |
return EFail;
|
|
607 |
|
|
608 |
|
|
609 |
// test 4 out of bounds
|
|
610 |
/* until we check the return codes...
|
|
611 |
TRAP(err, iPlayer->SetBalance(KMMFBalanceMaxRight+5));
|
|
612 |
if (err != KErrArgument ||
|
|
613 |
err != KErrTooBig )
|
|
614 |
return EFail;
|
|
615 |
*/
|
|
616 |
|
|
617 |
INFO_PRINTF1(_L("finished with this test step"));
|
|
618 |
// test steps return a result
|
|
619 |
return iTestStepResult; }
|
|
620 |
|
|
621 |
//
|
|
622 |
// class CTestStepPlayerClose
|
|
623 |
// --------------------------------------------
|
|
624 |
//
|
|
625 |
/**
|
|
626 |
*
|
|
627 |
* Static constructor for CTestStepPlayerClose.
|
|
628 |
*
|
|
629 |
*
|
|
630 |
* @return "CTestStepPlayerClose*"
|
|
631 |
* The constructed CTestStepPlayerClose
|
|
632 |
*
|
|
633 |
* @xxxx
|
|
634 |
*
|
|
635 |
*/
|
|
636 |
CTestStepPlayerClose* CTestStepPlayerClose::NewL()
|
|
637 |
{
|
|
638 |
CTestStepPlayerClose* self = new(ELeave) CTestStepPlayerClose;
|
|
639 |
return self;
|
|
640 |
}
|
|
641 |
|
|
642 |
/**
|
|
643 |
*
|
|
644 |
* Test step constructor.
|
|
645 |
* Each test step initialises its own name.
|
|
646 |
*
|
|
647 |
* @xxxx
|
|
648 |
*
|
|
649 |
*/
|
|
650 |
CTestStepPlayerClose::CTestStepPlayerClose()
|
|
651 |
{
|
|
652 |
iTestStepResult = EPass;
|
|
653 |
// store the name of this test case
|
|
654 |
// this is the name that is used by the script file
|
|
655 |
iTestStepName = _L("MM-MMF-ACLNT-U-0044-CP");
|
|
656 |
}
|
|
657 |
|
|
658 |
/**
|
|
659 |
*
|
|
660 |
* Test step destructor.
|
|
661 |
*
|
|
662 |
* @xxxx
|
|
663 |
*
|
|
664 |
*/
|
|
665 |
CTestStepPlayerClose::~CTestStepPlayerClose()
|
|
666 |
{
|
|
667 |
}
|
|
668 |
/**
|
|
669 |
* Implementation of the MMdaAudioPlayerCallback interface functions
|
|
670 |
**/
|
|
671 |
void CTestStepPlayerClose::MapcInitComplete(TInt aError,
|
|
672 |
const TTimeIntervalMicroSeconds &/*aDuration*/)
|
|
673 |
{
|
|
674 |
iError = aError;
|
|
675 |
CActiveScheduler::Stop();
|
|
676 |
}
|
|
677 |
|
|
678 |
void CTestStepPlayerClose::MapcPlayComplete(TInt aError)
|
|
679 |
{
|
|
680 |
iError = aError;
|
|
681 |
CActiveScheduler::Stop();
|
|
682 |
}
|
|
683 |
|
|
684 |
/**
|
|
685 |
*
|
|
686 |
* Test step Preamble.
|
|
687 |
*
|
|
688 |
* @xxxx
|
|
689 |
*
|
|
690 |
*/
|
|
691 |
enum TVerdict CTestStepPlayerClose::DoTestStepPreambleL(void)
|
|
692 |
{
|
|
693 |
enum TVerdict verdict;
|
|
694 |
// this installs the scheduler
|
|
695 |
verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL();
|
|
696 |
|
|
697 |
// Printing to the console and log file
|
|
698 |
INFO_PRINTF1(_L("MM-MMF-ACLNT-U-0044-CP"));
|
|
699 |
INFO_PRINTF1(_L("this test is closing an open sound: Close()"));
|
|
700 |
|
|
701 |
iError = KErrNone; //KErrTimedOut;
|
|
702 |
|
|
703 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioPlayFName1"), iFileName))
|
|
704 |
{
|
|
705 |
//INFO_PRINTF2(_L("file name %s not found..."), fileptr);
|
|
706 |
return EInconclusive;
|
|
707 |
}
|
|
708 |
|
|
709 |
iPlayer = CMMFMdaAudioPlayerUtility::NewFilePlayerL(iFileName, *this);
|
|
710 |
CActiveScheduler::Start();
|
|
711 |
User::After(1000000);
|
|
712 |
|
|
713 |
if (iPlayer == NULL ||
|
|
714 |
iError != KErrNone )
|
|
715 |
return EInconclusive;
|
|
716 |
|
|
717 |
//store Duration
|
|
718 |
iDuration = iPlayer->Duration();
|
|
719 |
if (iDuration <= TTimeIntervalMicroSeconds(0) )
|
|
720 |
return EInconclusive;
|
|
721 |
|
|
722 |
|
|
723 |
return verdict;
|
|
724 |
}
|
|
725 |
|
|
726 |
/**
|
|
727 |
*
|
|
728 |
* Test step Postamble.
|
|
729 |
*
|
|
730 |
* @xxxx
|
|
731 |
*
|
|
732 |
*/
|
|
733 |
enum TVerdict CTestStepPlayerClose::DoTestStepPostambleL(void)
|
|
734 |
{
|
|
735 |
delete iPlayer;
|
|
736 |
iPlayer = NULL;
|
|
737 |
//User::After(1000000);
|
|
738 |
//[ Destroy the scheduler ]
|
|
739 |
return CTestStepUnitMMFAudClient::DoTestStepPostambleL();
|
|
740 |
}
|
|
741 |
|
|
742 |
/**
|
|
743 |
*
|
|
744 |
* Do the test step.
|
|
745 |
* Each test step must supply an implementation for DoTestStepL.
|
|
746 |
*
|
|
747 |
* @return "TVerdict"
|
|
748 |
* The result of the test step
|
|
749 |
*
|
|
750 |
* @xxxx
|
|
751 |
*
|
|
752 |
*/
|
|
753 |
TVerdict CTestStepPlayerClose::DoTestStepL()
|
|
754 |
{
|
|
755 |
TInt err;
|
|
756 |
|
|
757 |
// test 1
|
|
758 |
TRAP(err, iPlayer->Close());
|
|
759 |
if (iPlayer == NULL || // better check condition?
|
|
760 |
err != KErrNone)
|
|
761 |
return EFail;
|
|
762 |
|
|
763 |
// re-open file
|
|
764 |
iPlayer->OpenFileL(iFileName);
|
|
765 |
CActiveScheduler::Start();
|
|
766 |
User::After(1000000);
|
|
767 |
// check
|
|
768 |
if (iPlayer == NULL ||
|
|
769 |
iError != KErrNone )
|
|
770 |
return EInconclusive;
|
|
771 |
|
|
772 |
// test 2
|
|
773 |
//TRAP(err, iPlayer->Close());
|
|
774 |
if (iPlayer == NULL || // better check condition?
|
|
775 |
err != KErrNone)
|
|
776 |
return EFail;
|
|
777 |
|
|
778 |
|
|
779 |
INFO_PRINTF1(_L("finished with this test step"));
|
|
780 |
// test steps return a result
|
|
781 |
return iTestStepResult;
|
|
782 |
|
|
783 |
}
|
|
784 |
|
|
785 |
//
|
|
786 |
// class CTestStepPlayerMeta
|
|
787 |
// --------------------------------------------
|
|
788 |
//
|
|
789 |
/**
|
|
790 |
*
|
|
791 |
* Static constructor for CTestStepPlayerMeta.
|
|
792 |
*
|
|
793 |
*
|
|
794 |
* @return "CTestStepPlayerMeta*"
|
|
795 |
* The constructed CTestStepPlayerMeta
|
|
796 |
*
|
|
797 |
* @xxxx
|
|
798 |
*
|
|
799 |
*/
|
|
800 |
CTestStepPlayerMeta* CTestStepPlayerMeta::NewL()
|
|
801 |
{
|
|
802 |
CTestStepPlayerMeta* self = new(ELeave) CTestStepPlayerMeta;
|
|
803 |
return self;
|
|
804 |
}
|
|
805 |
|
|
806 |
/**
|
|
807 |
*
|
|
808 |
* Test step constructor.
|
|
809 |
* Each test step initialises its own name.
|
|
810 |
*
|
|
811 |
* @xxxx
|
|
812 |
*
|
|
813 |
*/
|
|
814 |
CTestStepPlayerMeta::CTestStepPlayerMeta()
|
|
815 |
{
|
|
816 |
iTestStepResult = EPass;
|
|
817 |
// store the name of this test case
|
|
818 |
// this is the name that is used by the script file
|
|
819 |
iTestStepName = _L("MM-MMF-ACLNT-U-0045-HP");
|
|
820 |
}
|
|
821 |
|
|
822 |
/**
|
|
823 |
*
|
|
824 |
* Test step destructor.
|
|
825 |
*
|
|
826 |
* @xxxx
|
|
827 |
*
|
|
828 |
*/
|
|
829 |
CTestStepPlayerMeta::~CTestStepPlayerMeta()
|
|
830 |
{
|
|
831 |
}
|
|
832 |
/**
|
|
833 |
* Implementation of the MMdaAudioPlayerCallback interface functions
|
|
834 |
**/
|
|
835 |
void CTestStepPlayerMeta::MapcInitComplete(TInt aError,
|
|
836 |
const TTimeIntervalMicroSeconds &/*aDuration*/)
|
|
837 |
{
|
|
838 |
iError = aError;
|
|
839 |
CActiveScheduler::Stop();
|
|
840 |
}
|
|
841 |
|
|
842 |
void CTestStepPlayerMeta::MapcPlayComplete(TInt aError)
|
|
843 |
{
|
|
844 |
iError = aError;
|
|
845 |
CActiveScheduler::Stop();
|
|
846 |
}
|
|
847 |
|
|
848 |
/**
|
|
849 |
*
|
|
850 |
* Test step Preamble.
|
|
851 |
*
|
|
852 |
* @xxxx
|
|
853 |
*
|
|
854 |
*/
|
|
855 |
enum TVerdict CTestStepPlayerMeta::DoTestStepPreambleL(void)
|
|
856 |
{
|
|
857 |
enum TVerdict verdict;
|
|
858 |
// this installs the scheduler
|
|
859 |
verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL();
|
|
860 |
|
|
861 |
// Printing to the console and log file
|
|
862 |
INFO_PRINTF1(_L("MM-MMF-ACLNT-U-0045-HP"));
|
|
863 |
INFO_PRINTF1(_L("this test is about metadata manipulation"));
|
|
864 |
|
|
865 |
iError = KErrNone; //KErrTimedOut;
|
|
866 |
|
|
867 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioFNameMeta"), iFileName))
|
|
868 |
{
|
|
869 |
//INFO_PRINTF2(_L("file name %s not found..."), fileptr);
|
|
870 |
return EInconclusive;
|
|
871 |
}
|
|
872 |
|
|
873 |
iPlayer = CMMFMdaAudioPlayerUtility::NewFilePlayerL(iFileName, *this);
|
|
874 |
CActiveScheduler::Start();
|
|
875 |
User::After(1000000);
|
|
876 |
|
|
877 |
if (iPlayer == NULL ||
|
|
878 |
iError != KErrNone )
|
|
879 |
return EInconclusive;
|
|
880 |
|
|
881 |
return verdict;
|
|
882 |
}
|
|
883 |
|
|
884 |
/**
|
|
885 |
*
|
|
886 |
* Test step Postamble.
|
|
887 |
*
|
|
888 |
* @xxxx
|
|
889 |
*
|
|
890 |
*/
|
|
891 |
enum TVerdict CTestStepPlayerMeta::DoTestStepPostambleL(void)
|
|
892 |
{
|
|
893 |
delete iPlayer;
|
|
894 |
iPlayer = NULL;
|
|
895 |
//[ Destroy the scheduler ]
|
|
896 |
return CTestStepUnitMMFAudClient::DoTestStepPostambleL();
|
|
897 |
}
|
|
898 |
|
|
899 |
/**
|
|
900 |
*
|
|
901 |
* Do the test step.
|
|
902 |
* Each test step must supply an implementation for DoTestStepL.
|
|
903 |
*
|
|
904 |
* @return "TVerdict"
|
|
905 |
* The result of the test step
|
|
906 |
*
|
|
907 |
* @xxxx
|
|
908 |
*
|
|
909 |
*/
|
|
910 |
TVerdict CTestStepPlayerMeta::DoTestStepL()
|
|
911 |
{
|
|
912 |
iTestStepResult = EPass;
|
|
913 |
TInt err, num;
|
|
914 |
|
|
915 |
err = iPlayer->GetNumberOfMetaDataEntries(iNum);
|
|
916 |
|
|
917 |
#ifdef _TYPHOON_TEST_
|
|
918 |
if (err != KErrNotSupported)
|
|
919 |
return EFail;
|
|
920 |
#endif
|
|
921 |
|
|
922 |
#ifndef _TYPHOON_TEST_
|
|
923 |
if (err != KErrNone || iNum == 0 )
|
|
924 |
return EFail; // check a known number of meta data
|
|
925 |
#endif
|
|
926 |
|
|
927 |
_LIT(KMetaName, "To be changed N");
|
|
928 |
_LIT(KMetaValue, "To be changed V");
|
|
929 |
CMMFMetaDataEntry* meta = CMMFMetaDataEntry::NewL(KMetaName, KMetaValue);
|
|
930 |
CleanupStack::PushL(meta);
|
|
931 |
|
|
932 |
for (num = 0; num <iNum; num++)
|
|
933 |
{
|
|
934 |
TRAP(err, meta = iPlayer->GetMetaDataEntryL(num) ); // check if they count from 0
|
|
935 |
#ifdef _TYPHOON_TEST_
|
|
936 |
if (err != KErrNotSupported)
|
|
937 |
return EFail;
|
|
938 |
#endif
|
|
939 |
|
|
940 |
#ifndef _TYPHOON_TEST_
|
|
941 |
if (err != KErrNone ||
|
|
942 |
meta->Name() == KMetaName ||
|
|
943 |
meta->Value() == KMetaValue )
|
|
944 |
return EFail;
|
|
945 |
#endif
|
|
946 |
}
|
|
947 |
|
|
948 |
CleanupStack::PopAndDestroy(meta);
|
|
949 |
|
|
950 |
|
|
951 |
INFO_PRINTF1(_L("finished with this test step"));
|
|
952 |
// test steps return a result
|
|
953 |
return iTestStepResult;
|
|
954 |
|
|
955 |
}
|
|
956 |
|
|
957 |
//
|
|
958 |
// class CTestStepPlayerPriority
|
|
959 |
// --------------------------------------------
|
|
960 |
//
|
|
961 |
/**
|
|
962 |
*
|
|
963 |
* Static constructor for CTestStepPlayerPriority.
|
|
964 |
*
|
|
965 |
*
|
|
966 |
* @return "CTestStepPlayerPriority*"
|
|
967 |
* The constructed CTestStepPlayerPriority
|
|
968 |
*
|
|
969 |
* @xxxx
|
|
970 |
*
|
|
971 |
*/
|
|
972 |
CTestStepPlayerPriority* CTestStepPlayerPriority::NewL()
|
|
973 |
{
|
|
974 |
CTestStepPlayerPriority* self = new(ELeave) CTestStepPlayerPriority;
|
|
975 |
return self;
|
|
976 |
}
|
|
977 |
|
|
978 |
/**
|
|
979 |
*
|
|
980 |
* Test step constructor.
|
|
981 |
* Each test step initialises its own name.
|
|
982 |
*
|
|
983 |
* @xxxx
|
|
984 |
*
|
|
985 |
*/
|
|
986 |
CTestStepPlayerPriority::CTestStepPlayerPriority()
|
|
987 |
{
|
|
988 |
iTestStepResult = EPass;
|
|
989 |
// store the name of this test case
|
|
990 |
// this is the name that is used by the script file
|
|
991 |
iTestStepName = _L("MM-MMF-ACLNT-U-0053-HP");
|
|
992 |
}
|
|
993 |
|
|
994 |
/**
|
|
995 |
*
|
|
996 |
* Test step destructor.
|
|
997 |
*
|
|
998 |
* @xxxx
|
|
999 |
*
|
|
1000 |
*/
|
|
1001 |
CTestStepPlayerPriority::~CTestStepPlayerPriority()
|
|
1002 |
{
|
|
1003 |
}
|
|
1004 |
/**
|
|
1005 |
* Implementation of the MMdaAudioPlayerCallback interface functions
|
|
1006 |
**/
|
|
1007 |
void CTestStepPlayerPriority::MapcInitComplete(TInt aError,
|
|
1008 |
const TTimeIntervalMicroSeconds &/*aDuration*/)
|
|
1009 |
{
|
|
1010 |
iError = aError;
|
|
1011 |
CActiveScheduler::Stop();
|
|
1012 |
}
|
|
1013 |
|
|
1014 |
void CTestStepPlayerPriority::MapcPlayComplete(TInt aError)
|
|
1015 |
{
|
|
1016 |
iError = aError;
|
|
1017 |
CActiveScheduler::Stop();
|
|
1018 |
}
|
|
1019 |
|
|
1020 |
/**
|
|
1021 |
*
|
|
1022 |
* Test step Preamble.
|
|
1023 |
*
|
|
1024 |
* @xxxx
|
|
1025 |
*
|
|
1026 |
*/
|
|
1027 |
enum TVerdict CTestStepPlayerPriority::DoTestStepPreambleL(void)
|
|
1028 |
{
|
|
1029 |
enum TVerdict verdict;
|
|
1030 |
// this installs the scheduler
|
|
1031 |
verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL();
|
|
1032 |
|
|
1033 |
// Printing to the console and log file
|
|
1034 |
INFO_PRINTF1(_L("MM-MMF-ACLNT-U-0053-HP"));
|
|
1035 |
INFO_PRINTF1(_L("this test is about the priority of the audio player"));
|
|
1036 |
|
|
1037 |
iError = KErrNone; //KErrTimedOut;
|
|
1038 |
|
|
1039 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioFNameMeta"), iFileName))
|
|
1040 |
{
|
|
1041 |
//INFO_PRINTF2(_L("file name %s not found..."), fileptr);
|
|
1042 |
return EInconclusive;
|
|
1043 |
}
|
|
1044 |
|
|
1045 |
iPlayer = CMMFMdaAudioPlayerUtility::NewFilePlayerL(iFileName, *this);
|
|
1046 |
CActiveScheduler::Start();
|
|
1047 |
User::After(1000000);
|
|
1048 |
|
|
1049 |
if (iPlayer == NULL ||
|
|
1050 |
iError != KErrNone )
|
|
1051 |
return EInconclusive;
|
|
1052 |
|
|
1053 |
return verdict;
|
|
1054 |
}
|
|
1055 |
|
|
1056 |
/**
|
|
1057 |
*
|
|
1058 |
* Test step Postamble.
|
|
1059 |
*
|
|
1060 |
* @xxxx
|
|
1061 |
*
|
|
1062 |
*/
|
|
1063 |
enum TVerdict CTestStepPlayerPriority::DoTestStepPostambleL(void)
|
|
1064 |
{
|
|
1065 |
delete iPlayer;
|
|
1066 |
iPlayer = NULL;
|
|
1067 |
//[ Destroy the scheduler ]
|
|
1068 |
return CTestStepUnitMMFAudClient::DoTestStepPostambleL();
|
|
1069 |
}
|
|
1070 |
|
|
1071 |
/**
|
|
1072 |
*
|
|
1073 |
* Do the test step.
|
|
1074 |
* Each test step must supply an implementation for DoTestStepL.
|
|
1075 |
*
|
|
1076 |
* @return "TVerdict"
|
|
1077 |
* The result of the test step
|
|
1078 |
*
|
|
1079 |
* @xxxx
|
|
1080 |
*
|
|
1081 |
*/
|
|
1082 |
TVerdict CTestStepPlayerPriority::DoTestStepL()
|
|
1083 |
{
|
|
1084 |
iTestStepResult = EPass;
|
|
1085 |
TInt err = KErrNone;
|
|
1086 |
|
|
1087 |
iPlayer->SetPriority(EMdaPriorityNormal, EMdaPriorityPreferenceQuality);
|
|
1088 |
|
|
1089 |
TMMFPrioritySettings priorSets;
|
|
1090 |
err = GetAudPlayerPriority(iPlayer, priorSets);
|
|
1091 |
if (err != KErrNone ||
|
|
1092 |
priorSets.iPriority != EMdaPriorityNormal ||
|
|
1093 |
priorSets.iPref != EMdaPriorityPreferenceQuality)
|
|
1094 |
return EFail;
|
|
1095 |
|
|
1096 |
iPlayer->SetPriority(EMdaPriorityNormal, EMdaPriorityPreferenceTime);
|
|
1097 |
err = GetAudPlayerPriority(iPlayer, priorSets);
|
|
1098 |
if (err != KErrNone ||
|
|
1099 |
priorSets.iPriority != EMdaPriorityNormal ||
|
|
1100 |
priorSets.iPref != EMdaPriorityPreferenceTime)
|
|
1101 |
return EFail;
|
|
1102 |
|
|
1103 |
iPlayer->SetPriority(EMdaPriorityMin, EMdaPriorityPreferenceTimeAndQuality);
|
|
1104 |
err = GetAudPlayerPriority(iPlayer, priorSets);
|
|
1105 |
if (err != KErrNone ||
|
|
1106 |
priorSets.iPriority != EMdaPriorityMin ||
|
|
1107 |
priorSets.iPref != EMdaPriorityPreferenceTimeAndQuality)
|
|
1108 |
return EFail;
|
|
1109 |
|
|
1110 |
iPlayer->SetPriority(EMdaPriorityMin, EMdaPriorityPreferenceTimeAndQuality);
|
|
1111 |
err = GetAudPlayerPriority(iPlayer, priorSets);
|
|
1112 |
if (err != KErrNone ||
|
|
1113 |
priorSets.iPriority != EMdaPriorityMin ||
|
|
1114 |
priorSets.iPref != EMdaPriorityPreferenceTimeAndQuality)
|
|
1115 |
return EFail;
|
|
1116 |
|
|
1117 |
iPlayer->SetPriority(EMdaPriorityMax, EMdaPriorityPreferenceTimeAndQuality);
|
|
1118 |
err = GetAudPlayerPriority(iPlayer, priorSets);
|
|
1119 |
if (err != KErrNone ||
|
|
1120 |
priorSets.iPriority != EMdaPriorityMax ||
|
|
1121 |
priorSets.iPref != EMdaPriorityPreferenceTimeAndQuality)
|
|
1122 |
return EFail;
|
|
1123 |
|
|
1124 |
iPlayer->SetPriority(EMdaPriorityMax, EMdaPriorityPreferenceTimeAndQuality);
|
|
1125 |
err = GetAudPlayerPriority(iPlayer, priorSets);
|
|
1126 |
if (err != KErrNone ||
|
|
1127 |
priorSets.iPriority != EMdaPriorityMax ||
|
|
1128 |
priorSets.iPref != EMdaPriorityPreferenceTimeAndQuality)
|
|
1129 |
return EFail;
|
|
1130 |
|
|
1131 |
|
|
1132 |
INFO_PRINTF1(_L("finished with this test step"));
|
|
1133 |
// test steps return a result
|
|
1134 |
return iTestStepResult;
|
|
1135 |
|
|
1136 |
}
|
|
1137 |
|
|
1138 |
// CTestStepPlayerPauseSetPosPlay
|
|
1139 |
CTestStepPlayerPauseSetPosPlay* CTestStepPlayerPauseSetPosPlay::NewL()
|
|
1140 |
{
|
|
1141 |
CTestStepPlayerPauseSetPosPlay* self = new(ELeave) CTestStepPlayerPauseSetPosPlay();
|
|
1142 |
return self;
|
|
1143 |
}
|
|
1144 |
|
|
1145 |
CTestStepPlayerPauseSetPosPlay::CTestStepPlayerPauseSetPosPlay()
|
|
1146 |
{
|
|
1147 |
iTestStepName = _L("MM-MMF-ACLNT-U-0054-HP");
|
|
1148 |
}
|
|
1149 |
|
|
1150 |
CTestStepPlayerPauseSetPosPlay::~CTestStepPlayerPauseSetPosPlay()
|
|
1151 |
{
|
|
1152 |
}
|
|
1153 |
|
|
1154 |
void CTestStepPlayerPauseSetPosPlay::Close()
|
|
1155 |
{
|
|
1156 |
delete iPlayer;
|
|
1157 |
}
|
|
1158 |
|
|
1159 |
TVerdict CTestStepPlayerPauseSetPosPlay::DoTestStepL()
|
|
1160 |
{
|
|
1161 |
INFO_PRINTF1(_L("MM-MMF-ACLNT-U-0054-HP"));
|
|
1162 |
INFO_PRINTF1(_L("This test is playing, then pausing, setting the position and playing again."));
|
|
1163 |
INFO_PRINTF1(_L("Audio should start playing immediately from the second position after the pause."));
|
|
1164 |
|
|
1165 |
TPtrC filename;
|
|
1166 |
if (!GetStringFromConfig(_L("SectionOne"), _L("AudioPlayFName2"), filename))
|
|
1167 |
{
|
|
1168 |
INFO_PRINTF1(_L("Audio test filename not found in INI file"));
|
|
1169 |
return EInconclusive;
|
|
1170 |
}
|
|
1171 |
|
|
1172 |
iPlayer = CMMFMdaAudioPlayerUtility::NewFilePlayerL(filename, *this);
|
|
1173 |
CActiveScheduler::Start();
|
|
1174 |
|
|
1175 |
if (iError != KErrNone)
|
|
1176 |
{
|
|
1177 |
INFO_PRINTF2(_L("Error creating file player %d"), iError);
|
|
1178 |
return EInconclusive;
|
|
1179 |
}
|
|
1180 |
|
|
1181 |
// Start playing...
|
|
1182 |
iPlayer->Play();
|
|
1183 |
User::After(1000000);
|
|
1184 |
|
|
1185 |
// Pause after 2 secs
|
|
1186 |
iPlayer->Pause();
|
|
1187 |
User::After(2000000);
|
|
1188 |
|
|
1189 |
// Set new position
|
|
1190 |
TTimeIntervalMicroSeconds newPos(4000000);
|
|
1191 |
iPlayer->SetPosition(newPos);
|
|
1192 |
|
|
1193 |
// Play to the end
|
|
1194 |
iPlayer->Play();
|
|
1195 |
CActiveScheduler::Start();
|
|
1196 |
|
|
1197 |
if (iError != KErrNone)
|
|
1198 |
{
|
|
1199 |
INFO_PRINTF2(_L("Error playing back sound %d"), iError);
|
|
1200 |
return EFail;
|
|
1201 |
}
|
|
1202 |
|
|
1203 |
return EPass;
|
|
1204 |
}
|
|
1205 |
|
|
1206 |
// from MMdaAudioPlayerCallback
|
|
1207 |
void CTestStepPlayerPauseSetPosPlay::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/)
|
|
1208 |
{
|
|
1209 |
iError = aError;
|
|
1210 |
CActiveScheduler::Stop();
|
|
1211 |
}
|
|
1212 |
|
|
1213 |
void CTestStepPlayerPauseSetPosPlay::MapcPlayComplete(TInt aError)
|
|
1214 |
{
|
|
1215 |
iError = aError;
|
|
1216 |
CActiveScheduler::Stop();
|
|
1217 |
}
|
|
1218 |
|
|
1219 |
|
|
1220 |
//
|
|
1221 |
// CTestStepPlayerPlayWaitSetPos
|
|
1222 |
//
|
|
1223 |
|
|
1224 |
CTestStepPlayerPlayWaitSetPos* CTestStepPlayerPlayWaitSetPos::NewL()
|
|
1225 |
{
|
|
1226 |
return new (ELeave) CTestStepPlayerPlayWaitSetPos();
|
|
1227 |
}
|
|
1228 |
|
|
1229 |
CTestStepPlayerPlayWaitSetPos::CTestStepPlayerPlayWaitSetPos()
|
|
1230 |
{
|
|
1231 |
iTestStepName = _L("MM-MMF-ACLNT-U-0989-CP");
|
|
1232 |
}
|
|
1233 |
|
|
1234 |
CTestStepPlayerPlayWaitSetPos::~CTestStepPlayerPlayWaitSetPos()
|
|
1235 |
{
|
|
1236 |
delete iPlayer;
|
|
1237 |
delete iSetPositionCountDown;
|
|
1238 |
}
|
|
1239 |
|
|
1240 |
|
|
1241 |
/*
|
|
1242 |
*
|
|
1243 |
* Stages:
|
|
1244 |
* 1) Setup the utility and timer objects.
|
|
1245 |
* 2) Start the playback and start the countdown of 6 seconds.
|
|
1246 |
* 3) Upon countdown completion set the playback position to the 2 second point.
|
|
1247 |
* 4) Check the file playback completed.
|
|
1248 |
*
|
|
1249 |
*/
|
|
1250 |
TVerdict CTestStepPlayerPlayWaitSetPos::DoTestStepL()
|
|
1251 |
{
|
|
1252 |
INFO_PRINTF1(_L("MM-MMF-ACLNT-U-0984-CP"));
|
|
1253 |
INFO_PRINTF1(_L("This test is playing an audio file then after 6 seconds setting the position to the 2 second point."));
|
|
1254 |
INFO_PRINTF1(_L("Audio should play to completion after the call to SetPosition()."));
|
|
1255 |
|
|
1256 |
//Stage 1
|
|
1257 |
TCallBack callbackFunction(TimerCallback, this);
|
|
1258 |
iSetPositionCountDown = CPeriodic::NewL(CActive::EPriorityHigh);
|
|
1259 |
|
|
1260 |
TPtrC filename;
|
|
1261 |
if (!GetStringFromConfig(_L("SectionOne"), _L("AudioPlayFName2"), filename))
|
|
1262 |
{
|
|
1263 |
ERR_PRINTF1(_L("Audio test filename not found in INI file"));
|
|
1264 |
return EInconclusive;
|
|
1265 |
}
|
|
1266 |
|
|
1267 |
iPlayer = CMMFMdaAudioPlayerUtility::NewFilePlayerL(filename, *this);
|
|
1268 |
CActiveScheduler::Start();
|
|
1269 |
|
|
1270 |
if (iError != KErrNone)
|
|
1271 |
{
|
|
1272 |
ERR_PRINTF2(_L("Error creating file player %d"), iError);
|
|
1273 |
return EFail;
|
|
1274 |
}
|
|
1275 |
|
|
1276 |
//Stage 2
|
|
1277 |
INFO_PRINTF1(_L("Starting file playback."));
|
|
1278 |
iSetPositionCountDown->Start(6000000, 6000000, callbackFunction);
|
|
1279 |
iPlayer->Play();
|
|
1280 |
|
|
1281 |
CActiveScheduler::Start();
|
|
1282 |
|
|
1283 |
//Stage 4
|
|
1284 |
if (iError != KErrNone)
|
|
1285 |
{
|
|
1286 |
ERR_PRINTF2(_L("Error during file playback %d"), iError);
|
|
1287 |
return EFail;
|
|
1288 |
}
|
|
1289 |
else
|
|
1290 |
{
|
|
1291 |
INFO_PRINTF1(_L("File playback completed."));
|
|
1292 |
return EPass;
|
|
1293 |
}
|
|
1294 |
|
|
1295 |
}
|
|
1296 |
|
|
1297 |
void CTestStepPlayerPlayWaitSetPos::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/)
|
|
1298 |
{
|
|
1299 |
iError = aError;
|
|
1300 |
CActiveScheduler::Stop();
|
|
1301 |
}
|
|
1302 |
|
|
1303 |
void CTestStepPlayerPlayWaitSetPos::MapcPlayComplete(TInt aError)
|
|
1304 |
{
|
|
1305 |
iError = aError;
|
|
1306 |
CActiveScheduler::Stop();
|
|
1307 |
}
|
|
1308 |
|
|
1309 |
TInt CTestStepPlayerPlayWaitSetPos::TimerCallback(TAny* aParentObject)
|
|
1310 |
{
|
|
1311 |
CTestStepPlayerPlayWaitSetPos* target = static_cast<CTestStepPlayerPlayWaitSetPos*>(aParentObject);
|
|
1312 |
target->DoTimerCallback();
|
|
1313 |
return 0;
|
|
1314 |
}
|
|
1315 |
|
|
1316 |
void CTestStepPlayerPlayWaitSetPos::DoTimerCallback()
|
|
1317 |
{
|
|
1318 |
//Stage 3
|
|
1319 |
INFO_PRINTF1(_L("Setting the position to 2 seconds in."));
|
|
1320 |
iSetPositionCountDown->Cancel();
|
|
1321 |
iPlayer->SetPosition(2000000);
|
|
1322 |
}
|
|
1323 |
|
|
1324 |
//
|
|
1325 |
//
|
|
1326 |
// --------------------------------------------
|
|
1327 |
//
|
|
1328 |
/**
|
|
1329 |
*
|
|
1330 |
* Static constructor for CTestStepPlayerGetImplementationInfo.
|
|
1331 |
*
|
|
1332 |
*
|
|
1333 |
* @return "CTestStepPlayerGetImplementationInfo*"
|
|
1334 |
* The constructed CTestStepPlayerGetImplementationInfo
|
|
1335 |
*
|
|
1336 |
* @xxxx
|
|
1337 |
*
|
|
1338 |
*/
|
|
1339 |
CTestStepPlayerGetImplementationInfo* CTestStepPlayerGetImplementationInfo::NewL()
|
|
1340 |
{
|
|
1341 |
CTestStepPlayerGetImplementationInfo* self = new(ELeave) CTestStepPlayerGetImplementationInfo;
|
|
1342 |
return self;
|
|
1343 |
}
|
|
1344 |
|
|
1345 |
/**
|
|
1346 |
*
|
|
1347 |
* Test step constructor.
|
|
1348 |
* Each test step initialises its own name.
|
|
1349 |
*
|
|
1350 |
* @xxxx
|
|
1351 |
*
|
|
1352 |
*/
|
|
1353 |
CTestStepPlayerGetImplementationInfo::CTestStepPlayerGetImplementationInfo()
|
|
1354 |
{
|
|
1355 |
iTestStepResult = EPass;
|
|
1356 |
// store the name of this test case
|
|
1357 |
// this is the name that is used by the script file
|
|
1358 |
iTestStepName = _L("MM-MMF-ACLNT-U-0061-HP");
|
|
1359 |
}
|
|
1360 |
|
|
1361 |
/**
|
|
1362 |
*
|
|
1363 |
* Test step destructor.
|
|
1364 |
*
|
|
1365 |
* @xxxx
|
|
1366 |
*
|
|
1367 |
*/
|
|
1368 |
CTestStepPlayerGetImplementationInfo::~CTestStepPlayerGetImplementationInfo()
|
|
1369 |
{
|
|
1370 |
}
|
|
1371 |
|
|
1372 |
/**
|
|
1373 |
* Implementation of the MMdaAudioPlayerCallback interface functions
|
|
1374 |
**/
|
|
1375 |
void CTestStepPlayerGetImplementationInfo::MapcInitComplete(TInt aError,
|
|
1376 |
const TTimeIntervalMicroSeconds &/*aDuration*/)
|
|
1377 |
{
|
|
1378 |
iError = aError;
|
|
1379 |
CActiveScheduler::Stop();
|
|
1380 |
}
|
|
1381 |
|
|
1382 |
void CTestStepPlayerGetImplementationInfo::MapcPlayComplete(TInt aError)
|
|
1383 |
{
|
|
1384 |
iError = aError;
|
|
1385 |
CActiveScheduler::Stop();
|
|
1386 |
}
|
|
1387 |
|
|
1388 |
/**
|
|
1389 |
*
|
|
1390 |
* Test step Preamble.
|
|
1391 |
*
|
|
1392 |
* @xxxx
|
|
1393 |
*
|
|
1394 |
*/
|
|
1395 |
enum TVerdict CTestStepPlayerGetImplementationInfo::DoTestStepPreambleL(void)
|
|
1396 |
{
|
|
1397 |
enum TVerdict verdict;
|
|
1398 |
// this installs the scheduler
|
|
1399 |
verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL();
|
|
1400 |
if (verdict != EPass)
|
|
1401 |
return verdict;
|
|
1402 |
|
|
1403 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioPlayFName1"), iFileName))
|
|
1404 |
{
|
|
1405 |
//INFO_PRINTF2(_L("file name %s not found..."), fileptr);
|
|
1406 |
return EInconclusive;
|
|
1407 |
}
|
|
1408 |
|
|
1409 |
// Printing to the console and log file
|
|
1410 |
INFO_PRINTF1(iTestStepName);
|
|
1411 |
INFO_PRINTF1(_L("this test tests CMMFMdaAudioPlayerUtility::ControllerImplementationInformationL()"));
|
|
1412 |
|
|
1413 |
return verdict;
|
|
1414 |
}
|
|
1415 |
|
|
1416 |
/**
|
|
1417 |
*
|
|
1418 |
* Test step Postamble.
|
|
1419 |
*
|
|
1420 |
* @xxxx
|
|
1421 |
*
|
|
1422 |
*/
|
|
1423 |
enum TVerdict CTestStepPlayerGetImplementationInfo::DoTestStepPostambleL(void)
|
|
1424 |
{
|
|
1425 |
delete iPlayer;
|
|
1426 |
iPlayer = NULL;
|
|
1427 |
//[ Destroy the scheduler ]
|
|
1428 |
return CTestStepUnitMMFAudClient::DoTestStepPostambleL();
|
|
1429 |
}
|
|
1430 |
|
|
1431 |
/**
|
|
1432 |
*
|
|
1433 |
* Do the test step.
|
|
1434 |
* Each test step must supply an implementation for DoTestStepL.
|
|
1435 |
*
|
|
1436 |
* @return "TVerdict"
|
|
1437 |
* The result of the test step
|
|
1438 |
*
|
|
1439 |
* @xxxx
|
|
1440 |
*
|
|
1441 |
*/
|
|
1442 |
TVerdict CTestStepPlayerGetImplementationInfo::DoTestStepL()
|
|
1443 |
{
|
|
1444 |
TInt err;
|
|
1445 |
err = KErrNone;
|
|
1446 |
iTestStepResult = EFail;
|
|
1447 |
|
|
1448 |
iPlayer = CMMFMdaAudioPlayerUtility::NewFilePlayerL(iFileName, *this);
|
|
1449 |
CActiveScheduler::Start();
|
|
1450 |
|
|
1451 |
if (iError != KErrNone)
|
|
1452 |
return EInconclusive;
|
|
1453 |
|
|
1454 |
const CMMFControllerImplementationInformation* info = NULL;
|
|
1455 |
|
|
1456 |
TRAP(err, info = &iPlayer->ControllerImplementationInformationL());
|
|
1457 |
if (err != KErrNone)
|
|
1458 |
return EFail;
|
|
1459 |
|
|
1460 |
if (info->DisplayName().Compare(KAudioControllerName)!=0)
|
|
1461 |
iTestStepResult = EFail;
|
|
1462 |
else
|
|
1463 |
iTestStepResult = EPass;
|
|
1464 |
|
|
1465 |
delete iPlayer;
|
|
1466 |
iPlayer = NULL;
|
|
1467 |
|
|
1468 |
INFO_PRINTF1(_L("finished with this test step"));
|
|
1469 |
// test steps return a result
|
|
1470 |
return iTestStepResult;
|
|
1471 |
}
|
|
1472 |
|
|
1473 |
//
|
|
1474 |
//
|
|
1475 |
//
|
|
1476 |
// --------------------------------------------
|
|
1477 |
//
|
|
1478 |
/**
|
|
1479 |
*
|
|
1480 |
* Static constructor for CTestStepPlayerSendCustomCommandSync.
|
|
1481 |
*
|
|
1482 |
*
|
|
1483 |
* @return "CTestStepPlayerSendCustomCommandSync*"
|
|
1484 |
* The constructed CTestStepPlayerSendCustomCommandSync
|
|
1485 |
*
|
|
1486 |
* @xxxx
|
|
1487 |
*
|
|
1488 |
*/
|
|
1489 |
CTestStepPlayerSendCustomCommandSync* CTestStepPlayerSendCustomCommandSync::NewL()
|
|
1490 |
{
|
|
1491 |
CTestStepPlayerSendCustomCommandSync* self = new(ELeave) CTestStepPlayerSendCustomCommandSync;
|
|
1492 |
return self;
|
|
1493 |
}
|
|
1494 |
|
|
1495 |
/**
|
|
1496 |
*
|
|
1497 |
* Test step constructor.
|
|
1498 |
* Each test step initialises its own name.
|
|
1499 |
*
|
|
1500 |
* @xxxx
|
|
1501 |
*
|
|
1502 |
*/
|
|
1503 |
CTestStepPlayerSendCustomCommandSync::CTestStepPlayerSendCustomCommandSync()
|
|
1504 |
{
|
|
1505 |
iTestStepResult = EPass;
|
|
1506 |
// store the name of this test case
|
|
1507 |
// this is the name that is used by the script file
|
|
1508 |
iTestStepName = _L("MM-MMF-ACLNT-U-0062-HP");
|
|
1509 |
}
|
|
1510 |
|
|
1511 |
/**
|
|
1512 |
*
|
|
1513 |
* Test step destructor.
|
|
1514 |
*
|
|
1515 |
* @xxxx
|
|
1516 |
*
|
|
1517 |
*/
|
|
1518 |
CTestStepPlayerSendCustomCommandSync::~CTestStepPlayerSendCustomCommandSync()
|
|
1519 |
{
|
|
1520 |
}
|
|
1521 |
|
|
1522 |
/**
|
|
1523 |
* Implementation of the MVideoRecorderUtilityObserver interface functions
|
|
1524 |
**/
|
|
1525 |
void CTestStepPlayerSendCustomCommandSync::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/)
|
|
1526 |
{
|
|
1527 |
iError = aError;
|
|
1528 |
CActiveScheduler::Stop();
|
|
1529 |
}
|
|
1530 |
|
|
1531 |
void CTestStepPlayerSendCustomCommandSync::MapcPlayComplete(TInt aError)
|
|
1532 |
{
|
|
1533 |
iError = aError;
|
|
1534 |
CActiveScheduler::Stop();
|
|
1535 |
}
|
|
1536 |
|
|
1537 |
/**
|
|
1538 |
*
|
|
1539 |
* Test step Preamble.
|
|
1540 |
*
|
|
1541 |
* @xxxx
|
|
1542 |
*
|
|
1543 |
*/
|
|
1544 |
enum TVerdict CTestStepPlayerSendCustomCommandSync::DoTestStepPreambleL(void)
|
|
1545 |
{
|
|
1546 |
enum TVerdict verdict;
|
|
1547 |
// this installs the scheduler
|
|
1548 |
verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL();
|
|
1549 |
if (verdict != EPass)
|
|
1550 |
return verdict;
|
|
1551 |
|
|
1552 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioFNameTestController"), iFileName))
|
|
1553 |
{
|
|
1554 |
//INFO_PRINTF2(_L("file name %s not found..."), fileptr);
|
|
1555 |
return EInconclusive;
|
|
1556 |
}
|
|
1557 |
|
|
1558 |
// Printing to the console and log file
|
|
1559 |
INFO_PRINTF1(iTestStepName);
|
|
1560 |
INFO_PRINTF1(_L("this test is a test of CMMFMdaAudioPlayerUtility::CustomCommandSync()"));
|
|
1561 |
|
|
1562 |
return verdict;
|
|
1563 |
}
|
|
1564 |
|
|
1565 |
/**
|
|
1566 |
*
|
|
1567 |
* Test step Postamble.
|
|
1568 |
*
|
|
1569 |
* @xxxx
|
|
1570 |
*
|
|
1571 |
*/
|
|
1572 |
enum TVerdict CTestStepPlayerSendCustomCommandSync::DoTestStepPostambleL(void)
|
|
1573 |
{
|
|
1574 |
delete iPlayer;
|
|
1575 |
iPlayer = NULL;
|
|
1576 |
//[ Destroy the scheduler ]
|
|
1577 |
return CTestStepUnitMMFAudClient::DoTestStepPostambleL();
|
|
1578 |
}
|
|
1579 |
|
|
1580 |
/**
|
|
1581 |
*
|
|
1582 |
* Do the test step.
|
|
1583 |
* Each test step must supply an implementation for DoTestStepL.
|
|
1584 |
*
|
|
1585 |
* @return "TVerdict"
|
|
1586 |
* The result of the test step
|
|
1587 |
*
|
|
1588 |
* @xxxx
|
|
1589 |
*
|
|
1590 |
*/
|
|
1591 |
TVerdict CTestStepPlayerSendCustomCommandSync::DoTestStepL()
|
|
1592 |
{
|
|
1593 |
TInt err;
|
|
1594 |
err = KErrNone;
|
|
1595 |
iTestStepResult = EFail;
|
|
1596 |
|
|
1597 |
iPlayer = CMMFMdaAudioPlayerUtility::NewL(*this);
|
|
1598 |
|
|
1599 |
// special command to open the test controller, since it uses a different Media ID and will not be found with the normal Open
|
|
1600 |
err = OpenFileWithTestControllerL(iPlayer,iFileName);
|
|
1601 |
// no callback, since we skipped this
|
|
1602 |
if (err!=KErrNone)
|
|
1603 |
return EInconclusive;
|
|
1604 |
|
|
1605 |
TUid uid;
|
|
1606 |
uid = TUid::Uid(0x101f72B4);
|
|
1607 |
TMMFMessageDestinationPckg destPckg(uid);
|
|
1608 |
// test without a return value
|
|
1609 |
err = iPlayer->CustomCommandSync(destPckg,
|
|
1610 |
EMMFTestCustomCommandGeneralSynchronous,
|
|
1611 |
KFirstParameter,
|
|
1612 |
KSecondParameter);
|
|
1613 |
|
|
1614 |
if (err!=KTestCustomCommandSuccess)
|
|
1615 |
return EFail;
|
|
1616 |
|
|
1617 |
TBuf8<256> buf;
|
|
1618 |
|
|
1619 |
err = iPlayer->CustomCommandSync(destPckg,
|
|
1620 |
EMMFTestCustomCommandGeneralSynchronousWithReturn,
|
|
1621 |
KFirstParameter,
|
|
1622 |
KSecondParameter,
|
|
1623 |
buf);
|
|
1624 |
|
|
1625 |
if (err!=KTestCustomCommandSuccess)
|
|
1626 |
return EFail;
|
|
1627 |
|
|
1628 |
if (buf.Compare(KReturnParameter)==0)
|
|
1629 |
iTestStepResult = EPass;
|
|
1630 |
else
|
|
1631 |
iTestStepResult = EFail;
|
|
1632 |
|
|
1633 |
delete iPlayer;
|
|
1634 |
iPlayer = NULL;
|
|
1635 |
|
|
1636 |
INFO_PRINTF1(_L("finished with this test step"));
|
|
1637 |
// test steps return a result
|
|
1638 |
return iTestStepResult;
|
|
1639 |
}
|
|
1640 |
|
|
1641 |
|
|
1642 |
//
|
|
1643 |
//
|
|
1644 |
//
|
|
1645 |
// --------------------------------------------
|
|
1646 |
//
|
|
1647 |
/**
|
|
1648 |
*
|
|
1649 |
* Static constructor for CTestStepPlayerSendCustomCommandAsync.
|
|
1650 |
*
|
|
1651 |
*
|
|
1652 |
* @return "CTestStepPlayerSendCustomCommandAsync*"
|
|
1653 |
* The constructed CTestStepPlayerSendCustomCommandAsync
|
|
1654 |
*
|
|
1655 |
* @xxxx
|
|
1656 |
*
|
|
1657 |
*/
|
|
1658 |
CTestStepPlayerSendCustomCommandAsync* CTestStepPlayerSendCustomCommandAsync::NewL()
|
|
1659 |
{
|
|
1660 |
CTestStepPlayerSendCustomCommandAsync* self = new(ELeave) CTestStepPlayerSendCustomCommandAsync;
|
|
1661 |
return self;
|
|
1662 |
}
|
|
1663 |
|
|
1664 |
/**
|
|
1665 |
*
|
|
1666 |
* Test step constructor.
|
|
1667 |
* Each test step initialises its own name.
|
|
1668 |
*
|
|
1669 |
* @xxxx
|
|
1670 |
*
|
|
1671 |
*/
|
|
1672 |
CTestStepPlayerSendCustomCommandAsync::CTestStepPlayerSendCustomCommandAsync()
|
|
1673 |
{
|
|
1674 |
iTestStepResult = EPass;
|
|
1675 |
// store the name of this test case
|
|
1676 |
// this is the name that is used by the script file
|
|
1677 |
iTestStepName = _L("MM-MMF-ACLNT-U-0063-HP");
|
|
1678 |
}
|
|
1679 |
|
|
1680 |
/**
|
|
1681 |
*
|
|
1682 |
* Test step destructor.
|
|
1683 |
*
|
|
1684 |
* @xxxx
|
|
1685 |
*
|
|
1686 |
*/
|
|
1687 |
CTestStepPlayerSendCustomCommandAsync::~CTestStepPlayerSendCustomCommandAsync()
|
|
1688 |
{
|
|
1689 |
}
|
|
1690 |
|
|
1691 |
/**
|
|
1692 |
*
|
|
1693 |
* Test step Close
|
|
1694 |
* handles all deletion
|
|
1695 |
* @xxxx
|
|
1696 |
*
|
|
1697 |
*/
|
|
1698 |
void CTestStepPlayerSendCustomCommandAsync::Close()
|
|
1699 |
{
|
|
1700 |
delete iAsyncObserver;
|
|
1701 |
}
|
|
1702 |
|
|
1703 |
/**
|
|
1704 |
* Implementation of the MVideoRecorderUtilityObserver interface functions
|
|
1705 |
**/
|
|
1706 |
void CTestStepPlayerSendCustomCommandAsync::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/)
|
|
1707 |
{
|
|
1708 |
iError = aError;
|
|
1709 |
CActiveScheduler::Stop();
|
|
1710 |
}
|
|
1711 |
|
|
1712 |
void CTestStepPlayerSendCustomCommandAsync::MapcPlayComplete(TInt aError)
|
|
1713 |
{
|
|
1714 |
iError = aError;
|
|
1715 |
CActiveScheduler::Stop();
|
|
1716 |
}
|
|
1717 |
|
|
1718 |
/**
|
|
1719 |
*
|
|
1720 |
* Test step Preamble.
|
|
1721 |
*
|
|
1722 |
* @xxxx
|
|
1723 |
*
|
|
1724 |
*/
|
|
1725 |
enum TVerdict CTestStepPlayerSendCustomCommandAsync::DoTestStepPreambleL(void)
|
|
1726 |
{
|
|
1727 |
enum TVerdict verdict;
|
|
1728 |
// this installs the scheduler
|
|
1729 |
verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL();
|
|
1730 |
if (verdict != EPass)
|
|
1731 |
return verdict;
|
|
1732 |
|
|
1733 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioFNameTestController"), iFileName))
|
|
1734 |
{
|
|
1735 |
//INFO_PRINTF2(_L("file name %s not found..."), fileptr);
|
|
1736 |
return EInconclusive;
|
|
1737 |
}
|
|
1738 |
|
|
1739 |
iAsyncObserver = new (ELeave) CAsyncObserver;
|
|
1740 |
|
|
1741 |
// Printing to the console and log file
|
|
1742 |
INFO_PRINTF1(iTestStepName);
|
|
1743 |
INFO_PRINTF1(_L("this test tests CMMFMdaAudioPlayerUtility::CustomCommandAsync"));
|
|
1744 |
|
|
1745 |
return verdict;
|
|
1746 |
}
|
|
1747 |
|
|
1748 |
/**
|
|
1749 |
*
|
|
1750 |
* Test step Postamble.
|
|
1751 |
*
|
|
1752 |
* @xxxx
|
|
1753 |
*
|
|
1754 |
*/
|
|
1755 |
enum TVerdict CTestStepPlayerSendCustomCommandAsync::DoTestStepPostambleL(void)
|
|
1756 |
{
|
|
1757 |
delete iPlayer;
|
|
1758 |
iPlayer = NULL;
|
|
1759 |
//[ Destroy the scheduler ]
|
|
1760 |
return CTestStepUnitMMFAudClient::DoTestStepPostambleL();
|
|
1761 |
}
|
|
1762 |
|
|
1763 |
/**
|
|
1764 |
*
|
|
1765 |
* Do the test step.
|
|
1766 |
* Each test step must supply an implementation for DoTestStepL.
|
|
1767 |
*
|
|
1768 |
* @return "TVerdict"
|
|
1769 |
* The result of the test step
|
|
1770 |
*
|
|
1771 |
* @xxxx
|
|
1772 |
*
|
|
1773 |
*/
|
|
1774 |
TVerdict CTestStepPlayerSendCustomCommandAsync::DoTestStepL()
|
|
1775 |
{
|
|
1776 |
TInt err;
|
|
1777 |
err = KErrNone;
|
|
1778 |
iTestStepResult = EFail;
|
|
1779 |
|
|
1780 |
iPlayer = CMMFMdaAudioPlayerUtility::NewL(*this);
|
|
1781 |
|
|
1782 |
// special command to open the test controller, since it uses a different Media ID and will not be found with the normal Open
|
|
1783 |
err = OpenFileWithTestControllerL(iPlayer,iFileName);
|
|
1784 |
// no callback, since we skipped this
|
|
1785 |
if (err!=KErrNone)
|
|
1786 |
return EInconclusive;
|
|
1787 |
|
|
1788 |
TUid uid;
|
|
1789 |
uid = TUid::Uid(0x101f72B4);
|
|
1790 |
// destinationPckg can be temporary as the asynchronous custom command returns before the temporary variable goes out of scope
|
|
1791 |
TMMFMessageDestinationPckg destinationPckg(uid);
|
|
1792 |
|
|
1793 |
// test without a return value
|
|
1794 |
iPlayer->CustomCommandAsync(destinationPckg,
|
|
1795 |
EMMFTestCustomCommandGeneralAsynchronous,
|
|
1796 |
KFirstParameter,
|
|
1797 |
KSecondParameter,
|
|
1798 |
iAsyncObserver->ActiveStatus());
|
|
1799 |
|
|
1800 |
CActiveScheduler::Start();
|
|
1801 |
if (iAsyncObserver->iStatus.Int() !=KTestCustomCommandSuccess)
|
|
1802 |
return EFail;
|
|
1803 |
|
|
1804 |
TBuf8<256> buf;
|
|
1805 |
|
|
1806 |
iPlayer->CustomCommandAsync(destinationPckg,
|
|
1807 |
EMMFTestCustomCommandGeneralAsynchronousWithReturn,
|
|
1808 |
KFirstParameter,
|
|
1809 |
KSecondParameter,
|
|
1810 |
buf,
|
|
1811 |
iAsyncObserver->ActiveStatus());
|
|
1812 |
|
|
1813 |
CActiveScheduler::Start();
|
|
1814 |
if (iAsyncObserver->iStatus.Int() !=KTestCustomCommandSuccess)
|
|
1815 |
return EFail;
|
|
1816 |
|
|
1817 |
if (buf.Compare(KReturnParameter)==0)
|
|
1818 |
iTestStepResult = EPass;
|
|
1819 |
else
|
|
1820 |
iTestStepResult = EFail;
|
|
1821 |
|
|
1822 |
INFO_PRINTF1(_L("finished with this test step"));
|
|
1823 |
// test steps return a result
|
|
1824 |
return iTestStepResult;
|
|
1825 |
}
|
|
1826 |
|
|
1827 |
//
|
|
1828 |
//
|
|
1829 |
// --------------------------------------------
|
|
1830 |
//
|
|
1831 |
/**
|
|
1832 |
*
|
|
1833 |
* Static constructor for CTestStepPlayerReloadingTest.
|
|
1834 |
*
|
|
1835 |
*
|
|
1836 |
* @return "CTestStepPlayerReloadingTest*"
|
|
1837 |
* The constructed CTestStepPlayerReloadingTest
|
|
1838 |
*
|
|
1839 |
* @xxxx
|
|
1840 |
*
|
|
1841 |
*/
|
|
1842 |
CTestStepPlayerReloadingTest* CTestStepPlayerReloadingTest::NewL()
|
|
1843 |
{
|
|
1844 |
CTestStepPlayerReloadingTest* self = new(ELeave) CTestStepPlayerReloadingTest;
|
|
1845 |
return self;
|
|
1846 |
}
|
|
1847 |
|
|
1848 |
/**
|
|
1849 |
*
|
|
1850 |
* Test step constructor.
|
|
1851 |
* Each test step initialises its own name.
|
|
1852 |
*
|
|
1853 |
* @xxxx
|
|
1854 |
*
|
|
1855 |
*/
|
|
1856 |
CTestStepPlayerReloadingTest::CTestStepPlayerReloadingTest()
|
|
1857 |
{
|
|
1858 |
iTestStepResult = EPass;
|
|
1859 |
// store the name of this test case
|
|
1860 |
// this is the name that is used by the script file
|
|
1861 |
iTestStepName = _L("MM-MMF-ACLNT-U-0064-HP");
|
|
1862 |
}
|
|
1863 |
|
|
1864 |
/**
|
|
1865 |
*
|
|
1866 |
* Test step destructor.
|
|
1867 |
*
|
|
1868 |
* @xxxx
|
|
1869 |
*
|
|
1870 |
*/
|
|
1871 |
CTestStepPlayerReloadingTest::~CTestStepPlayerReloadingTest()
|
|
1872 |
{
|
|
1873 |
}
|
|
1874 |
|
|
1875 |
void CTestStepPlayerReloadingTest::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/)
|
|
1876 |
{
|
|
1877 |
iError = aError;
|
|
1878 |
CActiveScheduler::Stop();
|
|
1879 |
}
|
|
1880 |
|
|
1881 |
void CTestStepPlayerReloadingTest::MapcPlayComplete(TInt aError)
|
|
1882 |
{
|
|
1883 |
iError = aError;
|
|
1884 |
CActiveScheduler::Stop();
|
|
1885 |
}
|
|
1886 |
|
|
1887 |
void CTestStepPlayerReloadingTest::MaloLoadingStarted()
|
|
1888 |
{
|
|
1889 |
iLoadingStarted = ETrue;
|
|
1890 |
CActiveScheduler::Stop();
|
|
1891 |
}
|
|
1892 |
|
|
1893 |
void CTestStepPlayerReloadingTest::MaloLoadingComplete()
|
|
1894 |
{
|
|
1895 |
iLoadingComplete = ETrue;
|
|
1896 |
CActiveScheduler::Stop();
|
|
1897 |
}
|
|
1898 |
|
|
1899 |
|
|
1900 |
|
|
1901 |
|
|
1902 |
/**
|
|
1903 |
*
|
|
1904 |
* Test step Preamble.
|
|
1905 |
*
|
|
1906 |
* @xxxx
|
|
1907 |
*
|
|
1908 |
*/
|
|
1909 |
enum TVerdict CTestStepPlayerReloadingTest::DoTestStepPreambleL(void)
|
|
1910 |
{
|
|
1911 |
enum TVerdict verdict;
|
|
1912 |
// this installs the scheduler
|
|
1913 |
verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL();
|
|
1914 |
if (verdict != EPass)
|
|
1915 |
return verdict;
|
|
1916 |
|
|
1917 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioFNameTestController"), iFileName))
|
|
1918 |
{
|
|
1919 |
//INFO_PRINTF2(_L("file name %s not found..."), fileptr);
|
|
1920 |
return EInconclusive;
|
|
1921 |
}
|
|
1922 |
|
|
1923 |
// Printing to the console and log file
|
|
1924 |
INFO_PRINTF1(iTestStepName);
|
|
1925 |
INFO_PRINTF1(_L("this test simulates Audio Reloading and tests CMMFMdaAudioPlayerUtility::GetAudioLoadingProgressL"));
|
|
1926 |
|
|
1927 |
return verdict;
|
|
1928 |
}
|
|
1929 |
|
|
1930 |
/**
|
|
1931 |
*
|
|
1932 |
* Test step Postamble.
|
|
1933 |
*
|
|
1934 |
* @xxxx
|
|
1935 |
*
|
|
1936 |
*/
|
|
1937 |
enum TVerdict CTestStepPlayerReloadingTest::DoTestStepPostambleL(void)
|
|
1938 |
{
|
|
1939 |
delete iPlayer;
|
|
1940 |
iPlayer = NULL;
|
|
1941 |
//[ Destroy the scheduler ]
|
|
1942 |
return CTestStepUnitMMFAudClient::DoTestStepPostambleL();
|
|
1943 |
}
|
|
1944 |
|
|
1945 |
/**
|
|
1946 |
*
|
|
1947 |
* Do the test step.
|
|
1948 |
* Each test step must supply an implementation for DoTestStepL.
|
|
1949 |
*
|
|
1950 |
* @return "TVerdict"
|
|
1951 |
* The result of the test step
|
|
1952 |
*
|
|
1953 |
* @xxxx
|
|
1954 |
*
|
|
1955 |
*/
|
|
1956 |
TVerdict CTestStepPlayerReloadingTest::DoTestStepL()
|
|
1957 |
{
|
|
1958 |
TInt err;
|
|
1959 |
err = KErrNone;
|
|
1960 |
iTestStepResult = EFail;
|
|
1961 |
|
|
1962 |
iPlayer = CMMFMdaAudioPlayerUtility::NewL(*this);
|
|
1963 |
|
|
1964 |
err = OpenFileWithTestControllerL(iPlayer, iFileName);
|
|
1965 |
|
|
1966 |
if (err!=KErrNone)
|
|
1967 |
return EInconclusive;
|
|
1968 |
|
|
1969 |
iPlayer->RegisterForAudioLoadingNotification(*this);
|
|
1970 |
|
|
1971 |
TUid uid;
|
|
1972 |
uid = TUid::Uid(0x101f72B4);
|
|
1973 |
TMMFMessageDestinationPckg destPckg(uid);
|
|
1974 |
// test without a return value
|
|
1975 |
err = iPlayer->CustomCommandSync(destPckg,
|
|
1976 |
EMMFTestCustomCommandSimulateReloading,
|
|
1977 |
KNullDesC8,
|
|
1978 |
KNullDesC8);
|
|
1979 |
|
|
1980 |
if (err!=KErrNone)
|
|
1981 |
return EInconclusive;
|
|
1982 |
|
|
1983 |
CActiveScheduler::Start();
|
|
1984 |
|
|
1985 |
if (!iLoadingStarted)
|
|
1986 |
return EFail;
|
|
1987 |
|
|
1988 |
TInt percentageComplete = 0;
|
|
1989 |
TInt oldPercentageComplete =0;
|
|
1990 |
while (percentageComplete!=100 && percentageComplete>=oldPercentageComplete)
|
|
1991 |
{
|
|
1992 |
oldPercentageComplete = percentageComplete;
|
|
1993 |
iPlayer->GetAudioLoadingProgressL(percentageComplete);
|
|
1994 |
INFO_PRINTF2(_L("Loading progress: %d"),percentageComplete);
|
|
1995 |
User::After(100);
|
|
1996 |
}
|
|
1997 |
|
|
1998 |
CActiveScheduler::Start();
|
|
1999 |
|
|
2000 |
if (iLoadingComplete && percentageComplete==100)
|
|
2001 |
iTestStepResult = EPass;
|
|
2002 |
else
|
|
2003 |
iTestStepResult = EFail;
|
|
2004 |
|
|
2005 |
delete iPlayer;
|
|
2006 |
iPlayer = NULL;
|
|
2007 |
|
|
2008 |
INFO_PRINTF1(_L("finished with this test step"));
|
|
2009 |
// test steps return a result
|
|
2010 |
return iTestStepResult;
|
|
2011 |
}
|
|
2012 |
|
|
2013 |
/**
|
|
2014 |
*
|
|
2015 |
* Static constructor for CTestStepPlayerPlayStopFFPlayNext.
|
|
2016 |
*
|
|
2017 |
*
|
|
2018 |
* @return "CTestStepPlayerPlayStopFFPlayNext*"
|
|
2019 |
* The constructed CTestStepPlayerPlayStopFFPlayNext
|
|
2020 |
*
|
|
2021 |
* @xxxx
|
|
2022 |
*
|
|
2023 |
*/
|
|
2024 |
CTestStepPlayerPlayStopFFPlayNext* CTestStepPlayerPlayStopFFPlayNext::NewL()
|
|
2025 |
{
|
|
2026 |
CTestStepPlayerPlayStopFFPlayNext* self = new(ELeave) CTestStepPlayerPlayStopFFPlayNext;
|
|
2027 |
return self;
|
|
2028 |
}
|
|
2029 |
|
|
2030 |
|
|
2031 |
/**
|
|
2032 |
*
|
|
2033 |
* Test step constructor.
|
|
2034 |
* Each test step initialises its own name.
|
|
2035 |
*
|
|
2036 |
* @xxxx
|
|
2037 |
*
|
|
2038 |
*/
|
|
2039 |
|
|
2040 |
CTestStepPlayerPlayStopFFPlayNext::CTestStepPlayerPlayStopFFPlayNext()
|
|
2041 |
{
|
|
2042 |
// store the name of this test case
|
|
2043 |
// this is the name that is used by the script file
|
|
2044 |
iTestStepName = _L("MM-MMF-ACLNT-U-0856-HP");
|
|
2045 |
|
|
2046 |
}
|
|
2047 |
|
|
2048 |
/**
|
|
2049 |
*
|
|
2050 |
* Test step destructor.
|
|
2051 |
*
|
|
2052 |
* @xxxx
|
|
2053 |
*
|
|
2054 |
*/
|
|
2055 |
|
|
2056 |
CTestStepPlayerPlayStopFFPlayNext::~CTestStepPlayerPlayStopFFPlayNext()
|
|
2057 |
{
|
|
2058 |
}
|
|
2059 |
|
|
2060 |
/**
|
|
2061 |
*
|
|
2062 |
* Test step Preamble.
|
|
2063 |
*
|
|
2064 |
* @xxxx
|
|
2065 |
*
|
|
2066 |
*/
|
|
2067 |
|
|
2068 |
TVerdict CTestStepPlayerPlayStopFFPlayNext::DoTestStepPreambleL(void)
|
|
2069 |
{
|
|
2070 |
TVerdict verdict=EPass;
|
|
2071 |
// this installs the scheduler
|
|
2072 |
if((verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL()) != EPass)
|
|
2073 |
{
|
|
2074 |
return EInconclusive;
|
|
2075 |
}
|
|
2076 |
|
|
2077 |
// Printing to the console and log file
|
|
2078 |
INFO_PRINTF2(_L("%S"), &iTestStepName);
|
|
2079 |
INFO_PRINTF1(_L("this is a test of calling Play, Stop fast forward close"));
|
|
2080 |
INFO_PRINTF1(_L("and then open the next song playing again & verifying the clip is played from the start"));
|
|
2081 |
|
|
2082 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioPlayFName10"), iFileName))
|
|
2083 |
{
|
|
2084 |
return EInconclusive;
|
|
2085 |
}
|
|
2086 |
// create a play utility
|
|
2087 |
TRAPD(error, iPlayerUtility = CMdaAudioPlayerUtility::NewL(*this));
|
|
2088 |
if (error != KErrNone)
|
|
2089 |
{
|
|
2090 |
return EInconclusive;
|
|
2091 |
}
|
|
2092 |
return verdict;
|
|
2093 |
}
|
|
2094 |
|
|
2095 |
/**
|
|
2096 |
*
|
|
2097 |
* Test step Postamble.
|
|
2098 |
*
|
|
2099 |
* @xxxx
|
|
2100 |
*
|
|
2101 |
*/
|
|
2102 |
TVerdict CTestStepPlayerPlayStopFFPlayNext::DoTestStepPostambleL(void)
|
|
2103 |
{
|
|
2104 |
delete iPlayerUtility;
|
|
2105 |
iPlayerUtility = NULL;
|
|
2106 |
|
|
2107 |
//[ Destroy the scheduler ]
|
|
2108 |
return CTestStepUnitMMFAudClient::DoTestStepPostambleL();
|
|
2109 |
}
|
|
2110 |
|
|
2111 |
/**
|
|
2112 |
*
|
|
2113 |
* Callback Handle.
|
|
2114 |
*
|
|
2115 |
* @xxxx
|
|
2116 |
*
|
|
2117 |
*/
|
|
2118 |
void CTestStepPlayerPlayStopFFPlayNext::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/)
|
|
2119 |
{
|
|
2120 |
INFO_PRINTF2(_L("MapcInitComplete(): error = %d"), aError);
|
|
2121 |
iError = aError;
|
|
2122 |
CActiveScheduler::Stop();
|
|
2123 |
}
|
|
2124 |
|
|
2125 |
void CTestStepPlayerPlayStopFFPlayNext::MapcPlayComplete(TInt aError)
|
|
2126 |
{
|
|
2127 |
INFO_PRINTF2(_L("MapcPlayComplete(): error = %d"), aError);
|
|
2128 |
iError = aError;
|
|
2129 |
CActiveScheduler::Stop();
|
|
2130 |
}
|
|
2131 |
|
|
2132 |
|
|
2133 |
TVerdict CTestStepPlayerPlayStopFFPlayNext::DoTestStepL()
|
|
2134 |
{
|
|
2135 |
iTestStepResult = EPass;
|
|
2136 |
|
|
2137 |
INFO_PRINTF1(_L("Opening file using player utility..."));
|
|
2138 |
|
|
2139 |
// open the sound file
|
|
2140 |
TRAP(iError, iPlayerUtility->OpenFileL(iFileName));
|
|
2141 |
if (iError != KErrNone)
|
|
2142 |
{
|
|
2143 |
return EInconclusive;
|
|
2144 |
}
|
|
2145 |
// wait for open to complete
|
|
2146 |
CActiveScheduler::Start();
|
|
2147 |
if (iError != KErrNone)
|
|
2148 |
{
|
|
2149 |
return EFail;
|
|
2150 |
}
|
|
2151 |
|
|
2152 |
TTimeIntervalMicroSeconds playStart = TTimeIntervalMicroSeconds(0);
|
|
2153 |
TTimeIntervalMicroSeconds playEnd = iPlayerUtility->Duration();
|
|
2154 |
// SetPlayWindow, Play & verify we play from start of window
|
|
2155 |
INFO_PRINTF1(_L("calling SetPlayWindow..."));
|
|
2156 |
iPlayerUtility->SetPlayWindow(playStart, playEnd);
|
|
2157 |
|
|
2158 |
INFO_PRINTF1(_L("calling play..."));
|
|
2159 |
iPlayerUtility->Play();
|
|
2160 |
|
|
2161 |
if (iError != KErrNone)
|
|
2162 |
{
|
|
2163 |
return EFail;
|
|
2164 |
}
|
|
2165 |
const TInt KTwoSeconds = 2000000;
|
|
2166 |
User::After(KTwoSeconds);
|
|
2167 |
|
|
2168 |
TTimeIntervalMicroSeconds position = TTimeIntervalMicroSeconds(0);
|
|
2169 |
iPlayerUtility->GetPosition(position);
|
|
2170 |
INFO_PRINTF1(_L("calling stop..."));
|
|
2171 |
iPlayerUtility->Stop();
|
|
2172 |
FastForward(position);
|
|
2173 |
iPlayerUtility->GetPosition(position);
|
|
2174 |
FastForward(position);
|
|
2175 |
iPlayerUtility->GetPosition(position);
|
|
2176 |
FastForward(position);
|
|
2177 |
Next();
|
|
2178 |
if (iError != KErrNone)
|
|
2179 |
{
|
|
2180 |
return EFail;
|
|
2181 |
}
|
|
2182 |
iPlayerUtility->Play();
|
|
2183 |
User::After(KTwoSeconds);
|
|
2184 |
position = 0;
|
|
2185 |
iPlayerUtility->GetPosition(position);
|
|
2186 |
TInt64 halfSecond = playEnd.Int64() / 2;
|
|
2187 |
if (position.Int64() > halfSecond)
|
|
2188 |
{
|
|
2189 |
INFO_PRINTF2(_L("play position is not at start of clip - %d"), position.Int64());
|
|
2190 |
return EFail;
|
|
2191 |
}
|
|
2192 |
iPlayerUtility->Close();
|
|
2193 |
return iTestStepResult;
|
|
2194 |
}
|
|
2195 |
|
|
2196 |
void CTestStepPlayerPlayStopFFPlayNext::FastForward(const TTimeIntervalMicroSeconds aPosition)
|
|
2197 |
{
|
|
2198 |
TTimeIntervalMicroSeconds step = TTimeIntervalMicroSeconds(200000);
|
|
2199 |
iPlayerUtility->SetPosition(aPosition.Int64() + step.Int64());
|
|
2200 |
}
|
|
2201 |
|
|
2202 |
void CTestStepPlayerPlayStopFFPlayNext::Next()
|
|
2203 |
{
|
|
2204 |
iPlayerUtility->Close();
|
|
2205 |
iError = KErrNone;
|
|
2206 |
TRAP(iError, iPlayerUtility->OpenFileL(iFileName));
|
|
2207 |
}
|
|
2208 |
|
|
2209 |
|
|
2210 |
//
|
|
2211 |
// class CTestStepMultipleSetPlayerPriority
|
|
2212 |
// --------------------------------------------
|
|
2213 |
//
|
|
2214 |
/**
|
|
2215 |
*
|
|
2216 |
* Static constructor for CTestStepMultipleSetPlayerPriority.
|
|
2217 |
*
|
|
2218 |
*
|
|
2219 |
* @return "CTestStepMultipleSetPlayerPriority*"
|
|
2220 |
* The constructed CTestStepMultipleSetPlayerPriority
|
|
2221 |
*
|
|
2222 |
* @xxxx
|
|
2223 |
*
|
|
2224 |
*/
|
|
2225 |
CTestStepMultipleSetPlayerPriority* CTestStepMultipleSetPlayerPriority::NewL()
|
|
2226 |
{
|
|
2227 |
CTestStepMultipleSetPlayerPriority* self = new(ELeave) CTestStepMultipleSetPlayerPriority;
|
|
2228 |
return self;
|
|
2229 |
}
|
|
2230 |
|
|
2231 |
/**
|
|
2232 |
*
|
|
2233 |
* Test step constructor.
|
|
2234 |
* Each test step initialises its own name.
|
|
2235 |
*
|
|
2236 |
* @xxxx
|
|
2237 |
*
|
|
2238 |
*/
|
|
2239 |
CTestStepMultipleSetPlayerPriority::CTestStepMultipleSetPlayerPriority()
|
|
2240 |
{
|
|
2241 |
iTestStepResult = EPass;
|
|
2242 |
// store the name of this test case
|
|
2243 |
// this is the name that is used by the script file
|
|
2244 |
iTestStepName = _L("MM-MMF-ACLNT-U-0957-HP");
|
|
2245 |
}
|
|
2246 |
|
|
2247 |
/**
|
|
2248 |
*
|
|
2249 |
* Test step destructor.
|
|
2250 |
*
|
|
2251 |
* @xxxx
|
|
2252 |
*
|
|
2253 |
*/
|
|
2254 |
CTestStepMultipleSetPlayerPriority::~CTestStepMultipleSetPlayerPriority()
|
|
2255 |
{
|
|
2256 |
}
|
|
2257 |
/**
|
|
2258 |
* Implementation of the MMdaAudioPlayerCallback interface functions
|
|
2259 |
**/
|
|
2260 |
void CTestStepMultipleSetPlayerPriority::MapcInitComplete(TInt aError,
|
|
2261 |
const TTimeIntervalMicroSeconds &/*aDuration*/)
|
|
2262 |
{
|
|
2263 |
iError = aError;
|
|
2264 |
CActiveScheduler::Stop();
|
|
2265 |
}
|
|
2266 |
|
|
2267 |
void CTestStepMultipleSetPlayerPriority::MapcPlayComplete(TInt aError)
|
|
2268 |
{
|
|
2269 |
iError = aError;
|
|
2270 |
CActiveScheduler::Stop();
|
|
2271 |
}
|
|
2272 |
|
|
2273 |
/**
|
|
2274 |
*
|
|
2275 |
* Test step Preamble.
|
|
2276 |
*
|
|
2277 |
* @xxxx
|
|
2278 |
*
|
|
2279 |
*/
|
|
2280 |
enum TVerdict CTestStepMultipleSetPlayerPriority::DoTestStepPreambleL(void)
|
|
2281 |
{
|
|
2282 |
enum TVerdict verdict;
|
|
2283 |
// this installs the scheduler
|
|
2284 |
verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL();
|
|
2285 |
|
|
2286 |
// Printing to the console and log file
|
|
2287 |
INFO_PRINTF1(_L("MM-MMF-ACLNT-U-0957-HP"));
|
|
2288 |
INFO_PRINTF1(_L("This test checks for setting the priorities more than once, as part of DEF067052"));
|
|
2289 |
|
|
2290 |
iError = KErrNone; //KErrTimedOut;
|
|
2291 |
|
|
2292 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioFNameMeta"), iFileName))
|
|
2293 |
{
|
|
2294 |
return EInconclusive;
|
|
2295 |
}
|
|
2296 |
|
|
2297 |
iPlayer = CMMFMdaAudioPlayerUtility::NewFilePlayerL(iFileName, *this);
|
|
2298 |
CActiveScheduler::Start();
|
|
2299 |
User::After(1000000);
|
|
2300 |
|
|
2301 |
if (iPlayer == NULL ||
|
|
2302 |
iError != KErrNone )
|
|
2303 |
return EInconclusive;
|
|
2304 |
|
|
2305 |
return verdict;
|
|
2306 |
}
|
|
2307 |
|
|
2308 |
/**
|
|
2309 |
*
|
|
2310 |
* Test step Postamble.
|
|
2311 |
*
|
|
2312 |
* @xxxx
|
|
2313 |
*
|
|
2314 |
*/
|
|
2315 |
enum TVerdict CTestStepMultipleSetPlayerPriority::DoTestStepPostambleL(void)
|
|
2316 |
{
|
|
2317 |
delete iPlayer;
|
|
2318 |
iPlayer = NULL;
|
|
2319 |
//[ Destroy the scheduler ]
|
|
2320 |
return CTestStepUnitMMFAudClient::DoTestStepPostambleL();
|
|
2321 |
}
|
|
2322 |
|
|
2323 |
/**
|
|
2324 |
*
|
|
2325 |
* Do the test step.
|
|
2326 |
* Each test step must supply an implementation for DoTestStepL.
|
|
2327 |
*
|
|
2328 |
* @return "TVerdict"
|
|
2329 |
* The result of the test step
|
|
2330 |
*
|
|
2331 |
* @xxxx
|
|
2332 |
*
|
|
2333 |
*/
|
|
2334 |
TVerdict CTestStepMultipleSetPlayerPriority::DoTestStepL()
|
|
2335 |
{
|
|
2336 |
iTestStepResult = EPass;
|
|
2337 |
TInt err = KErrNone;
|
|
2338 |
|
|
2339 |
iPlayer->SetPriority(EMdaPriorityNormal, EMdaPriorityPreferenceQuality);
|
|
2340 |
|
|
2341 |
TMMFPrioritySettings priorSets;
|
|
2342 |
err = GetAudPlayerPriority(iPlayer, priorSets);
|
|
2343 |
if (err != KErrNone ||
|
|
2344 |
priorSets.iPriority != EMdaPriorityNormal ||
|
|
2345 |
priorSets.iPref != EMdaPriorityPreferenceQuality)
|
|
2346 |
{
|
|
2347 |
return EFail;
|
|
2348 |
}
|
|
2349 |
iPlayer->Play();
|
|
2350 |
User::After(1000000);
|
|
2351 |
iPlayer->Pause();
|
|
2352 |
iPlayer->SetPriority(EMdaPriorityMin, EMdaPriorityPreferenceTimeAndQuality);
|
|
2353 |
err = GetAudPlayerPriority(iPlayer, priorSets);
|
|
2354 |
if (err != KErrNone ||
|
|
2355 |
priorSets.iPriority != EMdaPriorityMin ||
|
|
2356 |
priorSets.iPref != EMdaPriorityPreferenceTimeAndQuality)
|
|
2357 |
{
|
|
2358 |
return EFail;
|
|
2359 |
}
|
|
2360 |
iPlayer->Play();
|
|
2361 |
INFO_PRINTF1(_L("finished with this test step"));
|
|
2362 |
// test steps return a result
|
|
2363 |
return iTestStepResult;
|
|
2364 |
}
|
|
2365 |
|
|
2366 |
|
|
2367 |
|
|
2368 |
//
|
|
2369 |
// class CTestStepPlayerPlayPausePlay
|
|
2370 |
// --------------------------------------------
|
|
2371 |
//
|
|
2372 |
/**
|
|
2373 |
*
|
|
2374 |
* Static constructor for CTestStepPlayerPlayPausePlay.
|
|
2375 |
*
|
|
2376 |
*
|
|
2377 |
* @return "CTestStepPlayerPlayPausePlay*"
|
|
2378 |
* The constructed CTestStepPlayerPlayPausePlay
|
|
2379 |
*
|
|
2380 |
* @xxxx
|
|
2381 |
*
|
|
2382 |
*/
|
|
2383 |
CTestStepPlayerPlayPausePlay* CTestStepPlayerPlayPausePlay::NewL()
|
|
2384 |
{
|
|
2385 |
CTestStepPlayerPlayPausePlay* self = new(ELeave) CTestStepPlayerPlayPausePlay;
|
|
2386 |
return self;
|
|
2387 |
}
|
|
2388 |
|
|
2389 |
/**
|
|
2390 |
*
|
|
2391 |
* Test step constructor.
|
|
2392 |
* Each test step initialises its own name.
|
|
2393 |
*
|
|
2394 |
* @xxxx
|
|
2395 |
*
|
|
2396 |
*/
|
|
2397 |
CTestStepPlayerPlayPausePlay::CTestStepPlayerPlayPausePlay()
|
|
2398 |
{
|
|
2399 |
iTestStepResult = EPass;
|
|
2400 |
// store the name of this test case
|
|
2401 |
// this is the name that is used by the script file
|
|
2402 |
iTestStepName = _L("MM-MMF-ACLNT-U-0958-HP");
|
|
2403 |
}
|
|
2404 |
|
|
2405 |
/**
|
|
2406 |
*
|
|
2407 |
* Test step destructor.
|
|
2408 |
*
|
|
2409 |
* @xxxx
|
|
2410 |
*
|
|
2411 |
*/
|
|
2412 |
CTestStepPlayerPlayPausePlay::~CTestStepPlayerPlayPausePlay()
|
|
2413 |
{
|
|
2414 |
}
|
|
2415 |
/**
|
|
2416 |
* Implementation of the MMdaAudioPlayerCallback interface functions
|
|
2417 |
**/
|
|
2418 |
void CTestStepPlayerPlayPausePlay::MapcInitComplete(TInt aError,
|
|
2419 |
const TTimeIntervalMicroSeconds &/*aDuration*/)
|
|
2420 |
{
|
|
2421 |
iError = aError;
|
|
2422 |
CActiveScheduler::Stop();
|
|
2423 |
}
|
|
2424 |
|
|
2425 |
void CTestStepPlayerPlayPausePlay::MapcPlayComplete(TInt aError)
|
|
2426 |
{
|
|
2427 |
INFO_PRINTF1(_L("finished with this test step"));
|
|
2428 |
iError = aError;
|
|
2429 |
|
|
2430 |
if (!iError)
|
|
2431 |
iTestStepResult = EPass;
|
|
2432 |
|
|
2433 |
CActiveScheduler::Stop();
|
|
2434 |
}
|
|
2435 |
|
|
2436 |
/**
|
|
2437 |
*
|
|
2438 |
* Test step Preamble.
|
|
2439 |
*
|
|
2440 |
* @xxxx
|
|
2441 |
*
|
|
2442 |
*/
|
|
2443 |
enum TVerdict CTestStepPlayerPlayPausePlay::DoTestStepPreambleL(void)
|
|
2444 |
{
|
|
2445 |
enum TVerdict verdict;
|
|
2446 |
// this installs the scheduler
|
|
2447 |
verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL();
|
|
2448 |
|
|
2449 |
// Printing to the console and log file
|
|
2450 |
INFO_PRINTF1(_L("MM-MMF-ACLNT-U-0958-HP"));
|
|
2451 |
INFO_PRINTF1(_L("This test checks that a paused playback at position 0 will resume and complete, as part of DEF070060"));
|
|
2452 |
|
|
2453 |
iError = KErrNone; //KErrTimedOut;
|
|
2454 |
|
|
2455 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioFNameMeta"), iFileName))
|
|
2456 |
{
|
|
2457 |
return EInconclusive;
|
|
2458 |
}
|
|
2459 |
|
|
2460 |
iPlayer = CMMFMdaAudioPlayerUtility::NewFilePlayerL(iFileName, *this);
|
|
2461 |
CActiveScheduler::Start();
|
|
2462 |
User::After(1000000);
|
|
2463 |
|
|
2464 |
if (iPlayer == NULL ||
|
|
2465 |
iError != KErrNone )
|
|
2466 |
return EInconclusive;
|
|
2467 |
|
|
2468 |
return verdict;
|
|
2469 |
}
|
|
2470 |
|
|
2471 |
/**
|
|
2472 |
*
|
|
2473 |
* Test step Postamble.
|
|
2474 |
*
|
|
2475 |
* @xxxx
|
|
2476 |
*
|
|
2477 |
*/
|
|
2478 |
enum TVerdict CTestStepPlayerPlayPausePlay::DoTestStepPostambleL(void)
|
|
2479 |
{
|
|
2480 |
delete iPlayer;
|
|
2481 |
iPlayer = NULL;
|
|
2482 |
//[ Destroy the scheduler ]
|
|
2483 |
return CTestStepUnitMMFAudClient::DoTestStepPostambleL();
|
|
2484 |
}
|
|
2485 |
|
|
2486 |
/**
|
|
2487 |
*
|
|
2488 |
* Do the test step.
|
|
2489 |
* Each test step must supply an implementation for DoTestStepL.
|
|
2490 |
*
|
|
2491 |
* @return "TVerdict"
|
|
2492 |
* The result of the test step
|
|
2493 |
*
|
|
2494 |
* @xxxx
|
|
2495 |
*
|
|
2496 |
*/
|
|
2497 |
TVerdict CTestStepPlayerPlayPausePlay::DoTestStepL()
|
|
2498 |
{
|
|
2499 |
iTestStepResult = EFail;
|
|
2500 |
|
|
2501 |
iPlayer->Play();
|
|
2502 |
iPlayer->Pause();
|
|
2503 |
iPlayer->Play();
|
|
2504 |
CActiveScheduler::Start();
|
|
2505 |
// test steps return a result
|
|
2506 |
return iTestStepResult;
|
|
2507 |
}
|
|
2508 |
|
|
2509 |
|
|
2510 |
//
|
|
2511 |
// class CTestStepPlaybackDurationInformation
|
|
2512 |
//
|
|
2513 |
|
|
2514 |
/**
|
|
2515 |
*
|
|
2516 |
* Static constructor for CTestStepPlaybackDurationInformation.
|
|
2517 |
*
|
|
2518 |
*
|
|
2519 |
* @return "CTestStepPlaybackDurationInformation*"
|
|
2520 |
* The constructed CTestStepPlaybackDurationInformation
|
|
2521 |
*
|
|
2522 |
* @xxxx
|
|
2523 |
*
|
|
2524 |
*/
|
|
2525 |
CTestStepPlaybackDurationInformation* CTestStepPlaybackDurationInformation::NewL()
|
|
2526 |
{
|
|
2527 |
CTestStepPlaybackDurationInformation* self = new(ELeave) CTestStepPlaybackDurationInformation;
|
|
2528 |
return self;
|
|
2529 |
}
|
|
2530 |
|
|
2531 |
/**
|
|
2532 |
*
|
|
2533 |
* Test step constructor.
|
|
2534 |
* Each test step initialises its own name.
|
|
2535 |
*
|
|
2536 |
* @xxxx
|
|
2537 |
*
|
|
2538 |
*/
|
|
2539 |
CTestStepPlaybackDurationInformation::CTestStepPlaybackDurationInformation()
|
|
2540 |
{
|
|
2541 |
iTestStepResult = EPass;
|
|
2542 |
// store the name of this test case
|
|
2543 |
// this is the name that is used by the script file
|
|
2544 |
iTestStepName = _L("MM-MMF-ACLNT-U-0960-HP");
|
|
2545 |
}
|
|
2546 |
|
|
2547 |
/**
|
|
2548 |
*
|
|
2549 |
* Test step destructor.
|
|
2550 |
*
|
|
2551 |
* @xxxx
|
|
2552 |
*
|
|
2553 |
*/
|
|
2554 |
CTestStepPlaybackDurationInformation::~CTestStepPlaybackDurationInformation()
|
|
2555 |
{
|
|
2556 |
}
|
|
2557 |
|
|
2558 |
/**
|
|
2559 |
* Implementation of the MMdaAudioPlayerCallback interface functions
|
|
2560 |
**/
|
|
2561 |
void CTestStepPlaybackDurationInformation::MapcInitComplete(TInt aError,
|
|
2562 |
const TTimeIntervalMicroSeconds &/*aDuration*/)
|
|
2563 |
{
|
|
2564 |
iError = aError;
|
|
2565 |
CActiveScheduler::Stop();
|
|
2566 |
}
|
|
2567 |
|
|
2568 |
void CTestStepPlaybackDurationInformation::MapcPlayComplete(TInt)
|
|
2569 |
{
|
|
2570 |
}
|
|
2571 |
|
|
2572 |
/**
|
|
2573 |
*
|
|
2574 |
* Test step Preamble.
|
|
2575 |
*
|
|
2576 |
* @xxxx
|
|
2577 |
*
|
|
2578 |
*/
|
|
2579 |
enum TVerdict CTestStepPlaybackDurationInformation::DoTestStepPreambleL(void)
|
|
2580 |
{
|
|
2581 |
enum TVerdict verdict;
|
|
2582 |
// this installs the scheduler
|
|
2583 |
verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL();
|
|
2584 |
|
|
2585 |
// Printing to the console and log file
|
|
2586 |
INFO_PRINTF1(_L("MM-MMF-ACLNT-U-0960-HP"));
|
|
2587 |
|
|
2588 |
INFO_PRINTF1(_L("This test checks that CMdaAudioPlayerUtility::Duration(TTimeIntervalMicroSeconds &) returns TMMFDurationInfo::EMMFDurationInfoValid"));
|
|
2589 |
|
|
2590 |
iError = KErrNone;
|
|
2591 |
|
|
2592 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioFNameMeta"), iFileName))
|
|
2593 |
{
|
|
2594 |
return EInconclusive;
|
|
2595 |
}
|
|
2596 |
|
|
2597 |
//
|
|
2598 |
// Setup player with dummy file
|
|
2599 |
iPlayer = CMdaAudioPlayerUtility::NewFilePlayerL(iFileName, *this);
|
|
2600 |
|
|
2601 |
CActiveScheduler::Start();
|
|
2602 |
User::After(1000000);
|
|
2603 |
|
|
2604 |
if (iPlayer == NULL ||
|
|
2605 |
iError != KErrNone )
|
|
2606 |
return EInconclusive;
|
|
2607 |
|
|
2608 |
return verdict;
|
|
2609 |
}
|
|
2610 |
|
|
2611 |
/**
|
|
2612 |
*
|
|
2613 |
* Test step Postamble.
|
|
2614 |
*
|
|
2615 |
* @xxxx
|
|
2616 |
*
|
|
2617 |
*/
|
|
2618 |
enum TVerdict CTestStepPlaybackDurationInformation::DoTestStepPostambleL(void)
|
|
2619 |
{
|
|
2620 |
delete iPlayer;
|
|
2621 |
iPlayer = NULL;
|
|
2622 |
//[ Destroy the scheduler ]
|
|
2623 |
return CTestStepUnitMMFAudClient::DoTestStepPostambleL();
|
|
2624 |
}
|
|
2625 |
|
|
2626 |
/**
|
|
2627 |
*
|
|
2628 |
* Do the test step.
|
|
2629 |
* Each test step must supply an implementation for DoTestStepL.
|
|
2630 |
*
|
|
2631 |
* @return "TVerdict"
|
|
2632 |
* The result of the test step
|
|
2633 |
*
|
|
2634 |
* @xxxx
|
|
2635 |
*
|
|
2636 |
*/
|
|
2637 |
TVerdict CTestStepPlaybackDurationInformation::DoTestStepL()
|
|
2638 |
{
|
|
2639 |
iTestStepResult = EFail;
|
|
2640 |
|
|
2641 |
// Check that the duration state is TMMFDurationInfo::EMMFDurationInfoValid - known.
|
|
2642 |
TTimeIntervalMicroSeconds result2 = 0;
|
|
2643 |
TMMFDurationInfo result = iPlayer->Duration(result2);
|
|
2644 |
|
|
2645 |
if ( result == EMMFDurationInfoValid )
|
|
2646 |
{
|
|
2647 |
iTestStepResult = EPass;
|
|
2648 |
}
|
|
2649 |
else
|
|
2650 |
{
|
|
2651 |
iTestStepResult = EFail;
|
|
2652 |
}
|
|
2653 |
|
|
2654 |
// test steps return a result
|
|
2655 |
return iTestStepResult;
|
|
2656 |
}
|
|
2657 |
|
|
2658 |
|
|
2659 |
//
|
|
2660 |
//
|
|
2661 |
// --------------------------------------------
|
|
2662 |
//
|
|
2663 |
/**
|
|
2664 |
*
|
|
2665 |
* Static constructor for CTestStepPlayerCheckImplementationInfo.
|
|
2666 |
*
|
|
2667 |
*
|
|
2668 |
* @return "CTestStepPlayerCheckImplementationInfo*"
|
|
2669 |
* The constructed CTestStepPlayerCheckImplementationInfo
|
|
2670 |
*
|
|
2671 |
* @xxxx
|
|
2672 |
*
|
|
2673 |
*/
|
|
2674 |
CTestStepPlayerCheckImplementationInfo* CTestStepPlayerCheckImplementationInfo::NewL()
|
|
2675 |
{
|
|
2676 |
CTestStepPlayerCheckImplementationInfo* self = new(ELeave) CTestStepPlayerCheckImplementationInfo;
|
|
2677 |
return self;
|
|
2678 |
}
|
|
2679 |
|
|
2680 |
/**
|
|
2681 |
*
|
|
2682 |
* Test step constructor.
|
|
2683 |
* Each test step initialises its own name.
|
|
2684 |
*
|
|
2685 |
* @xxxx
|
|
2686 |
*
|
|
2687 |
*/
|
|
2688 |
CTestStepPlayerCheckImplementationInfo::CTestStepPlayerCheckImplementationInfo()
|
|
2689 |
{
|
|
2690 |
iTestStepResult = EPass;
|
|
2691 |
// store the name of this test case
|
|
2692 |
// this is the name that is used by the script file
|
|
2693 |
iTestStepName = _L("MM-MMF-ACLNT-U-1004-HP");
|
|
2694 |
}
|
|
2695 |
|
|
2696 |
/**
|
|
2697 |
*
|
|
2698 |
* Test step destructor.
|
|
2699 |
*
|
|
2700 |
* @xxxx
|
|
2701 |
*
|
|
2702 |
*/
|
|
2703 |
CTestStepPlayerCheckImplementationInfo::~CTestStepPlayerCheckImplementationInfo()
|
|
2704 |
{
|
|
2705 |
}
|
|
2706 |
|
|
2707 |
/**
|
|
2708 |
* Implementation of the MMdaAudioPlayerCallback interface functions
|
|
2709 |
**/
|
|
2710 |
void CTestStepPlayerCheckImplementationInfo::MapcInitComplete(TInt aError,
|
|
2711 |
const TTimeIntervalMicroSeconds &/*aDuration*/)
|
|
2712 |
{
|
|
2713 |
iError = aError;
|
|
2714 |
CActiveScheduler::Stop();
|
|
2715 |
}
|
|
2716 |
|
|
2717 |
void CTestStepPlayerCheckImplementationInfo::MapcPlayComplete(TInt aError)
|
|
2718 |
{
|
|
2719 |
iError = aError;
|
|
2720 |
CActiveScheduler::Stop();
|
|
2721 |
}
|
|
2722 |
|
|
2723 |
/**
|
|
2724 |
*
|
|
2725 |
* Test step Preamble.
|
|
2726 |
*
|
|
2727 |
* @xxxx
|
|
2728 |
*
|
|
2729 |
*/
|
|
2730 |
TVerdict CTestStepPlayerCheckImplementationInfo::DoTestStepPreambleL(void)
|
|
2731 |
{
|
|
2732 |
// this installs the scheduler
|
|
2733 |
TVerdict verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL();
|
|
2734 |
if (verdict != EPass)
|
|
2735 |
{
|
|
2736 |
return verdict;
|
|
2737 |
}
|
|
2738 |
|
|
2739 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioPlayFName1"), iFileName))
|
|
2740 |
{
|
|
2741 |
return EInconclusive;
|
|
2742 |
}
|
|
2743 |
|
|
2744 |
// Printing to the console and log file
|
|
2745 |
INFO_PRINTF1(iTestStepName);
|
|
2746 |
INFO_PRINTF1(_L("this test tests CMMFMdaAudioPlayerUtility::ControllerImplementationInformationL()"));
|
|
2747 |
|
|
2748 |
return verdict;
|
|
2749 |
}
|
|
2750 |
|
|
2751 |
/**
|
|
2752 |
*
|
|
2753 |
* Test step Postamble.
|
|
2754 |
*
|
|
2755 |
* @xxxx
|
|
2756 |
*
|
|
2757 |
*/
|
|
2758 |
TVerdict CTestStepPlayerCheckImplementationInfo::DoTestStepPostambleL(void)
|
|
2759 |
{
|
|
2760 |
//[ Destroy the scheduler ]
|
|
2761 |
return CTestStepUnitMMFAudClient::DoTestStepPostambleL();
|
|
2762 |
}
|
|
2763 |
|
|
2764 |
/**
|
|
2765 |
*
|
|
2766 |
* Do the test step.
|
|
2767 |
* Each test step must supply an implementation for DoTestStepL.
|
|
2768 |
*
|
|
2769 |
* @return "TVerdict"
|
|
2770 |
* The result of the test step
|
|
2771 |
*
|
|
2772 |
* @xxxx
|
|
2773 |
*
|
|
2774 |
*/
|
|
2775 |
TVerdict CTestStepPlayerCheckImplementationInfo::DoTestStepL()
|
|
2776 |
{
|
|
2777 |
TInt err = KErrNone;
|
|
2778 |
iTestStepResult = EFail;
|
|
2779 |
|
|
2780 |
iPlayer = CMMFMdaAudioPlayerUtility::NewFilePlayerL(iFileName, *this);
|
|
2781 |
CActiveScheduler::Start();
|
|
2782 |
|
|
2783 |
if (iError != KErrNone)
|
|
2784 |
{
|
|
2785 |
return EInconclusive;
|
|
2786 |
}
|
|
2787 |
|
|
2788 |
const CMMFControllerImplementationInformation* info = NULL;
|
|
2789 |
|
|
2790 |
TRAP(err, info = &iPlayer->ControllerImplementationInformationL());
|
|
2791 |
if (err != KErrNone)
|
|
2792 |
{
|
|
2793 |
return EFail;
|
|
2794 |
}
|
|
2795 |
|
|
2796 |
TBuf<40> displayName;
|
|
2797 |
displayName.Copy(info->DisplayName());
|
|
2798 |
|
|
2799 |
iPlayer->Close();
|
|
2800 |
|
|
2801 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioFNameTestController"), iFileName))
|
|
2802 |
{
|
|
2803 |
return EInconclusive;
|
|
2804 |
}
|
|
2805 |
|
|
2806 |
err = OpenFileWithTestControllerL(iPlayer,iFileName);
|
|
2807 |
// no callback, since we skipped this
|
|
2808 |
if (err != KErrNone)
|
|
2809 |
{
|
|
2810 |
return EInconclusive;
|
|
2811 |
}
|
|
2812 |
|
|
2813 |
TRAP(err, info = &iPlayer->ControllerImplementationInformationL());
|
|
2814 |
|
|
2815 |
if(info->DisplayName().Compare(displayName) != 0)
|
|
2816 |
{
|
|
2817 |
iTestStepResult = EPass;
|
|
2818 |
}
|
|
2819 |
else
|
|
2820 |
{
|
|
2821 |
iTestStepResult = EFail;
|
|
2822 |
}
|
|
2823 |
|
|
2824 |
delete iPlayer;
|
|
2825 |
iPlayer = NULL;
|
|
2826 |
|
|
2827 |
INFO_PRINTF1(_L("finished with this test step"));
|
|
2828 |
// test steps return a result
|
|
2829 |
return iTestStepResult;
|
|
2830 |
}
|
|
2831 |
|