0
|
1 |
// Copyright (c) 2005-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 |
//
|
|
15 |
|
|
16 |
#include "teststepoggctrlplay.h"
|
|
17 |
|
|
18 |
/**
|
|
19 |
*
|
|
20 |
* Test step constructor.
|
|
21 |
* It initialises its own name and the input filename
|
|
22 |
*
|
|
23 |
*/
|
|
24 |
RTestStepOggCtrlPlay::RTestStepOggCtrlPlay(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
|
|
25 |
:RTestStepOggCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
|
|
26 |
{
|
|
27 |
}
|
|
28 |
/**
|
|
29 |
* Do the test step.
|
|
30 |
* This test Primes the OggPlayController and Plays an Ogg file to its completion
|
|
31 |
* and checks for the proper play completion
|
|
32 |
*/
|
|
33 |
TVerdict RTestStepOggCtrlPlay::DoTestStepL( void )
|
|
34 |
{
|
|
35 |
INFO_PRINTF1(_L("this step plays an Ogg file "));
|
|
36 |
TInt errorCode = iController.Prime();
|
|
37 |
if(errorCode)
|
|
38 |
{
|
|
39 |
INFO_PRINTF2(_L("Prime is failed with %d "), errorCode);
|
|
40 |
return EFail;
|
|
41 |
}
|
|
42 |
errorCode = iController.Play();
|
|
43 |
if(errorCode)
|
|
44 |
{
|
|
45 |
INFO_PRINTF2(_L("Play() is failed with %d "), errorCode);
|
|
46 |
return EFail;
|
|
47 |
}
|
|
48 |
CActiveScheduler::Start();
|
|
49 |
return iTestStepResult;
|
|
50 |
}
|
|
51 |
|
|
52 |
/**
|
|
53 |
*
|
|
54 |
* Test step constructor.
|
|
55 |
* It initialises its own name and the input filename
|
|
56 |
*
|
|
57 |
*/
|
|
58 |
RTestStepOggCtrlVolume::RTestStepOggCtrlVolume(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
|
|
59 |
:RTestStepOggCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
|
|
60 |
{
|
|
61 |
}
|
|
62 |
|
|
63 |
/**
|
|
64 |
* Do the test step.
|
|
65 |
* This tests setting the volume on OggPlayController in Stopped, Primed and Playing
|
|
66 |
* states and checks if the volume set is same as the volume got.
|
|
67 |
*/
|
|
68 |
TVerdict RTestStepOggCtrlVolume::DoTestStepL( void )
|
|
69 |
{
|
|
70 |
INFO_PRINTF1(_L("this step tests SetVolume/GetVolume() APIs of OggPlayController "));
|
|
71 |
RMMFAudioPlayDeviceCustomCommands theCommander( iController );
|
|
72 |
TInt maxVolume(0);
|
|
73 |
TInt errorCode =theCommander.GetMaxVolume( maxVolume );
|
|
74 |
if(errorCode)
|
|
75 |
{
|
|
76 |
INFO_PRINTF2(_L("GetMaxVolume() is failed with %d "), errorCode);
|
|
77 |
return EInconclusive;
|
|
78 |
}
|
|
79 |
|
|
80 |
TInt theVolume = maxVolume /2;
|
|
81 |
//try setting volume in Stopped State
|
|
82 |
errorCode =theCommander.SetVolume(theVolume);
|
|
83 |
if(errorCode)
|
|
84 |
{
|
|
85 |
INFO_PRINTF2(_L("SetVolume() during Stopped State is failed with %d "), errorCode);
|
|
86 |
return EFail;
|
|
87 |
}
|
|
88 |
TInt theNewVolume (0);
|
|
89 |
errorCode =theCommander.GetVolume(theNewVolume);
|
|
90 |
if(errorCode)
|
|
91 |
{
|
|
92 |
INFO_PRINTF2(_L("GetVolume() during Stopped State is failed with %d "), errorCode);
|
|
93 |
return EFail;
|
|
94 |
}
|
|
95 |
if( theNewVolume != theVolume )
|
|
96 |
{
|
|
97 |
INFO_PRINTF1(_L("Set and Get Volumes are different during Stopped State"));
|
|
98 |
return EFail;
|
|
99 |
}
|
|
100 |
errorCode = iController.Prime();
|
|
101 |
if(errorCode)
|
|
102 |
{
|
|
103 |
INFO_PRINTF2(_L("Prime is failed with %d "), errorCode);
|
|
104 |
return EInconclusive;
|
|
105 |
}
|
|
106 |
//try setting volume in Primed State
|
|
107 |
errorCode =theCommander.SetVolume(theVolume);
|
|
108 |
if(errorCode)
|
|
109 |
{
|
|
110 |
INFO_PRINTF2(_L("SetVolume() during Primed State is failed with %d "), errorCode);
|
|
111 |
return EFail;
|
|
112 |
}
|
|
113 |
errorCode =theCommander.GetVolume(theNewVolume);
|
|
114 |
if(errorCode)
|
|
115 |
{
|
|
116 |
INFO_PRINTF2(_L("GetVolume() during Primed State is failed with %d "), errorCode);
|
|
117 |
return EFail;
|
|
118 |
}
|
|
119 |
if( theNewVolume != theVolume )
|
|
120 |
{
|
|
121 |
INFO_PRINTF1(_L("Set and Get Volumes are different during Primed State"));
|
|
122 |
return EFail;
|
|
123 |
}
|
|
124 |
errorCode = iController.Play();
|
|
125 |
if(errorCode)
|
|
126 |
{
|
|
127 |
INFO_PRINTF2(_L("Play() is failed with %d "), errorCode);
|
|
128 |
return EInconclusive;
|
|
129 |
}
|
|
130 |
//try setting volume in Playing State
|
|
131 |
errorCode =theCommander.SetVolume(theVolume);
|
|
132 |
if(errorCode)
|
|
133 |
{
|
|
134 |
INFO_PRINTF2(_L("SetVolume() during Playing State is failed with %d "), errorCode);
|
|
135 |
iController.Stop();
|
|
136 |
return EFail;
|
|
137 |
}
|
|
138 |
errorCode =theCommander.GetVolume(theNewVolume);
|
|
139 |
if(errorCode)
|
|
140 |
{
|
|
141 |
INFO_PRINTF2(_L("GetVolume() during Playing State is failed with %d "), errorCode);
|
|
142 |
iController.Stop();
|
|
143 |
return EFail;
|
|
144 |
}
|
|
145 |
if(theNewVolume != theVolume)
|
|
146 |
{
|
|
147 |
//stop the controller
|
|
148 |
INFO_PRINTF1(_L("Set and Get Volumes are different during Playing State"));
|
|
149 |
iController.Stop();
|
|
150 |
return EFail;
|
|
151 |
}
|
|
152 |
//get the play completion event
|
|
153 |
CActiveScheduler::Start();
|
|
154 |
return iTestStepResult;
|
|
155 |
}
|
|
156 |
|
|
157 |
/**
|
|
158 |
*
|
|
159 |
* Test step constructor.
|
|
160 |
* It initialises its own name and the input filename
|
|
161 |
*
|
|
162 |
*/
|
|
163 |
RTestStepOggCtrlPlayBalance::RTestStepOggCtrlPlayBalance(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
|
|
164 |
:RTestStepOggCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
|
|
165 |
{
|
|
166 |
}
|
|
167 |
|
|
168 |
/**
|
|
169 |
* Do the test step.
|
|
170 |
* This tests setting the PlayBalance on OggPlayController in Stopped, Primed and Playing
|
|
171 |
* states and checks if the PlayBalance set is same as the PlayBalance got.
|
|
172 |
*/
|
|
173 |
TVerdict RTestStepOggCtrlPlayBalance::DoTestStepL( void )
|
|
174 |
{
|
|
175 |
INFO_PRINTF1(_L("this step tests SetBalance/GetBalance() APIs of OggPlayController "));
|
|
176 |
RMMFAudioPlayDeviceCustomCommands theCommander( iController );
|
|
177 |
TInt theBalance = (30 * (KMMFBalanceMaxRight-KMMFBalanceMaxLeft))/100 + KMMFBalanceMaxLeft;
|
|
178 |
TInt errorCode = theCommander.SetBalance( theBalance );
|
|
179 |
if(errorCode)
|
|
180 |
{
|
|
181 |
INFO_PRINTF2(_L("SetBalance() during Stopped State is failed with %d "), errorCode);
|
|
182 |
return EFail;
|
|
183 |
}
|
|
184 |
TInt theNewBalance (0);
|
|
185 |
errorCode =theCommander.GetBalance( theNewBalance );
|
|
186 |
if(errorCode)
|
|
187 |
{
|
|
188 |
INFO_PRINTF2(_L("GetVolume() during Stopped State is failed with %d "), errorCode);
|
|
189 |
return EFail;
|
|
190 |
}
|
|
191 |
if( theNewBalance != theBalance )
|
|
192 |
{
|
|
193 |
INFO_PRINTF1(_L("Set and Get Balances are different during Stopped State"));
|
|
194 |
return EFail;
|
|
195 |
}
|
|
196 |
errorCode = iController.Prime();
|
|
197 |
if(errorCode)
|
|
198 |
{
|
|
199 |
INFO_PRINTF2(_L("Prime is failed with %d "), errorCode);
|
|
200 |
return EInconclusive;
|
|
201 |
}
|
|
202 |
errorCode = theCommander.SetBalance( theBalance );
|
|
203 |
if(errorCode)
|
|
204 |
{
|
|
205 |
INFO_PRINTF2(_L("SetBalance() during Primed State is failed with %d "), errorCode);
|
|
206 |
return EFail;
|
|
207 |
}
|
|
208 |
errorCode =theCommander.GetBalance( theNewBalance );
|
|
209 |
if(errorCode)
|
|
210 |
{
|
|
211 |
INFO_PRINTF2(_L("GetBalance() during Primed State is failed with %d "), errorCode);
|
|
212 |
return EFail;
|
|
213 |
}
|
|
214 |
if( theNewBalance != theBalance )
|
|
215 |
{
|
|
216 |
INFO_PRINTF1(_L("Set and Get Balances are different during Primed State"));
|
|
217 |
return EFail;
|
|
218 |
}
|
|
219 |
errorCode = iController.Play();
|
|
220 |
if(errorCode)
|
|
221 |
{
|
|
222 |
INFO_PRINTF2(_L("Play() is failed with %d "), errorCode);
|
|
223 |
return EInconclusive;
|
|
224 |
}
|
|
225 |
errorCode =theCommander.SetBalance(theBalance);
|
|
226 |
if(errorCode)
|
|
227 |
{
|
|
228 |
INFO_PRINTF2(_L("SetBalance() during Playing State is failed with %d "), errorCode);
|
|
229 |
iController.Stop();
|
|
230 |
return EFail;
|
|
231 |
}
|
|
232 |
errorCode =theCommander.GetBalance(theNewBalance);
|
|
233 |
if(errorCode)
|
|
234 |
{
|
|
235 |
INFO_PRINTF2(_L("GetBalance() during Playing State is failed with %d "), errorCode);
|
|
236 |
iController.Stop();
|
|
237 |
return EFail;
|
|
238 |
}
|
|
239 |
if(theNewBalance != theBalance)
|
|
240 |
{
|
|
241 |
//stop the controller
|
|
242 |
INFO_PRINTF1(_L("Set and Get Balances are different during Playing State"));
|
|
243 |
iController.Stop();
|
|
244 |
return EFail;
|
|
245 |
}
|
|
246 |
//get the play completion event
|
|
247 |
CActiveScheduler::Start();
|
|
248 |
return iTestStepResult;
|
|
249 |
}
|
|
250 |
|
|
251 |
/**
|
|
252 |
*
|
|
253 |
* Test step constructor.
|
|
254 |
* It initialises its own name and the input filename
|
|
255 |
*
|
|
256 |
*/
|
|
257 |
RTestStepOggCtrlPosition::RTestStepOggCtrlPosition(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
|
|
258 |
:RTestStepOggCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
|
|
259 |
{
|
|
260 |
}
|
|
261 |
|
|
262 |
/**
|
|
263 |
* Do the test step.
|
|
264 |
* This tests setting the Position on OggPlayController in Stopped, Primed and Playing
|
|
265 |
* states and checks if the Position set is same as the Position got. It expects KErrNotReady
|
|
266 |
* error during Stopped state.
|
|
267 |
*/
|
|
268 |
TVerdict RTestStepOggCtrlPosition::DoTestStepL(void)
|
|
269 |
{
|
|
270 |
INFO_PRINTF1(_L("this step tests SetPosition/GetPosition() APIs of OggPlayController "));
|
|
271 |
TTimeIntervalMicroSeconds theDuration;
|
|
272 |
TInt errorCode = iController.GetDuration(theDuration);
|
|
273 |
if(errorCode)
|
|
274 |
{
|
|
275 |
INFO_PRINTF2(_L("DurationL() is failed with %d "), errorCode);
|
|
276 |
return EInconclusive;
|
|
277 |
}
|
|
278 |
TInt64 duration = theDuration. Int64();
|
|
279 |
TTimeIntervalMicroSeconds thePosition(duration/2);
|
|
280 |
errorCode = iController.SetPosition(thePosition);
|
|
281 |
if(errorCode != KErrNotReady)
|
|
282 |
{
|
|
283 |
INFO_PRINTF2(_L("SetPosition() during Stopped State is failed to return KErrNotReady but returned %d "), errorCode);
|
|
284 |
return EFail;
|
|
285 |
}
|
|
286 |
errorCode = iController.Prime();
|
|
287 |
if(errorCode)
|
|
288 |
{
|
|
289 |
INFO_PRINTF2(_L("Prime is failed with %d "), errorCode);
|
|
290 |
return EInconclusive;
|
|
291 |
}
|
|
292 |
errorCode = iController.SetPosition(thePosition);
|
|
293 |
if(errorCode)
|
|
294 |
{
|
|
295 |
INFO_PRINTF2(_L("SetPosition() during Primed State is failed with %d "), errorCode);
|
|
296 |
return EFail;
|
|
297 |
}
|
|
298 |
TTimeIntervalMicroSeconds theNewPosition;
|
|
299 |
errorCode = iController.GetPosition(theNewPosition);
|
|
300 |
if(errorCode)
|
|
301 |
{
|
|
302 |
INFO_PRINTF2(_L("GetPosition() during Primed State is failed with %d "), errorCode);
|
|
303 |
return EFail;
|
|
304 |
}
|
|
305 |
/* There is a limitation in the repositioning in the vorbis stream. The position passed by the
|
|
306 |
client is converted into granulePos that is nearer to the positon passed. So when GetPosition is called
|
|
307 |
we may not get the exact position we have set using the setposition(). This is because granulePos
|
|
308 |
is same all through an oggPage and an oggPage will be of average size 6k. So the positioning is not that
|
|
309 |
precise. So the KDeviationInTime.
|
|
310 |
*/
|
|
311 |
if(!TimeComparison(theNewPosition.Int64(), thePosition.Int64(), KDeviationInTime))
|
|
312 |
{
|
|
313 |
INFO_PRINTF1(_L("Set and Get Positions are different during Primed State"));
|
|
314 |
return EFail;
|
|
315 |
}
|
|
316 |
//Reset back to the beginning before play
|
|
317 |
iController.SetPosition(TTimeIntervalMicroSeconds(0));
|
|
318 |
errorCode = iController.Play();
|
|
319 |
if(errorCode)
|
|
320 |
{
|
|
321 |
INFO_PRINTF2(_L("Play() is failed with %d "), errorCode);
|
|
322 |
return EInconclusive;
|
|
323 |
}
|
|
324 |
User::After(KTwoSeconds);
|
|
325 |
errorCode = iController.SetPosition(thePosition);
|
|
326 |
if(errorCode)
|
|
327 |
{
|
|
328 |
INFO_PRINTF2(_L("SetPosition() during Playing State is failed with %d "), errorCode);
|
|
329 |
return EFail;
|
|
330 |
}
|
|
331 |
errorCode = iController.GetPosition(theNewPosition);
|
|
332 |
if(errorCode)
|
|
333 |
{
|
|
334 |
INFO_PRINTF2(_L("GetPosition() during Playing State is failed with %d "), errorCode);
|
|
335 |
return EFail;
|
|
336 |
}
|
|
337 |
if(!TimeComparison(theNewPosition.Int64(), thePosition.Int64(), KDeviationInTime))
|
|
338 |
{
|
|
339 |
//stop the controller
|
|
340 |
INFO_PRINTF1(_L("Current Position is lessthan the Postion Set in Playing State"));
|
|
341 |
iController.Stop();
|
|
342 |
return EFail;
|
|
343 |
}
|
|
344 |
//get the play completion event
|
|
345 |
CActiveScheduler::Start();
|
|
346 |
return iTestStepResult;
|
|
347 |
}
|
|
348 |
|
|
349 |
/**
|
|
350 |
*
|
|
351 |
* Test step constructor.
|
|
352 |
* It initialises its own name and the input filename
|
|
353 |
*
|
|
354 |
*/
|
|
355 |
RTestStepOggCtrlDuration::RTestStepOggCtrlDuration(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
|
|
356 |
:RTestStepOggCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
|
|
357 |
{
|
|
358 |
}
|
|
359 |
|
|
360 |
/**
|
|
361 |
* Do the test step.
|
|
362 |
* This tests setting the Position on OggPlayController in Stopped, Primed and Playing
|
|
363 |
* states and checks if the Position set is same as the Postion got. It expects KErrNotReady
|
|
364 |
* error during Stopped state.
|
|
365 |
*/
|
|
366 |
TVerdict RTestStepOggCtrlDuration::DoTestStepL(void)
|
|
367 |
{
|
|
368 |
INFO_PRINTF1(_L("this step tests GetDuration() API of OggPlayController "));
|
|
369 |
TTimeIntervalMicroSeconds expectedtheDuration(6002426);
|
|
370 |
TTimeIntervalMicroSeconds theDuration;
|
|
371 |
TInt errorCode = iController.GetDuration(theDuration);
|
|
372 |
if(errorCode)
|
|
373 |
{
|
|
374 |
INFO_PRINTF2(_L("DurationL() is failed with %d "), errorCode);
|
|
375 |
return EFail;
|
|
376 |
}
|
|
377 |
else if(theDuration != expectedtheDuration)
|
|
378 |
{
|
|
379 |
INFO_PRINTF2(_L("GetDuration() returned the wrong duration %d "), theDuration. Int64());
|
|
380 |
return EFail;
|
|
381 |
}
|
|
382 |
errorCode = iController.Prime();
|
|
383 |
if(errorCode)
|
|
384 |
{
|
|
385 |
INFO_PRINTF2(_L("Prime is failed with %d "), errorCode);
|
|
386 |
return EInconclusive;
|
|
387 |
}
|
|
388 |
errorCode = iController.GetDuration(theDuration);
|
|
389 |
if(errorCode)
|
|
390 |
{
|
|
391 |
INFO_PRINTF2(_L("DurationL() is failed with %d "), errorCode);
|
|
392 |
return EFail;
|
|
393 |
}
|
|
394 |
else if(theDuration != expectedtheDuration)
|
|
395 |
{
|
|
396 |
INFO_PRINTF2(_L("GetDuration() returned the wrong duration %d "), theDuration. Int64());
|
|
397 |
return EFail;
|
|
398 |
}
|
|
399 |
errorCode = iController.Play();
|
|
400 |
if(errorCode)
|
|
401 |
{
|
|
402 |
INFO_PRINTF2(_L("Play() is failed with %d "), errorCode);
|
|
403 |
return EInconclusive;
|
|
404 |
}
|
|
405 |
errorCode = iController.GetDuration(theDuration);
|
|
406 |
if(errorCode)
|
|
407 |
{
|
|
408 |
INFO_PRINTF2(_L("DurationL() is failed with %d "), errorCode);
|
|
409 |
iController.Stop();
|
|
410 |
return EFail;
|
|
411 |
}
|
|
412 |
else if(theDuration != expectedtheDuration)
|
|
413 |
{
|
|
414 |
INFO_PRINTF2(_L("GetDuration() returned the wrong duration %d "), theDuration. Int64());
|
|
415 |
iController.Stop();
|
|
416 |
return EFail;
|
|
417 |
}
|
|
418 |
return EPass;
|
|
419 |
}
|
|
420 |
/**
|
|
421 |
*
|
|
422 |
* Test step constructor.
|
|
423 |
* It initialises its own name and the input filename
|
|
424 |
*
|
|
425 |
*/
|
|
426 |
RTestStepOggCtrlPause::RTestStepOggCtrlPause(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
|
|
427 |
:RTestStepOggCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
|
|
428 |
{
|
|
429 |
}
|
|
430 |
|
|
431 |
/**
|
|
432 |
* Do the test step.
|
|
433 |
* This tests the Pause functionality of the OggPlayController in Stopped, Primed and Playing
|
|
434 |
* states and checks if the Play starts from the current position. It expects KErrNotReady
|
|
435 |
* error if Pause is called during Stopped and Primed states.
|
|
436 |
*
|
|
437 |
* This test may fail as the position after pause-play may vary due to granularity and recalculation of the buffer.
|
|
438 |
*/
|
|
439 |
TVerdict RTestStepOggCtrlPause::DoTestStepL(void)
|
|
440 |
{
|
|
441 |
INFO_PRINTF1(_L("this step tests Pause() API of OggPlayController "));
|
|
442 |
TInt errorCode = iController.Pause();
|
|
443 |
if(errorCode != KErrNotReady)
|
|
444 |
{
|
|
445 |
INFO_PRINTF2(_L("Pause() during Stopped State is failed to return KErrNotReady but returned %d "), errorCode);
|
|
446 |
return EFail;
|
|
447 |
}
|
|
448 |
errorCode = iController.Prime();
|
|
449 |
if(errorCode)
|
|
450 |
{
|
|
451 |
INFO_PRINTF2(_L("Prime is failed with %d "), errorCode);
|
|
452 |
return EInconclusive;
|
|
453 |
}
|
|
454 |
errorCode = iController.Pause();
|
|
455 |
if(errorCode != KErrNotReady)
|
|
456 |
{
|
|
457 |
INFO_PRINTF2(_L("Pause() during Primed State is failed to return KErrNotReady but returned %d "), errorCode);
|
|
458 |
return EFail;
|
|
459 |
}
|
|
460 |
INFO_PRINTF1(_L("Play"));
|
|
461 |
errorCode = iController.Play();
|
|
462 |
if(errorCode)
|
|
463 |
{
|
|
464 |
INFO_PRINTF2(_L("Play() is failed with %d "), errorCode);
|
|
465 |
return EInconclusive;
|
|
466 |
}
|
|
467 |
INFO_PRINTF1(_L("Pause"));
|
|
468 |
errorCode = iController.Pause();
|
|
469 |
if(errorCode)
|
|
470 |
{
|
|
471 |
INFO_PRINTF2(_L("Pause() during Playing State is failed with %d "), errorCode);
|
|
472 |
return EFail;
|
|
473 |
}
|
|
474 |
INFO_PRINTF1(_L("GetPosition - thePosition"));
|
|
475 |
TTimeIntervalMicroSeconds thePosition;
|
|
476 |
errorCode = iController.GetPosition(thePosition);
|
|
477 |
if(errorCode)
|
|
478 |
{
|
|
479 |
INFO_PRINTF2(_L("GetPosition() after Pause is failed with %d "), errorCode);
|
|
480 |
return EFail;
|
|
481 |
}
|
|
482 |
INFO_PRINTF1(_L("Play"));
|
|
483 |
errorCode = iController.Play();
|
|
484 |
if(errorCode)
|
|
485 |
{
|
|
486 |
INFO_PRINTF2(_L("Play() after Pause() is failed with %d "), errorCode);
|
|
487 |
return EInconclusive;
|
|
488 |
}
|
|
489 |
INFO_PRINTF1(_L("GetPosition - theNewPosition"));
|
|
490 |
TTimeIntervalMicroSeconds theNewPosition;
|
|
491 |
errorCode = iController.GetPosition(theNewPosition);
|
|
492 |
INFO_PRINTF2(_L(" Paused: %d"), I64INT(thePosition.Int64()));
|
|
493 |
INFO_PRINTF2(_L(" Current: %d"), I64INT(theNewPosition.Int64()));
|
|
494 |
|
|
495 |
if(theNewPosition < thePosition)
|
|
496 |
{
|
|
497 |
//stop the controller
|
|
498 |
INFO_PRINTF1(_L("Current Position is lessthan the Paused Postion"));
|
|
499 |
ERR_PRINTF2(_L(" Paused: %d"), I64INT(thePosition.Int64()));
|
|
500 |
ERR_PRINTF2(_L(" Current: %d"), I64INT(theNewPosition.Int64()));
|
|
501 |
iController.Stop();
|
|
502 |
return EFail;
|
|
503 |
}
|
|
504 |
//get the play completion event
|
|
505 |
CActiveScheduler::Start();
|
|
506 |
return iTestStepResult;
|
|
507 |
}
|
|
508 |
/**
|
|
509 |
*
|
|
510 |
* Test step constructor.
|
|
511 |
* It initialises its own name and the input filename
|
|
512 |
*
|
|
513 |
*/
|
|
514 |
RTestStepOggCtrlStop::RTestStepOggCtrlStop(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
|
|
515 |
:RTestStepOggCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
|
|
516 |
{
|
|
517 |
}
|
|
518 |
|
|
519 |
/**
|
|
520 |
* Do the test step.
|
|
521 |
* This tests the Stop functionality of the OggPlayController in Stopped, Primed and Playing
|
|
522 |
* states It expects KErrNotReady error if Stop is called during Stopped state.
|
|
523 |
*/
|
|
524 |
TVerdict RTestStepOggCtrlStop::DoTestStepL(void)
|
|
525 |
{
|
|
526 |
INFO_PRINTF1(_L("this step tests Stop() API of OggPlayController "));
|
|
527 |
TInt errorCode = iController.Stop();
|
|
528 |
if(errorCode)
|
|
529 |
{
|
|
530 |
INFO_PRINTF2(_L("Stop() during Stopped State is failed with %d "), errorCode);
|
|
531 |
return EFail;
|
|
532 |
}
|
|
533 |
errorCode = iController.Prime();
|
|
534 |
if(errorCode)
|
|
535 |
{
|
|
536 |
INFO_PRINTF2(_L("Prime is failed with %d "), errorCode);
|
|
537 |
return EInconclusive;
|
|
538 |
}
|
|
539 |
errorCode = iController.Stop();
|
|
540 |
if(errorCode)
|
|
541 |
{
|
|
542 |
INFO_PRINTF2(_L("Stop() during Primed State is failed with %d "), errorCode);
|
|
543 |
return EFail;
|
|
544 |
}
|
|
545 |
errorCode = iController.Prime();
|
|
546 |
if(errorCode)
|
|
547 |
{
|
|
548 |
INFO_PRINTF2(_L("Prime is failed with %d "), errorCode);
|
|
549 |
return EInconclusive;
|
|
550 |
}
|
|
551 |
errorCode = iController.Play();
|
|
552 |
if(errorCode)
|
|
553 |
{
|
|
554 |
INFO_PRINTF2(_L("Play() is failed with %d "), errorCode);
|
|
555 |
return EInconclusive;
|
|
556 |
}
|
|
557 |
User::After(KTwoSeconds);
|
|
558 |
errorCode = iController.Stop();
|
|
559 |
if(errorCode)
|
|
560 |
{
|
|
561 |
INFO_PRINTF2(_L("Stop() during Playing State is failed with %d "), errorCode);
|
|
562 |
return EFail;
|
|
563 |
}
|
|
564 |
errorCode = iController.Prime();
|
|
565 |
if(errorCode)
|
|
566 |
{
|
|
567 |
INFO_PRINTF2(_L("Prime is failed with %d "), errorCode);
|
|
568 |
return EInconclusive;
|
|
569 |
}
|
|
570 |
errorCode = iController.Play();
|
|
571 |
if(errorCode)
|
|
572 |
{
|
|
573 |
INFO_PRINTF2(_L("Play() after Stop() is failed with %d "), errorCode);
|
|
574 |
return EInconclusive;
|
|
575 |
}
|
|
576 |
//get the play completion event
|
|
577 |
CActiveScheduler::Start();
|
|
578 |
return iTestStepResult;
|
|
579 |
}
|
|
580 |
/**
|
|
581 |
*
|
|
582 |
* Test step constructor.
|
|
583 |
* It initialises its own name and the input filename
|
|
584 |
*
|
|
585 |
*/
|
|
586 |
RTestStepOggCtrlMetaData::RTestStepOggCtrlMetaData(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
|
|
587 |
:RTestStepOggCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
|
|
588 |
{
|
|
589 |
}
|
|
590 |
|
|
591 |
/**
|
|
592 |
* Do the test step.
|
|
593 |
* This test tries to fetch the metadata from the Ogg file.
|
|
594 |
*
|
|
595 |
*/
|
|
596 |
TVerdict RTestStepOggCtrlMetaData::DoTestStepL(void)
|
|
597 |
{
|
|
598 |
INFO_PRINTF1(_L("this step tests GetNumberOfMetaDataEntries/GetMetaDataEntryL() APIs of OggPlayController "));
|
|
599 |
TInt numEntries = 0;
|
|
600 |
TInt errorCode = iController.GetNumberOfMetaDataEntries( numEntries );
|
|
601 |
CMMFMetaDataEntry* metaEntry = NULL;
|
|
602 |
if(errorCode)
|
|
603 |
{
|
|
604 |
INFO_PRINTF2(_L("GetNumberOfMetaDataEntries() is failed with %d "), errorCode);
|
|
605 |
return EFail;
|
|
606 |
}
|
|
607 |
if(numEntries == 0)
|
|
608 |
{
|
|
609 |
INFO_PRINTF1(_L("File does not have meta entries "));
|
|
610 |
}
|
|
611 |
else
|
|
612 |
{
|
|
613 |
for(TInt counter = 0; counter < numEntries; ++counter)
|
|
614 |
{
|
|
615 |
TRAP(errorCode, metaEntry = iController.GetMetaDataEntryL(counter));
|
|
616 |
if(errorCode)
|
|
617 |
{
|
|
618 |
INFO_PRINTF2(_L("GetMetaDataEntryL is failed with %d "), errorCode);
|
|
619 |
return EFail;
|
|
620 |
}
|
|
621 |
INFO_PRINTF3(_L("%S %S"), &metaEntry->Name(), &metaEntry->Value());
|
|
622 |
}
|
|
623 |
}
|
|
624 |
return EPass;
|
|
625 |
}
|
|
626 |
/**
|
|
627 |
*
|
|
628 |
* Test step constructor.
|
|
629 |
* It initialises its own name and the input filename
|
|
630 |
*
|
|
631 |
*/
|
|
632 |
RTestStepOggCtrlPlayWindow::RTestStepOggCtrlPlayWindow(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
|
|
633 |
:RTestStepOggCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
|
|
634 |
{
|
|
635 |
}
|
|
636 |
|
|
637 |
/**
|
|
638 |
* Do the test step.
|
|
639 |
* This tests the PlayWindow functionality of the OggPlayController.
|
|
640 |
* Sequence : Prime -> SetPlayWindow -> Play(check if the current position > PlayStart)
|
|
641 |
* Stop -> Prime -> Play(check if the current position > PlayStart)
|
|
642 |
* Stop -> Prime -> DeletePlayWindow -> Play(check if the current position <= PlayStart)
|
|
643 |
*/
|
|
644 |
TVerdict RTestStepOggCtrlPlayWindow::DoTestStepL(void)
|
|
645 |
{
|
|
646 |
INFO_PRINTF1(_L("this step tests SetPlaybackWindow/DeletePlaybackWindow() API of OggPlayController "));
|
|
647 |
TInt errorCode = iController.Prime();
|
|
648 |
if(errorCode)
|
|
649 |
{
|
|
650 |
INFO_PRINTF2(_L("Prime is failed with %d "), errorCode);
|
|
651 |
return EInconclusive;
|
|
652 |
}
|
|
653 |
TTimeIntervalMicroSeconds theDuration;
|
|
654 |
errorCode = iController.GetDuration(theDuration);
|
|
655 |
if(errorCode)
|
|
656 |
{
|
|
657 |
INFO_PRINTF2(_L("DurationL() is failed with %d "), errorCode);
|
|
658 |
return EInconclusive;
|
|
659 |
}
|
|
660 |
TInt64 duration = theDuration. Int64();
|
|
661 |
TTimeIntervalMicroSeconds thePlayStart(duration/2);
|
|
662 |
TTimeIntervalMicroSeconds thePlayEnd(duration);
|
|
663 |
RMMFAudioPlayControllerCustomCommands theCommander(iController);
|
|
664 |
errorCode = theCommander.SetPlaybackWindow(thePlayStart, thePlayEnd);
|
|
665 |
if(errorCode)
|
|
666 |
{
|
|
667 |
INFO_PRINTF2(_L("SetPlaybackWindow() is failed with %d "), errorCode);
|
|
668 |
return EFail;
|
|
669 |
}
|
|
670 |
errorCode = iController.Play();
|
|
671 |
if(errorCode)
|
|
672 |
{
|
|
673 |
INFO_PRINTF2(_L("Play() after SetPlayWindow() is failed with %d "), errorCode);
|
|
674 |
return EInconclusive;
|
|
675 |
}
|
|
676 |
TTimeIntervalMicroSeconds theNewPosition;
|
|
677 |
errorCode = iController.GetPosition(theNewPosition);
|
|
678 |
if(!TimeComparison(theNewPosition.Int64(), thePlayStart.Int64(), KDeviationInTime))
|
|
679 |
{
|
|
680 |
//stop the controller
|
|
681 |
INFO_PRINTF1(_L("Current Position is lessthan the PlayWindowStart"));
|
|
682 |
iController.Stop();
|
|
683 |
return EFail;
|
|
684 |
}
|
|
685 |
User::After(KTwoSeconds);
|
|
686 |
errorCode = iController.Stop();
|
|
687 |
if(errorCode)
|
|
688 |
{
|
|
689 |
INFO_PRINTF2(_L("Stop() with PlayWindow set is failed with %d "), errorCode);
|
|
690 |
return EFail;
|
|
691 |
}
|
|
692 |
errorCode = iController.Prime();
|
|
693 |
if(errorCode)
|
|
694 |
{
|
|
695 |
INFO_PRINTF2(_L("Prime with PlayWindow set is failed with %d "), errorCode);
|
|
696 |
return EInconclusive;
|
|
697 |
}
|
|
698 |
errorCode = iController.Play();
|
|
699 |
if(errorCode)
|
|
700 |
{
|
|
701 |
INFO_PRINTF2(_L("Play() with PlayWindow is failed with %d "), errorCode);
|
|
702 |
return EInconclusive;
|
|
703 |
}
|
|
704 |
errorCode = iController.GetPosition(theNewPosition);
|
|
705 |
if(!TimeComparison(theNewPosition.Int64(), thePlayStart.Int64(), KDeviationInTime))
|
|
706 |
{
|
|
707 |
//stop the controller
|
|
708 |
INFO_PRINTF1(_L("Current Position is lessthan the PlayWindowStart(Second Play)"));
|
|
709 |
iController.Stop();
|
|
710 |
return EFail;
|
|
711 |
}
|
|
712 |
User::After(KTwoSeconds);
|
|
713 |
errorCode = iController.Stop();
|
|
714 |
if(errorCode)
|
|
715 |
{
|
|
716 |
INFO_PRINTF2(_L("Stop() with PlayWindow set is failed with %d "), errorCode);
|
|
717 |
return EFail;
|
|
718 |
}
|
|
719 |
errorCode = iController.Prime();
|
|
720 |
if(errorCode)
|
|
721 |
{
|
|
722 |
INFO_PRINTF2(_L("Prime with PlayWindow set is failed with %d "), errorCode);
|
|
723 |
return EFail;
|
|
724 |
}
|
|
725 |
errorCode = theCommander.DeletePlaybackWindow();
|
|
726 |
if(errorCode)
|
|
727 |
{
|
|
728 |
INFO_PRINTF2(_L("DeletePlaybackWindow() is failed with %d "), errorCode);
|
|
729 |
return EFail;
|
|
730 |
}
|
|
731 |
errorCode = iController.Play();
|
|
732 |
if(errorCode)
|
|
733 |
{
|
|
734 |
INFO_PRINTF2(_L("Play() after DeletePlaybackWindow is failed with %d "), errorCode);
|
|
735 |
return EFail;
|
|
736 |
}
|
|
737 |
errorCode = iController.GetPosition(theNewPosition);
|
|
738 |
if(theNewPosition > thePlayStart)
|
|
739 |
{
|
|
740 |
//stop the controller
|
|
741 |
INFO_PRINTF1(_L("PlaybackWindow is not deleted properly"));
|
|
742 |
iController.Stop();
|
|
743 |
return EFail;
|
|
744 |
}
|
|
745 |
//get the play completion event
|
|
746 |
CActiveScheduler::Start();
|
|
747 |
return iTestStepResult;
|
|
748 |
}
|
|
749 |
|
|
750 |
/**
|
|
751 |
*
|
|
752 |
* Test step constructor.
|
|
753 |
* It initialises its own name and the input filename
|
|
754 |
*
|
|
755 |
*/
|
|
756 |
RTestStepOggCtrlGetSetConfig::RTestStepOggCtrlGetSetConfig(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
|
|
757 |
:RTestStepOggCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
|
|
758 |
{
|
|
759 |
}
|
|
760 |
|
|
761 |
/**
|
|
762 |
* Do the test step.
|
|
763 |
* This test tries to fetch the audio configuration from the Ogg file
|
|
764 |
* and compares with the expected configuration.
|
|
765 |
*/
|
|
766 |
TVerdict RTestStepOggCtrlGetSetConfig::DoTestStepL(void)
|
|
767 |
{
|
|
768 |
INFO_PRINTF1(_L("this step tests setting and getting audio configuration on OggPlayController "));
|
|
769 |
RMMFAudioControllerCustomCommands theCommander( iController );
|
|
770 |
TUint theRate = 0;
|
|
771 |
const TUint KExpectedBitRate = 128000;
|
|
772 |
const TUint KExpectedSampleRate = 44100;
|
|
773 |
const TUint KExpectedSourceChannels = 2;
|
|
774 |
TInt errorCode = theCommander.GetSourceBitRate(theRate);
|
|
775 |
if(errorCode)
|
|
776 |
{
|
|
777 |
INFO_PRINTF2(_L("GetSourceBitRate() is failed with %d "), errorCode);
|
|
778 |
return EFail;
|
|
779 |
}
|
|
780 |
else if(theRate != KExpectedBitRate)
|
|
781 |
{
|
|
782 |
INFO_PRINTF2(_L("GetSourceBitRate() returned the wrong bitrate %d "), theRate);
|
|
783 |
return EFail;
|
|
784 |
}
|
|
785 |
errorCode = theCommander.GetSourceSampleRate(theRate);
|
|
786 |
if(errorCode)
|
|
787 |
{
|
|
788 |
INFO_PRINTF2(_L("GetSourceSampleRate() is failed with %d "), errorCode);
|
|
789 |
return EFail;
|
|
790 |
}
|
|
791 |
else if(theRate != KExpectedSampleRate)
|
|
792 |
{
|
|
793 |
INFO_PRINTF2(_L("GetSourceBitRate() returned the wrong samplerate %d "), theRate);
|
|
794 |
return EFail;
|
|
795 |
}
|
|
796 |
errorCode = theCommander.GetSourceNumChannels(theRate);
|
|
797 |
if(errorCode)
|
|
798 |
{
|
|
799 |
INFO_PRINTF2(_L("GetSourceNumChannels() is failed with %d "), errorCode);
|
|
800 |
return EFail;
|
|
801 |
}
|
|
802 |
else if(theRate != KExpectedSourceChannels)
|
|
803 |
{
|
|
804 |
INFO_PRINTF2(_L("GetSourceNumChannels() returned the wrong value %d "), theRate);
|
|
805 |
return EFail;
|
|
806 |
}
|
|
807 |
TUid formatUid;
|
|
808 |
errorCode = theCommander.GetSourceFormat(formatUid);
|
|
809 |
if(errorCode)
|
|
810 |
{
|
|
811 |
INFO_PRINTF2(_L("GetSourceFormat(() during Stopped State is failed with %d "), errorCode);
|
|
812 |
return EFail;
|
|
813 |
}
|
|
814 |
if(formatUid != KOggDecodeUid)
|
|
815 |
{
|
|
816 |
INFO_PRINTF2(_L("GetSourceFormat() returned the wrong value %d "), formatUid.iUid);
|
|
817 |
return EFail;
|
|
818 |
}
|
|
819 |
TFourCC dataType(0);
|
|
820 |
errorCode =theCommander.GetSourceDataType(dataType);
|
|
821 |
if(errorCode)
|
|
822 |
{
|
|
823 |
INFO_PRINTF2(_L("GetSourceDataType() during Stopped State is failed with %d "), errorCode);
|
|
824 |
return EFail;
|
|
825 |
}
|
|
826 |
if( dataType != TFourCC('V', 'O', 'R', 'B') )
|
|
827 |
{
|
|
828 |
INFO_PRINTF1(_L("GetSourceDataType() returned datatype different from VORB "));
|
|
829 |
return EFail;
|
|
830 |
}
|
|
831 |
/*
|
|
832 |
Setting configurations during playing is not possible because the file has to be played at a configuration
|
|
833 |
which is same as that of when it was recorded. However, if the client tries to set the configuration which
|
|
834 |
is same as the configutation of the file, all the SetXXX() custom commands will return KErrNone. We dont check
|
|
835 |
GetXXX() after SetXXX() here for this reason.
|
|
836 |
*/
|
|
837 |
errorCode = theCommander.SetSourceBitRate(KExpectedBitRate);
|
|
838 |
if(errorCode)
|
|
839 |
{
|
|
840 |
INFO_PRINTF2(_L("SetSourceBitRate() is failed with %d "), errorCode);
|
|
841 |
return EFail;
|
|
842 |
}
|
|
843 |
errorCode = theCommander.SetSourceSampleRate(KExpectedSampleRate);
|
|
844 |
if(errorCode)
|
|
845 |
{
|
|
846 |
INFO_PRINTF2(_L("SetSourceSampleRate() is failed with %d "), errorCode);
|
|
847 |
return EFail;
|
|
848 |
}
|
|
849 |
errorCode = theCommander.SetSourceNumChannels(KExpectedSourceChannels);
|
|
850 |
if(errorCode)
|
|
851 |
{
|
|
852 |
INFO_PRINTF2(_L("SetSourceNumChannels() is failed with %d "), errorCode);
|
|
853 |
return EFail;
|
|
854 |
}
|
|
855 |
TFourCC theCodec('V', 'O', 'R', 'B');
|
|
856 |
errorCode = theCommander.SetSourceDataType(theCodec);
|
|
857 |
if(errorCode)
|
|
858 |
{
|
|
859 |
INFO_PRINTF2(_L("SetSourceDataType() is failed with %d "), errorCode);
|
|
860 |
return EFail;
|
|
861 |
}
|
|
862 |
errorCode = theCommander.SetCodec(theCodec, theCodec);
|
|
863 |
if(errorCode)
|
|
864 |
{
|
|
865 |
INFO_PRINTF2(_L("SetCodec() is failed with %d "), errorCode);
|
|
866 |
return EFail;
|
|
867 |
}
|
|
868 |
errorCode = theCommander.SetSourceFormat(KOggDecodeUid);
|
|
869 |
if(errorCode)
|
|
870 |
{
|
|
871 |
INFO_PRINTF2(_L("SetSourceFormat() is failed with %d "), errorCode);
|
|
872 |
return EFail;
|
|
873 |
}
|
|
874 |
return EPass;
|
|
875 |
}
|
|
876 |
|
|
877 |
//Negative Tests
|
|
878 |
/**
|
|
879 |
*
|
|
880 |
* Test step constructor.
|
|
881 |
* It initialises its own name and the input filename
|
|
882 |
*
|
|
883 |
*/
|
|
884 |
RTestStepOggCtrlPlayInvalid::RTestStepOggCtrlPlayInvalid(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
|
|
885 |
:RTestStepOggCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
|
|
886 |
{
|
|
887 |
}
|
|
888 |
|
|
889 |
TVerdict RTestStepOggCtrlPlayInvalid::DoTestStepPreambleL(void)
|
|
890 |
{
|
|
891 |
return EPass;
|
|
892 |
}
|
|
893 |
|
|
894 |
/**
|
|
895 |
* Do the test step(Negative Test).
|
|
896 |
* This test tries to open an invalid file. Expects KErrCurrupt from OggPlayController
|
|
897 |
*/
|
|
898 |
TVerdict RTestStepOggCtrlPlayInvalid::DoTestStepL(void)
|
|
899 |
{
|
|
900 |
INFO_PRINTF1(_L("This test tries to open an invalid file using OggPlayController"));
|
|
901 |
iScheduler = new(ELeave)CActiveScheduler;
|
|
902 |
CleanupStack::PushL(iScheduler );
|
|
903 |
CActiveScheduler::Install(iScheduler );
|
|
904 |
CleanupStack::Pop();
|
|
905 |
iPriority.iPriority = 11; // set the priority to some default value
|
|
906 |
iPriority.iPref = EMdaPriorityPreferenceQuality;
|
|
907 |
iControllerEventMonitor = CMMFControllerEventMonitor::NewL(*this, iController);
|
|
908 |
TInt errorCode = iController.Open(KOggPlayControllerUid, iPriority);
|
|
909 |
if(errorCode)
|
|
910 |
{
|
|
911 |
INFO_PRINTF2(_L("Failed to load the controller %d "), errorCode);
|
|
912 |
return EInconclusive;
|
|
913 |
}
|
|
914 |
iControllerEventMonitor->Start();
|
|
915 |
SetupReadFileConfigL();
|
|
916 |
errorCode = iController.AddDataSource(KUidMmfFileSource, ReadFileConfig());
|
|
917 |
if(errorCode != KErrCorrupt)
|
|
918 |
{
|
|
919 |
INFO_PRINTF2(_L("AddDataSource failed with %d "), errorCode);
|
|
920 |
return EFail;
|
|
921 |
}
|
|
922 |
return EPass;
|
|
923 |
}
|
|
924 |
/**
|
|
925 |
*
|
|
926 |
* Test step constructor.
|
|
927 |
* It initialises its own name and the input filename
|
|
928 |
*
|
|
929 |
*/
|
|
930 |
RTestStepOggCtrlSetInvalidConfig::RTestStepOggCtrlSetInvalidConfig(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
|
|
931 |
:RTestStepOggCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
|
|
932 |
{
|
|
933 |
}
|
|
934 |
|
|
935 |
/**
|
|
936 |
* Do the test step(Negative Test).
|
|
937 |
* This tests setting the an invalid SourceDataType on OggPlayController
|
|
938 |
* checks if the OggPlayController returns KErrNotSupported
|
|
939 |
*/
|
|
940 |
TVerdict RTestStepOggCtrlSetInvalidConfig::DoTestStepL( void )
|
|
941 |
{
|
|
942 |
INFO_PRINTF1(_L("This tests setting an invalid SourceDataType on OggPlayController "));
|
|
943 |
RMMFAudioControllerCustomCommands theCommander( iController );
|
|
944 |
TFourCC theCodec(KMMFFourCCCodeIMAD);
|
|
945 |
TInt errorCode = theCommander.SetSourceDataType(theCodec);
|
|
946 |
if(errorCode != KErrNotSupported)
|
|
947 |
{
|
|
948 |
INFO_PRINTF2(_L("SetSourceDataType() with non vorbis failed to return KErrNotSupported but returned %d "), errorCode);
|
|
949 |
return EFail;
|
|
950 |
}
|
|
951 |
TUint newBitRate = 224000;
|
|
952 |
TUint newSampleRate = 8000;
|
|
953 |
TUint newSourceChannels = 1;
|
|
954 |
errorCode = theCommander.SetSourceBitRate(newBitRate);
|
|
955 |
if(errorCode != KErrNotSupported)
|
|
956 |
{
|
|
957 |
INFO_PRINTF2(_L("SetSourceBitRate() returned wrong error %d "), errorCode);
|
|
958 |
return EFail;
|
|
959 |
}
|
|
960 |
errorCode = theCommander.SetSourceSampleRate(newSampleRate);
|
|
961 |
if(errorCode != KErrNotSupported)
|
|
962 |
{
|
|
963 |
INFO_PRINTF2(_L("SetSourceSampleRate() returned wrong error %d "), errorCode);
|
|
964 |
return EFail;
|
|
965 |
}
|
|
966 |
errorCode = theCommander.SetSourceNumChannels(newSourceChannels);
|
|
967 |
if(errorCode != KErrNotSupported)
|
|
968 |
{
|
|
969 |
INFO_PRINTF2(_L("SetSourceNumChannels() returned wrong error %d "), errorCode);
|
|
970 |
return EFail;
|
|
971 |
}
|
|
972 |
errorCode = theCommander.SetSourceFormat(KOggEncodeUid);
|
|
973 |
if(errorCode != KErrNotSupported)
|
|
974 |
{
|
|
975 |
INFO_PRINTF2(_L("SetSourceFormat() returned wrong error %d "), errorCode);
|
|
976 |
return EFail;
|
|
977 |
}
|
|
978 |
return EPass;
|
|
979 |
}
|
|
980 |
|
|
981 |
/**
|
|
982 |
*
|
|
983 |
* Test step constructor.
|
|
984 |
* It initialises its own name and the input filename
|
|
985 |
*
|
|
986 |
*/
|
|
987 |
RTestStepOggCtrlPositionNegative::RTestStepOggCtrlPositionNegative(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid)
|
|
988 |
:RTestStepOggCtrlPlayBase(aTestName, aSectName, aKeyName, aControllerUid)
|
|
989 |
{
|
|
990 |
}
|
|
991 |
|
|
992 |
/**
|
|
993 |
* Do the test step(Negative Test).
|
|
994 |
* This tests setting the Negative Position on OggPlayController
|
|
995 |
* checks if the Position set is to 0.
|
|
996 |
*/
|
|
997 |
TVerdict RTestStepOggCtrlPositionNegative::DoTestStepL(void)
|
|
998 |
{
|
|
999 |
INFO_PRINTF1(_L("This tests setting the Negative Position on OggPlayController"));
|
|
1000 |
TInt errorCode = iController.Prime();
|
|
1001 |
if(errorCode)
|
|
1002 |
{
|
|
1003 |
INFO_PRINTF2(_L("Prime is failed with %d "), errorCode);
|
|
1004 |
return EInconclusive;
|
|
1005 |
}
|
|
1006 |
errorCode = iController.SetPosition(-1);
|
|
1007 |
if(errorCode)
|
|
1008 |
{
|
|
1009 |
INFO_PRINTF2(_L("SetPosition() during Primed State is failed with %d "), errorCode);
|
|
1010 |
return EFail;
|
|
1011 |
}
|
|
1012 |
TTimeIntervalMicroSeconds theNewPosition;
|
|
1013 |
errorCode = iController.GetPosition(theNewPosition);
|
|
1014 |
if(errorCode)
|
|
1015 |
{
|
|
1016 |
INFO_PRINTF2(_L("GetPosition() during Primed State is failed with %d "), errorCode);
|
|
1017 |
return EFail;
|
|
1018 |
}
|
|
1019 |
|
|
1020 |
if(theNewPosition != 0)
|
|
1021 |
{
|
|
1022 |
INFO_PRINTF1(_L("Get Position is failed to return 0 when the position is set to a negative value"));
|
|
1023 |
return EFail;
|
|
1024 |
}
|
|
1025 |
return EPass;
|
|
1026 |
}
|