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 <mdaaudiosampleeditor.h>
|
|
32 |
//#include <MdaAudioToneRecorder.h>
|
|
33 |
|
|
34 |
// Test system includes
|
|
35 |
#include <testframework.h>
|
|
36 |
|
|
37 |
// Specific includes for this test suite
|
|
38 |
#include "TestStepUnitMMFAudClient.h"
|
|
39 |
#include "TestSuiteUnitMMFAudClient.h"
|
|
40 |
|
|
41 |
// Specific includes for these test steps
|
|
42 |
#include "TestStepRecorder.h"
|
|
43 |
|
|
44 |
#include "mmfclientaudiorecorder.h"
|
|
45 |
#include "../../ctlfrm/TS_Codes.h"
|
|
46 |
|
|
47 |
_LIT(KAudioControllerName,"Symbian Audio Wav Test controller");
|
|
48 |
|
|
49 |
//
|
|
50 |
//
|
|
51 |
// --------------------------------------------
|
|
52 |
//
|
|
53 |
/**
|
|
54 |
*
|
|
55 |
* Static constructor for CTestStepRecorderGetImplementationInfo.
|
|
56 |
*
|
|
57 |
*
|
|
58 |
* @return "CTestStepRecorderGetImplementationInfo*"
|
|
59 |
* The constructed CTestStepRecorderGetImplementationInfo
|
|
60 |
*
|
|
61 |
* @xxxx
|
|
62 |
*
|
|
63 |
*/
|
|
64 |
CTestStepRecorderGetImplementationInfo* CTestStepRecorderGetImplementationInfo::NewL()
|
|
65 |
{
|
|
66 |
CTestStepRecorderGetImplementationInfo* self = new(ELeave) CTestStepRecorderGetImplementationInfo;
|
|
67 |
return self;
|
|
68 |
}
|
|
69 |
|
|
70 |
/**
|
|
71 |
*
|
|
72 |
* Test step constructor.
|
|
73 |
* Each test step initialises its own name.
|
|
74 |
*
|
|
75 |
* @xxxx
|
|
76 |
*
|
|
77 |
*/
|
|
78 |
CTestStepRecorderGetImplementationInfo::CTestStepRecorderGetImplementationInfo()
|
|
79 |
{
|
|
80 |
iTestStepResult = EPass;
|
|
81 |
// store the name of this test case
|
|
82 |
// this is the name that is used by the script file
|
|
83 |
iTestStepName = _L("MM-MMF-ACLNT-U-0271-HP");
|
|
84 |
}
|
|
85 |
|
|
86 |
/**
|
|
87 |
*
|
|
88 |
* Test step destructor.
|
|
89 |
*
|
|
90 |
* @xxxx
|
|
91 |
*
|
|
92 |
*/
|
|
93 |
CTestStepRecorderGetImplementationInfo::~CTestStepRecorderGetImplementationInfo()
|
|
94 |
{
|
|
95 |
}
|
|
96 |
|
|
97 |
void CTestStepRecorderGetImplementationInfo::MoscoStateChangeEvent(CBase* /*aObject*/,
|
|
98 |
TInt aPreviousState,
|
|
99 |
TInt aCurrentState,
|
|
100 |
TInt aErrorcCode)
|
|
101 |
{
|
|
102 |
iError = aErrorcCode;
|
|
103 |
if (aPreviousState == CMdaAudioClipUtility::ENotReady
|
|
104 |
&& aCurrentState == CMdaAudioClipUtility::EOpen)
|
|
105 |
iIsOpen = ETrue;
|
|
106 |
CActiveScheduler::Stop();
|
|
107 |
}
|
|
108 |
|
|
109 |
|
|
110 |
/**
|
|
111 |
*
|
|
112 |
* Test step Preamble.
|
|
113 |
*
|
|
114 |
* @xxxx
|
|
115 |
*
|
|
116 |
*/
|
|
117 |
enum TVerdict CTestStepRecorderGetImplementationInfo::DoTestStepPreambleL(void)
|
|
118 |
{
|
|
119 |
enum TVerdict verdict;
|
|
120 |
// this installs the scheduler
|
|
121 |
verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL();
|
|
122 |
if (verdict != EPass)
|
|
123 |
return verdict;
|
|
124 |
|
|
125 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioPlayFName1"), iFileName))
|
|
126 |
{
|
|
127 |
//INFO_PRINTF2(_L("file name %s not found..."), fileptr);
|
|
128 |
return EInconclusive;
|
|
129 |
}
|
|
130 |
|
|
131 |
// Printing to the console and log file
|
|
132 |
INFO_PRINTF1(iTestStepName);
|
|
133 |
INFO_PRINTF1(_L("this test is a test of CMMFMdaAudioRecorderUtility::ControllerImplementationInformationL()"));
|
|
134 |
|
|
135 |
return verdict;
|
|
136 |
}
|
|
137 |
|
|
138 |
/**
|
|
139 |
*
|
|
140 |
* Test step Postamble.
|
|
141 |
*
|
|
142 |
* @xxxx
|
|
143 |
*
|
|
144 |
*/
|
|
145 |
enum TVerdict CTestStepRecorderGetImplementationInfo::DoTestStepPostambleL(void)
|
|
146 |
{
|
|
147 |
delete iRecorder;
|
|
148 |
iRecorder = NULL;
|
|
149 |
//[ Destroy the scheduler ]
|
|
150 |
return CTestStepUnitMMFAudClient::DoTestStepPostambleL();
|
|
151 |
}
|
|
152 |
|
|
153 |
/**
|
|
154 |
*
|
|
155 |
* Do the test step.
|
|
156 |
* Each test step must supply an implementation for DoTestStepL.
|
|
157 |
*
|
|
158 |
* @return "TVerdict"
|
|
159 |
* The result of the test step
|
|
160 |
*
|
|
161 |
* @xxxx
|
|
162 |
*
|
|
163 |
*/
|
|
164 |
TVerdict CTestStepRecorderGetImplementationInfo::DoTestStepL()
|
|
165 |
{
|
|
166 |
TInt err;
|
|
167 |
err = KErrNone;
|
|
168 |
iTestStepResult = EFail;
|
|
169 |
|
|
170 |
iRecorder = CMMFMdaAudioRecorderUtility::NewL(*this);
|
|
171 |
|
|
172 |
TRAP(err, iRecorder->OpenFileL(iFileName));
|
|
173 |
|
|
174 |
if (err != KErrNone)
|
|
175 |
return EInconclusive;
|
|
176 |
|
|
177 |
CActiveScheduler::Start();
|
|
178 |
|
|
179 |
if (iError != KErrNone)
|
|
180 |
return EInconclusive;
|
|
181 |
|
|
182 |
const CMMFControllerImplementationInformation* info = NULL;
|
|
183 |
|
|
184 |
TRAP(err, info = &iRecorder->AudioPlayControllerImplementationInformationL());
|
|
185 |
if (err != KErrNone)
|
|
186 |
return EFail;
|
|
187 |
|
|
188 |
if (info->DisplayName().Compare(KAudioControllerName)!=0)
|
|
189 |
iTestStepResult = EFail;
|
|
190 |
else
|
|
191 |
iTestStepResult = EPass;
|
|
192 |
|
|
193 |
TRAP(err, info = &iRecorder->AudioRecorderControllerImplementationInformationL());
|
|
194 |
if (err != KErrNone)
|
|
195 |
return EFail;
|
|
196 |
|
|
197 |
if (info->DisplayName().Compare(KAudioControllerName)!=0)
|
|
198 |
iTestStepResult = EFail;
|
|
199 |
else
|
|
200 |
iTestStepResult = EPass;
|
|
201 |
|
|
202 |
|
|
203 |
delete iRecorder;
|
|
204 |
iRecorder = NULL;
|
|
205 |
|
|
206 |
INFO_PRINTF1(_L("finished with this test step"));
|
|
207 |
// test steps return a result
|
|
208 |
return iTestStepResult;
|
|
209 |
}
|
|
210 |
|
|
211 |
//
|
|
212 |
//
|
|
213 |
//
|
|
214 |
// --------------------------------------------
|
|
215 |
//
|
|
216 |
/**
|
|
217 |
*
|
|
218 |
* Static constructor for CTestStepRecorderSendCustomCommandSync.
|
|
219 |
*
|
|
220 |
*
|
|
221 |
* @return "CTestStepRecorderSendCustomCommandSync*"
|
|
222 |
* The constructed CTestStepRecorderSendCustomCommandSync
|
|
223 |
*
|
|
224 |
* @xxxx
|
|
225 |
*
|
|
226 |
*/
|
|
227 |
CTestStepRecorderSendCustomCommandSync* CTestStepRecorderSendCustomCommandSync::NewL()
|
|
228 |
{
|
|
229 |
CTestStepRecorderSendCustomCommandSync* self = new(ELeave) CTestStepRecorderSendCustomCommandSync;
|
|
230 |
return self;
|
|
231 |
}
|
|
232 |
|
|
233 |
/**
|
|
234 |
*
|
|
235 |
* Test step constructor.
|
|
236 |
* Each test step initialises its own name.
|
|
237 |
*
|
|
238 |
* @xxxx
|
|
239 |
*
|
|
240 |
*/
|
|
241 |
CTestStepRecorderSendCustomCommandSync::CTestStepRecorderSendCustomCommandSync()
|
|
242 |
{
|
|
243 |
iTestStepResult = EPass;
|
|
244 |
// store the name of this test case
|
|
245 |
// this is the name that is used by the script file
|
|
246 |
iTestStepName = _L("MM-MMF-ACLNT-U-0272-HP");
|
|
247 |
}
|
|
248 |
|
|
249 |
/**
|
|
250 |
*
|
|
251 |
* Test step destructor.
|
|
252 |
*
|
|
253 |
* @xxxx
|
|
254 |
*
|
|
255 |
*/
|
|
256 |
CTestStepRecorderSendCustomCommandSync::~CTestStepRecorderSendCustomCommandSync()
|
|
257 |
{
|
|
258 |
}
|
|
259 |
|
|
260 |
void CTestStepRecorderSendCustomCommandSync::MoscoStateChangeEvent(CBase* /*aObject*/,
|
|
261 |
TInt aPreviousState,
|
|
262 |
TInt aCurrentState,
|
|
263 |
TInt aErrorcCode)
|
|
264 |
{
|
|
265 |
iError = aErrorcCode;
|
|
266 |
if (aPreviousState == CMdaAudioClipUtility::ENotReady
|
|
267 |
&& aCurrentState == CMdaAudioClipUtility::EOpen)
|
|
268 |
iIsOpen = ETrue;
|
|
269 |
|
|
270 |
CActiveScheduler::Stop();
|
|
271 |
}
|
|
272 |
|
|
273 |
/**
|
|
274 |
*
|
|
275 |
* Test step Preamble.
|
|
276 |
*
|
|
277 |
* @xxxx
|
|
278 |
*
|
|
279 |
*/
|
|
280 |
enum TVerdict CTestStepRecorderSendCustomCommandSync::DoTestStepPreambleL(void)
|
|
281 |
{
|
|
282 |
enum TVerdict verdict;
|
|
283 |
// this installs the scheduler
|
|
284 |
verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL();
|
|
285 |
if (verdict != EPass)
|
|
286 |
return verdict;
|
|
287 |
|
|
288 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioFNameTestController"), iFileName))
|
|
289 |
{
|
|
290 |
//INFO_PRINTF2(_L("file name %s not found..."), fileptr);
|
|
291 |
return EInconclusive;
|
|
292 |
}
|
|
293 |
|
|
294 |
// Printing to the console and log file
|
|
295 |
INFO_PRINTF1(iTestStepName);
|
|
296 |
INFO_PRINTF1(_L("this test is a test of CMMFMdaAudioRecorderUtility::CustomCommandSync()"));
|
|
297 |
|
|
298 |
return verdict;
|
|
299 |
}
|
|
300 |
|
|
301 |
/**
|
|
302 |
*
|
|
303 |
* Test step Postamble.
|
|
304 |
*
|
|
305 |
* @xxxx
|
|
306 |
*
|
|
307 |
*/
|
|
308 |
enum TVerdict CTestStepRecorderSendCustomCommandSync::DoTestStepPostambleL(void)
|
|
309 |
{
|
|
310 |
delete iRecorder;
|
|
311 |
iRecorder = NULL;
|
|
312 |
//[ Destroy the scheduler ]
|
|
313 |
return CTestStepUnitMMFAudClient::DoTestStepPostambleL();
|
|
314 |
}
|
|
315 |
|
|
316 |
/**
|
|
317 |
*
|
|
318 |
* Do the test step.
|
|
319 |
* Each test step must supply an implementation for DoTestStepL.
|
|
320 |
*
|
|
321 |
* @return "TVerdict"
|
|
322 |
* The result of the test step
|
|
323 |
*
|
|
324 |
* @xxxx
|
|
325 |
*
|
|
326 |
*/
|
|
327 |
TVerdict CTestStepRecorderSendCustomCommandSync::DoTestStepL()
|
|
328 |
{
|
|
329 |
TInt err;
|
|
330 |
err = KErrNone;
|
|
331 |
iTestStepResult = EFail;
|
|
332 |
|
|
333 |
iRecorder = CMMFMdaAudioRecorderUtility::NewL(*this);
|
|
334 |
|
|
335 |
TUid testController = TUid::Uid(KUidTestController);
|
|
336 |
TRAP(err, iRecorder->OpenFileL(iFileName,
|
|
337 |
testController,
|
|
338 |
testController,
|
|
339 |
KNullUid));
|
|
340 |
|
|
341 |
if (err!=KErrNone)
|
|
342 |
return EInconclusive;
|
|
343 |
|
|
344 |
CActiveScheduler::Start();
|
|
345 |
|
|
346 |
if (iError!=KErrNone)
|
|
347 |
return EInconclusive;
|
|
348 |
|
|
349 |
TUid uid;
|
|
350 |
uid = TUid::Uid(0x101f72B4);
|
|
351 |
TMMFMessageDestinationPckg destPckg(uid);
|
|
352 |
// test without a return value
|
|
353 |
err = iRecorder->RecordControllerCustomCommandSync(destPckg,
|
|
354 |
EMMFTestCustomCommandGeneralSynchronous,
|
|
355 |
KFirstParameter,
|
|
356 |
KSecondParameter);
|
|
357 |
|
|
358 |
if (err!=KTestCustomCommandSuccess)
|
|
359 |
return EFail;
|
|
360 |
|
|
361 |
TBuf8<256> buf;
|
|
362 |
|
|
363 |
err = iRecorder->RecordControllerCustomCommandSync(destPckg,
|
|
364 |
EMMFTestCustomCommandGeneralSynchronousWithReturn,
|
|
365 |
KFirstParameter,
|
|
366 |
KSecondParameter,
|
|
367 |
buf);
|
|
368 |
|
|
369 |
if (err!=KTestCustomCommandSuccess)
|
|
370 |
return EFail;
|
|
371 |
|
|
372 |
if (buf.Compare(KReturnParameter)==0)
|
|
373 |
iTestStepResult = EPass;
|
|
374 |
else
|
|
375 |
iTestStepResult = EFail;
|
|
376 |
|
|
377 |
|
|
378 |
err = iRecorder->PlayControllerCustomCommandSync(destPckg,
|
|
379 |
EMMFTestCustomCommandGeneralSynchronous,
|
|
380 |
KFirstParameter,
|
|
381 |
KSecondParameter);
|
|
382 |
|
|
383 |
if (err!=KTestCustomCommandSuccess)
|
|
384 |
return EFail;
|
|
385 |
|
|
386 |
err = iRecorder->PlayControllerCustomCommandSync(destPckg,
|
|
387 |
EMMFTestCustomCommandGeneralSynchronousWithReturn,
|
|
388 |
KFirstParameter,
|
|
389 |
KSecondParameter,
|
|
390 |
buf);
|
|
391 |
|
|
392 |
if (err!=KTestCustomCommandSuccess)
|
|
393 |
return EFail;
|
|
394 |
|
|
395 |
if (buf.Compare(KReturnParameter)==0)
|
|
396 |
iTestStepResult = EPass;
|
|
397 |
else
|
|
398 |
iTestStepResult = EFail;
|
|
399 |
|
|
400 |
delete iRecorder;
|
|
401 |
iRecorder = NULL;
|
|
402 |
|
|
403 |
|
|
404 |
INFO_PRINTF1(_L("finished with this test step"));
|
|
405 |
// test steps return a result
|
|
406 |
return iTestStepResult;
|
|
407 |
}
|
|
408 |
|
|
409 |
|
|
410 |
//
|
|
411 |
//
|
|
412 |
//
|
|
413 |
// --------------------------------------------
|
|
414 |
//
|
|
415 |
/**
|
|
416 |
*
|
|
417 |
* Static constructor for CTestStepRecorderSendCustomCommandAsync.
|
|
418 |
*
|
|
419 |
*
|
|
420 |
* @return "CTestStepRecorderSendCustomCommandAsync*"
|
|
421 |
* The constructed CTestStepRecorderSendCustomCommandAsync
|
|
422 |
*
|
|
423 |
* @xxxx
|
|
424 |
*
|
|
425 |
*/
|
|
426 |
CTestStepRecorderSendCustomCommandAsync* CTestStepRecorderSendCustomCommandAsync::NewL()
|
|
427 |
{
|
|
428 |
CTestStepRecorderSendCustomCommandAsync* self = new(ELeave) CTestStepRecorderSendCustomCommandAsync;
|
|
429 |
return self;
|
|
430 |
}
|
|
431 |
|
|
432 |
/**
|
|
433 |
*
|
|
434 |
* Test step constructor.
|
|
435 |
* Each test step initialises its own name.
|
|
436 |
*
|
|
437 |
* @xxxx
|
|
438 |
*
|
|
439 |
*/
|
|
440 |
CTestStepRecorderSendCustomCommandAsync::CTestStepRecorderSendCustomCommandAsync()
|
|
441 |
{
|
|
442 |
iTestStepResult = EPass;
|
|
443 |
// store the name of this test case
|
|
444 |
// this is the name that is used by the script file
|
|
445 |
iTestStepName = _L("MM-MMF-ACLNT-U-0273-HP");
|
|
446 |
}
|
|
447 |
|
|
448 |
/**
|
|
449 |
*
|
|
450 |
* Test step destructor.
|
|
451 |
*
|
|
452 |
* @xxxx
|
|
453 |
*
|
|
454 |
*/
|
|
455 |
CTestStepRecorderSendCustomCommandAsync::~CTestStepRecorderSendCustomCommandAsync()
|
|
456 |
{
|
|
457 |
}
|
|
458 |
|
|
459 |
/**
|
|
460 |
*
|
|
461 |
* Test step Close
|
|
462 |
* handles all deletion
|
|
463 |
* @xxxx
|
|
464 |
*
|
|
465 |
*/
|
|
466 |
void CTestStepRecorderSendCustomCommandAsync::Close()
|
|
467 |
{
|
|
468 |
delete iAsyncObserver;
|
|
469 |
}
|
|
470 |
|
|
471 |
|
|
472 |
/**
|
|
473 |
* Implementation of the MVideoRecorderUtilityObserver interface functions
|
|
474 |
**/
|
|
475 |
void CTestStepRecorderSendCustomCommandAsync::MoscoStateChangeEvent(CBase* /*aObject*/,
|
|
476 |
TInt aPreviousState,
|
|
477 |
TInt aCurrentState,
|
|
478 |
TInt aErrorcCode)
|
|
479 |
{
|
|
480 |
iError = aErrorcCode;
|
|
481 |
if (aPreviousState == CMdaAudioClipUtility::ENotReady
|
|
482 |
&& aCurrentState == CMdaAudioClipUtility::EOpen)
|
|
483 |
iIsOpen = ETrue;
|
|
484 |
|
|
485 |
CActiveScheduler::Stop();
|
|
486 |
}
|
|
487 |
|
|
488 |
/**
|
|
489 |
*
|
|
490 |
* Test step Preamble.
|
|
491 |
*
|
|
492 |
* @xxxx
|
|
493 |
*
|
|
494 |
*/
|
|
495 |
enum TVerdict CTestStepRecorderSendCustomCommandAsync::DoTestStepPreambleL(void)
|
|
496 |
{
|
|
497 |
enum TVerdict verdict;
|
|
498 |
// this installs the scheduler
|
|
499 |
verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL();
|
|
500 |
if (verdict != EPass)
|
|
501 |
return verdict;
|
|
502 |
|
|
503 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioFNameTestController"), iFileName))
|
|
504 |
{
|
|
505 |
//INFO_PRINTF2(_L("file name %s not found..."), fileptr);
|
|
506 |
return EInconclusive;
|
|
507 |
}
|
|
508 |
|
|
509 |
iAsyncObserver = new (ELeave) CAsyncObserver;
|
|
510 |
|
|
511 |
// Printing to the console and log file
|
|
512 |
INFO_PRINTF1(iTestStepName);
|
|
513 |
INFO_PRINTF1(_L("this test is a test of CMMFMdaAudioRecorderUtility::CustomCommandAsync()"));
|
|
514 |
|
|
515 |
return verdict;
|
|
516 |
}
|
|
517 |
|
|
518 |
/**
|
|
519 |
*
|
|
520 |
* Test step Postamble.
|
|
521 |
*
|
|
522 |
* @xxxx
|
|
523 |
*
|
|
524 |
*/
|
|
525 |
enum TVerdict CTestStepRecorderSendCustomCommandAsync::DoTestStepPostambleL(void)
|
|
526 |
{
|
|
527 |
delete iRecorder;
|
|
528 |
iRecorder = NULL;
|
|
529 |
//[ Destroy the scheduler ]
|
|
530 |
return CTestStepUnitMMFAudClient::DoTestStepPostambleL();
|
|
531 |
}
|
|
532 |
|
|
533 |
/**
|
|
534 |
*
|
|
535 |
* Do the test step.
|
|
536 |
* Each test step must supply an implementation for DoTestStepL.
|
|
537 |
*
|
|
538 |
* @return "TVerdict"
|
|
539 |
* The result of the test step
|
|
540 |
*
|
|
541 |
* @xxxx
|
|
542 |
*
|
|
543 |
*/
|
|
544 |
TVerdict CTestStepRecorderSendCustomCommandAsync::DoTestStepL()
|
|
545 |
{
|
|
546 |
TInt err;
|
|
547 |
err = KErrNone;
|
|
548 |
iTestStepResult = EFail;
|
|
549 |
|
|
550 |
iRecorder = CMMFMdaAudioRecorderUtility::NewL(*this);
|
|
551 |
|
|
552 |
TUid testController= TUid::Uid(KUidTestController);
|
|
553 |
|
|
554 |
TRAP(err, iRecorder->OpenFileL(iFileName,
|
|
555 |
testController,
|
|
556 |
testController,
|
|
557 |
KNullUid));
|
|
558 |
if (err!=KErrNone)
|
|
559 |
return EInconclusive;
|
|
560 |
|
|
561 |
CActiveScheduler::Start();
|
|
562 |
|
|
563 |
if (iError!=KErrNone)
|
|
564 |
return EInconclusive;
|
|
565 |
|
|
566 |
TUid uid;
|
|
567 |
uid = TUid::Uid(0x101f72B4);
|
|
568 |
// destinationPckg can be temporary as the asynchronous custom command returns before the temporary variable goes out of scope
|
|
569 |
TMMFMessageDestinationPckg destinationPckg(uid);
|
|
570 |
|
|
571 |
// test without a return value
|
|
572 |
iRecorder->RecordControllerCustomCommandAsync(destinationPckg,
|
|
573 |
EMMFTestCustomCommandGeneralAsynchronous,
|
|
574 |
KFirstParameter,
|
|
575 |
KSecondParameter,
|
|
576 |
iAsyncObserver->ActiveStatus());
|
|
577 |
|
|
578 |
CActiveScheduler::Start();
|
|
579 |
if (iAsyncObserver->iStatus.Int() !=KTestCustomCommandSuccess)
|
|
580 |
return EFail;
|
|
581 |
|
|
582 |
TBuf8<256> buf;
|
|
583 |
|
|
584 |
iRecorder->RecordControllerCustomCommandAsync(destinationPckg,
|
|
585 |
EMMFTestCustomCommandGeneralAsynchronousWithReturn,
|
|
586 |
KFirstParameter,
|
|
587 |
KSecondParameter,
|
|
588 |
buf,
|
|
589 |
iAsyncObserver->ActiveStatus());
|
|
590 |
|
|
591 |
CActiveScheduler::Start();
|
|
592 |
if (iAsyncObserver->iStatus.Int() !=KTestCustomCommandSuccess)
|
|
593 |
return EFail;
|
|
594 |
|
|
595 |
if (buf.Compare(KReturnParameter)==0)
|
|
596 |
iTestStepResult = EPass;
|
|
597 |
else
|
|
598 |
iTestStepResult = EFail;
|
|
599 |
|
|
600 |
// test without a return value
|
|
601 |
iRecorder->PlayControllerCustomCommandAsync(destinationPckg,
|
|
602 |
EMMFTestCustomCommandGeneralAsynchronous,
|
|
603 |
KFirstParameter,
|
|
604 |
KSecondParameter,
|
|
605 |
iAsyncObserver->ActiveStatus());
|
|
606 |
|
|
607 |
CActiveScheduler::Start();
|
|
608 |
if (iAsyncObserver->iStatus.Int() !=KTestCustomCommandSuccess)
|
|
609 |
return EFail;
|
|
610 |
|
|
611 |
iRecorder->PlayControllerCustomCommandAsync(destinationPckg,
|
|
612 |
EMMFTestCustomCommandGeneralAsynchronousWithReturn,
|
|
613 |
KFirstParameter,
|
|
614 |
KSecondParameter,
|
|
615 |
buf,
|
|
616 |
iAsyncObserver->ActiveStatus());
|
|
617 |
|
|
618 |
CActiveScheduler::Start();
|
|
619 |
if (iAsyncObserver->iStatus.Int() !=KTestCustomCommandSuccess)
|
|
620 |
return EFail;
|
|
621 |
|
|
622 |
if (buf.Compare(KReturnParameter)==0)
|
|
623 |
iTestStepResult = EPass;
|
|
624 |
else
|
|
625 |
iTestStepResult = EFail;
|
|
626 |
|
|
627 |
delete iRecorder;
|
|
628 |
iRecorder = NULL;
|
|
629 |
|
|
630 |
|
|
631 |
INFO_PRINTF1(_L("finished with this test step"));
|
|
632 |
// test steps return a result
|
|
633 |
return iTestStepResult;
|
|
634 |
}
|
|
635 |
|
|
636 |
//
|
|
637 |
//
|
|
638 |
// --------------------------------------------
|
|
639 |
//
|
|
640 |
/**
|
|
641 |
*
|
|
642 |
* Static constructor for CTestStepRecorderReloadingTest.
|
|
643 |
*
|
|
644 |
*
|
|
645 |
* @return "CTestStepRecorderReloadingTest*"
|
|
646 |
* The constructed CTestStepRecorderReloadingTest
|
|
647 |
*
|
|
648 |
* @xxxx
|
|
649 |
*
|
|
650 |
*/
|
|
651 |
CTestStepRecorderReloadingTest* CTestStepRecorderReloadingTest::NewL()
|
|
652 |
{
|
|
653 |
CTestStepRecorderReloadingTest* self = new(ELeave) CTestStepRecorderReloadingTest;
|
|
654 |
return self;
|
|
655 |
}
|
|
656 |
|
|
657 |
/**
|
|
658 |
*
|
|
659 |
* Test step constructor.
|
|
660 |
* Each test step initialises its own name.
|
|
661 |
*
|
|
662 |
* @xxxx
|
|
663 |
*
|
|
664 |
*/
|
|
665 |
CTestStepRecorderReloadingTest::CTestStepRecorderReloadingTest()
|
|
666 |
{
|
|
667 |
iTestStepResult = EPass;
|
|
668 |
// store the name of this test case
|
|
669 |
// this is the name that is used by the script file
|
|
670 |
iTestStepName = _L("MM-MMF-ACLNT-U-0274-HP");
|
|
671 |
}
|
|
672 |
|
|
673 |
/**
|
|
674 |
*
|
|
675 |
* Test step destructor.
|
|
676 |
*
|
|
677 |
* @xxxx
|
|
678 |
*
|
|
679 |
*/
|
|
680 |
CTestStepRecorderReloadingTest::~CTestStepRecorderReloadingTest()
|
|
681 |
{
|
|
682 |
}
|
|
683 |
|
|
684 |
void CTestStepRecorderReloadingTest::MoscoStateChangeEvent(CBase* /*aObject*/,
|
|
685 |
TInt aPreviousState,
|
|
686 |
TInt aCurrentState,
|
|
687 |
TInt aErrorcCode)
|
|
688 |
{
|
|
689 |
iError = aErrorcCode;
|
|
690 |
if (aPreviousState == CMdaAudioClipUtility::ENotReady
|
|
691 |
&& aCurrentState == CMdaAudioClipUtility::EOpen)
|
|
692 |
iIsOpen = ETrue;
|
|
693 |
|
|
694 |
CActiveScheduler::Stop();
|
|
695 |
}
|
|
696 |
|
|
697 |
void CTestStepRecorderReloadingTest::MaloLoadingStarted()
|
|
698 |
{
|
|
699 |
iLoadingStarted = ETrue;
|
|
700 |
CActiveScheduler::Stop();
|
|
701 |
}
|
|
702 |
|
|
703 |
void CTestStepRecorderReloadingTest::MaloLoadingComplete()
|
|
704 |
{
|
|
705 |
iLoadingComplete = ETrue;
|
|
706 |
CActiveScheduler::Stop();
|
|
707 |
}
|
|
708 |
|
|
709 |
|
|
710 |
|
|
711 |
|
|
712 |
/**
|
|
713 |
*
|
|
714 |
* Test step Preamble.
|
|
715 |
*
|
|
716 |
* @xxxx
|
|
717 |
*
|
|
718 |
*/
|
|
719 |
enum TVerdict CTestStepRecorderReloadingTest::DoTestStepPreambleL(void)
|
|
720 |
{
|
|
721 |
enum TVerdict verdict;
|
|
722 |
// this installs the scheduler
|
|
723 |
verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL();
|
|
724 |
if (verdict != EPass)
|
|
725 |
return verdict;
|
|
726 |
|
|
727 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioFNameTestController"), iFileName))
|
|
728 |
{
|
|
729 |
//INFO_PRINTF2(_L("file name %s not found..."), fileptr);
|
|
730 |
return EInconclusive;
|
|
731 |
}
|
|
732 |
|
|
733 |
// Printing to the console and log file
|
|
734 |
INFO_PRINTF1(iTestStepName);
|
|
735 |
INFO_PRINTF1(_L("this test simulates Audio Reloading and tests CMMFMdaAudioRecorderUtility::GetAudioLoadingProgressL"));
|
|
736 |
|
|
737 |
return verdict;
|
|
738 |
}
|
|
739 |
|
|
740 |
/**
|
|
741 |
*
|
|
742 |
* Test step Postamble.
|
|
743 |
*
|
|
744 |
* @xxxx
|
|
745 |
*
|
|
746 |
*/
|
|
747 |
enum TVerdict CTestStepRecorderReloadingTest::DoTestStepPostambleL(void)
|
|
748 |
{
|
|
749 |
delete iRecorder;
|
|
750 |
iRecorder = NULL;
|
|
751 |
//[ Destroy the scheduler ]
|
|
752 |
return CTestStepUnitMMFAudClient::DoTestStepPostambleL();
|
|
753 |
}
|
|
754 |
|
|
755 |
/**
|
|
756 |
*
|
|
757 |
* Do the test step.
|
|
758 |
* Each test step must supply an implementation for DoTestStepL.
|
|
759 |
*
|
|
760 |
* @return "TVerdict"
|
|
761 |
* The result of the test step
|
|
762 |
*
|
|
763 |
* @xxxx
|
|
764 |
*
|
|
765 |
*/
|
|
766 |
TVerdict CTestStepRecorderReloadingTest::DoTestStepL()
|
|
767 |
{
|
|
768 |
TInt err;
|
|
769 |
err = KErrNone;
|
|
770 |
iTestStepResult = EFail;
|
|
771 |
|
|
772 |
iRecorder = CMMFMdaAudioRecorderUtility::NewL(*this);
|
|
773 |
|
|
774 |
TUid testController = TUid::Uid(KUidTestController);
|
|
775 |
TRAP(err, iRecorder->OpenFileL(iFileName,
|
|
776 |
testController,
|
|
777 |
testController,
|
|
778 |
KNullUid));
|
|
779 |
if (err!=KErrNone)
|
|
780 |
return EInconclusive;
|
|
781 |
|
|
782 |
CActiveScheduler::Start();
|
|
783 |
|
|
784 |
if (iError!=KErrNone)
|
|
785 |
return EInconclusive;
|
|
786 |
|
|
787 |
iRecorder->RegisterForAudioLoadingNotification(*this);
|
|
788 |
|
|
789 |
TUid uid;
|
|
790 |
uid = TUid::Uid(0x101f72B4);
|
|
791 |
TMMFMessageDestinationPckg destPckg(uid);
|
|
792 |
// test without a return value
|
|
793 |
err = iRecorder->PlayControllerCustomCommandSync(destPckg,
|
|
794 |
EMMFTestCustomCommandSimulateReloading,
|
|
795 |
KNullDesC8,
|
|
796 |
KNullDesC8);
|
|
797 |
|
|
798 |
if (err!=KErrNone)
|
|
799 |
return EInconclusive;
|
|
800 |
|
|
801 |
CActiveScheduler::Start();
|
|
802 |
|
|
803 |
if (!iLoadingStarted)
|
|
804 |
return EFail;
|
|
805 |
|
|
806 |
TInt percentageComplete = 0;
|
|
807 |
TInt oldPercentageComplete =0;
|
|
808 |
while (percentageComplete!=100 && percentageComplete>=oldPercentageComplete)
|
|
809 |
{
|
|
810 |
oldPercentageComplete = percentageComplete;
|
|
811 |
iRecorder->GetAudioLoadingProgressL(percentageComplete);
|
|
812 |
INFO_PRINTF2(_L("Loading progress: %d"),percentageComplete);
|
|
813 |
User::After(100);
|
|
814 |
}
|
|
815 |
|
|
816 |
CActiveScheduler::Start();
|
|
817 |
|
|
818 |
if (iLoadingComplete && percentageComplete==100)
|
|
819 |
iTestStepResult = EPass;
|
|
820 |
else
|
|
821 |
iTestStepResult = EFail;
|
|
822 |
|
|
823 |
delete iRecorder;
|
|
824 |
iRecorder = NULL;
|
|
825 |
|
|
826 |
INFO_PRINTF1(_L("finished with this test step"));
|
|
827 |
// test steps return a result
|
|
828 |
return iTestStepResult;
|
|
829 |
}
|
|
830 |
|
|
831 |
|
|
832 |
/**
|
|
833 |
*
|
|
834 |
* Static constructor for CTestStepRecorderCheckPlayImplementationInfo.
|
|
835 |
*
|
|
836 |
*
|
|
837 |
* @return "CTestStepRecorderCheckPlayImplementationInfo*"
|
|
838 |
* The constructed CTestStepRecorderCheckPlayImplementationInfo
|
|
839 |
*
|
|
840 |
* @xxxx
|
|
841 |
*
|
|
842 |
*/
|
|
843 |
CTestStepRecorderCheckPlayImplementationInfo* CTestStepRecorderCheckPlayImplementationInfo::NewL()
|
|
844 |
{
|
|
845 |
CTestStepRecorderCheckPlayImplementationInfo* self = new(ELeave) CTestStepRecorderCheckPlayImplementationInfo;
|
|
846 |
return self;
|
|
847 |
}
|
|
848 |
|
|
849 |
/**
|
|
850 |
*
|
|
851 |
* Test step constructor.
|
|
852 |
* Each test step initialises its own name.
|
|
853 |
*
|
|
854 |
* @xxxx
|
|
855 |
*
|
|
856 |
*/
|
|
857 |
CTestStepRecorderCheckPlayImplementationInfo::CTestStepRecorderCheckPlayImplementationInfo()
|
|
858 |
{
|
|
859 |
iTestStepResult = EPass;
|
|
860 |
// store the name of this test case
|
|
861 |
// this is the name that is used by the script file
|
|
862 |
iTestStepName = _L("MM-MMF-ACLNT-U-1006-HP");
|
|
863 |
}
|
|
864 |
|
|
865 |
/**
|
|
866 |
*
|
|
867 |
* Test step destructor.
|
|
868 |
*
|
|
869 |
* @xxxx
|
|
870 |
*
|
|
871 |
*/
|
|
872 |
CTestStepRecorderCheckPlayImplementationInfo::~CTestStepRecorderCheckPlayImplementationInfo()
|
|
873 |
{
|
|
874 |
}
|
|
875 |
|
|
876 |
void CTestStepRecorderCheckPlayImplementationInfo::MoscoStateChangeEvent(CBase* /*aObject*/,
|
|
877 |
TInt aPreviousState,
|
|
878 |
TInt aCurrentState,
|
|
879 |
TInt aErrorcCode)
|
|
880 |
{
|
|
881 |
iError = aErrorcCode;
|
|
882 |
if (aPreviousState == CMdaAudioClipUtility::ENotReady
|
|
883 |
&& aCurrentState == CMdaAudioClipUtility::EOpen)
|
|
884 |
{
|
|
885 |
iIsOpen = ETrue;
|
|
886 |
}
|
|
887 |
CActiveScheduler::Stop();
|
|
888 |
}
|
|
889 |
|
|
890 |
|
|
891 |
/**
|
|
892 |
*
|
|
893 |
* Test step Preamble.
|
|
894 |
*
|
|
895 |
* @xxxx
|
|
896 |
*
|
|
897 |
*/
|
|
898 |
TVerdict CTestStepRecorderCheckPlayImplementationInfo::DoTestStepPreambleL(void)
|
|
899 |
{
|
|
900 |
// this installs the scheduler
|
|
901 |
TVerdict verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL();
|
|
902 |
if (verdict != EPass)
|
|
903 |
{
|
|
904 |
return verdict;
|
|
905 |
}
|
|
906 |
|
|
907 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioPlayFName1"), iFileName))
|
|
908 |
{
|
|
909 |
return EInconclusive;
|
|
910 |
}
|
|
911 |
|
|
912 |
// Printing to the console and log file
|
|
913 |
INFO_PRINTF1(iTestStepName);
|
|
914 |
INFO_PRINTF1(_L("this test is a test of CMMFMdaAudioRecorderUtility::ControllerImplementationInformationL()"));
|
|
915 |
|
|
916 |
return verdict;
|
|
917 |
}
|
|
918 |
|
|
919 |
/**
|
|
920 |
*
|
|
921 |
* Test step Postamble.
|
|
922 |
*
|
|
923 |
* @xxxx
|
|
924 |
*
|
|
925 |
*/
|
|
926 |
enum TVerdict CTestStepRecorderCheckPlayImplementationInfo::DoTestStepPostambleL(void)
|
|
927 |
{
|
|
928 |
//[ Destroy the scheduler ]
|
|
929 |
return CTestStepUnitMMFAudClient::DoTestStepPostambleL();
|
|
930 |
}
|
|
931 |
|
|
932 |
/**
|
|
933 |
*
|
|
934 |
* Do the test step.
|
|
935 |
* Each test step must supply an implementation for DoTestStepL.
|
|
936 |
*
|
|
937 |
* @return "TVerdict"
|
|
938 |
* The result of the test step
|
|
939 |
*
|
|
940 |
* @xxxx
|
|
941 |
*
|
|
942 |
*/
|
|
943 |
TVerdict CTestStepRecorderCheckPlayImplementationInfo::DoTestStepL()
|
|
944 |
{
|
|
945 |
TInt err = KErrNone;
|
|
946 |
iTestStepResult = EFail;
|
|
947 |
|
|
948 |
iRecorder = CMMFMdaAudioRecorderUtility::NewL(*this);
|
|
949 |
|
|
950 |
TRAP(err, iRecorder->OpenFileL(iFileName));
|
|
951 |
|
|
952 |
if (err != KErrNone)
|
|
953 |
{
|
|
954 |
return EInconclusive;
|
|
955 |
}
|
|
956 |
|
|
957 |
CActiveScheduler::Start();
|
|
958 |
|
|
959 |
if (iError != KErrNone)
|
|
960 |
{
|
|
961 |
return EInconclusive;
|
|
962 |
}
|
|
963 |
|
|
964 |
const CMMFControllerImplementationInformation* info = NULL;
|
|
965 |
|
|
966 |
TRAP(err, info = &iRecorder->AudioPlayControllerImplementationInformationL());
|
|
967 |
if (err != KErrNone)
|
|
968 |
{
|
|
969 |
return EFail;
|
|
970 |
}
|
|
971 |
|
|
972 |
TBuf<40> displayName;
|
|
973 |
displayName.Copy(info->DisplayName());
|
|
974 |
|
|
975 |
iRecorder->Close();
|
|
976 |
|
|
977 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioFNameTestController"), iFileName))
|
|
978 |
{
|
|
979 |
return EInconclusive;
|
|
980 |
}
|
|
981 |
|
|
982 |
TUid testController = TUid::Uid(KUidTestController);
|
|
983 |
TRAP(err, iRecorder->OpenFileL(iFileName,
|
|
984 |
testController,
|
|
985 |
testController,
|
|
986 |
KNullUid));
|
|
987 |
|
|
988 |
if (err != KErrNone)
|
|
989 |
{
|
|
990 |
return EInconclusive;
|
|
991 |
}
|
|
992 |
|
|
993 |
CActiveScheduler::Start();
|
|
994 |
|
|
995 |
if (iError != KErrNone)
|
|
996 |
{
|
|
997 |
return EInconclusive;
|
|
998 |
}
|
|
999 |
|
|
1000 |
TRAP(err, info = &iRecorder->AudioPlayControllerImplementationInformationL());
|
|
1001 |
|
|
1002 |
if(info->DisplayName().Compare(displayName) != 0)
|
|
1003 |
{
|
|
1004 |
iTestStepResult = EPass;
|
|
1005 |
}
|
|
1006 |
else
|
|
1007 |
{
|
|
1008 |
iTestStepResult = EFail;
|
|
1009 |
}
|
|
1010 |
|
|
1011 |
delete iRecorder;
|
|
1012 |
iRecorder = NULL;
|
|
1013 |
|
|
1014 |
INFO_PRINTF1(_L("finished with this test step"));
|
|
1015 |
// test steps return a result
|
|
1016 |
return iTestStepResult;
|
|
1017 |
}
|
|
1018 |
|
|
1019 |
|
|
1020 |
/**
|
|
1021 |
*
|
|
1022 |
* Static constructor for CTestStepRecorderCheckRecordImplementationInfo.
|
|
1023 |
*
|
|
1024 |
*
|
|
1025 |
* @return "CTestStepRecorderCheckRecordImplementationInfo*"
|
|
1026 |
* The constructed CTestStepRecorderCheckRecordImplementationInfo
|
|
1027 |
*
|
|
1028 |
* @xxxx
|
|
1029 |
*
|
|
1030 |
*/
|
|
1031 |
CTestStepRecorderCheckRecordImplementationInfo* CTestStepRecorderCheckRecordImplementationInfo::NewL()
|
|
1032 |
{
|
|
1033 |
CTestStepRecorderCheckRecordImplementationInfo* self = new(ELeave) CTestStepRecorderCheckRecordImplementationInfo;
|
|
1034 |
return self;
|
|
1035 |
}
|
|
1036 |
|
|
1037 |
/**
|
|
1038 |
*
|
|
1039 |
* Test step constructor.
|
|
1040 |
* Each test step initialises its own name.
|
|
1041 |
*
|
|
1042 |
* @xxxx
|
|
1043 |
*
|
|
1044 |
*/
|
|
1045 |
CTestStepRecorderCheckRecordImplementationInfo::CTestStepRecorderCheckRecordImplementationInfo()
|
|
1046 |
{
|
|
1047 |
iTestStepResult = EPass;
|
|
1048 |
// store the name of this test case
|
|
1049 |
// this is the name that is used by the script file
|
|
1050 |
iTestStepName = _L("MM-MMF-ACLNT-U-1007-HP");
|
|
1051 |
}
|
|
1052 |
|
|
1053 |
/**
|
|
1054 |
*
|
|
1055 |
* Test step destructor.
|
|
1056 |
*
|
|
1057 |
* @xxxx
|
|
1058 |
*
|
|
1059 |
*/
|
|
1060 |
CTestStepRecorderCheckRecordImplementationInfo::~CTestStepRecorderCheckRecordImplementationInfo()
|
|
1061 |
{
|
|
1062 |
}
|
|
1063 |
|
|
1064 |
void CTestStepRecorderCheckRecordImplementationInfo::MoscoStateChangeEvent(CBase* /*aObject*/,
|
|
1065 |
TInt aPreviousState,
|
|
1066 |
TInt aCurrentState,
|
|
1067 |
TInt aErrorcCode)
|
|
1068 |
{
|
|
1069 |
iError = aErrorcCode;
|
|
1070 |
if (aPreviousState == CMdaAudioClipUtility::ENotReady
|
|
1071 |
&& aCurrentState == CMdaAudioClipUtility::EOpen)
|
|
1072 |
{
|
|
1073 |
iIsOpen = ETrue;
|
|
1074 |
}
|
|
1075 |
CActiveScheduler::Stop();
|
|
1076 |
}
|
|
1077 |
|
|
1078 |
|
|
1079 |
/**
|
|
1080 |
*
|
|
1081 |
* Test step Preamble.
|
|
1082 |
*
|
|
1083 |
* @xxxx
|
|
1084 |
*
|
|
1085 |
*/
|
|
1086 |
TVerdict CTestStepRecorderCheckRecordImplementationInfo::DoTestStepPreambleL(void)
|
|
1087 |
{
|
|
1088 |
// this installs the scheduler
|
|
1089 |
TVerdict verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL();
|
|
1090 |
if (verdict != EPass)
|
|
1091 |
{
|
|
1092 |
return verdict;
|
|
1093 |
}
|
|
1094 |
|
|
1095 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioPlayFName1"), iFileName))
|
|
1096 |
{
|
|
1097 |
return EInconclusive;
|
|
1098 |
}
|
|
1099 |
|
|
1100 |
// Printing to the console and log file
|
|
1101 |
INFO_PRINTF1(iTestStepName);
|
|
1102 |
INFO_PRINTF1(_L("this test is a test of CMMFMdaAudioRecorderUtility::ControllerImplementationInformationL()"));
|
|
1103 |
|
|
1104 |
return verdict;
|
|
1105 |
}
|
|
1106 |
|
|
1107 |
/**
|
|
1108 |
*
|
|
1109 |
* Test step Postamble.
|
|
1110 |
*
|
|
1111 |
* @xxxx
|
|
1112 |
*
|
|
1113 |
*/
|
|
1114 |
enum TVerdict CTestStepRecorderCheckRecordImplementationInfo::DoTestStepPostambleL(void)
|
|
1115 |
{
|
|
1116 |
//[ Destroy the scheduler ]
|
|
1117 |
return CTestStepUnitMMFAudClient::DoTestStepPostambleL();
|
|
1118 |
}
|
|
1119 |
|
|
1120 |
/**
|
|
1121 |
*
|
|
1122 |
* Do the test step.
|
|
1123 |
* Each test step must supply an implementation for DoTestStepL.
|
|
1124 |
*
|
|
1125 |
* @return "TVerdict"
|
|
1126 |
* The result of the test step
|
|
1127 |
*
|
|
1128 |
* @xxxx
|
|
1129 |
*
|
|
1130 |
*/
|
|
1131 |
TVerdict CTestStepRecorderCheckRecordImplementationInfo::DoTestStepL()
|
|
1132 |
{
|
|
1133 |
TInt err = KErrNone;
|
|
1134 |
|
|
1135 |
iTestStepResult = EFail;
|
|
1136 |
|
|
1137 |
iRecorder = CMMFMdaAudioRecorderUtility::NewL(*this);
|
|
1138 |
|
|
1139 |
TRAP(err, iRecorder->OpenFileL(iFileName));
|
|
1140 |
|
|
1141 |
if (err != KErrNone)
|
|
1142 |
{
|
|
1143 |
return EInconclusive;
|
|
1144 |
}
|
|
1145 |
|
|
1146 |
CActiveScheduler::Start();
|
|
1147 |
|
|
1148 |
if (iError != KErrNone)
|
|
1149 |
{
|
|
1150 |
return EInconclusive;
|
|
1151 |
}
|
|
1152 |
|
|
1153 |
const CMMFControllerImplementationInformation* info = NULL;
|
|
1154 |
|
|
1155 |
TRAP(err, info = &iRecorder->AudioRecorderControllerImplementationInformationL());
|
|
1156 |
if (err != KErrNone)
|
|
1157 |
{
|
|
1158 |
return EFail;
|
|
1159 |
}
|
|
1160 |
|
|
1161 |
TBuf<40> displayName;
|
|
1162 |
displayName.Copy(info->DisplayName());
|
|
1163 |
|
|
1164 |
iRecorder->Close();
|
|
1165 |
|
|
1166 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioFNameTestController"), iFileName))
|
|
1167 |
{
|
|
1168 |
return EInconclusive;
|
|
1169 |
}
|
|
1170 |
|
|
1171 |
TUid testController = TUid::Uid(KUidTestController);
|
|
1172 |
TRAP(err, iRecorder->OpenFileL(iFileName,
|
|
1173 |
testController,
|
|
1174 |
testController,
|
|
1175 |
KNullUid));
|
|
1176 |
if (err != KErrNone)
|
|
1177 |
{
|
|
1178 |
return EInconclusive;
|
|
1179 |
}
|
|
1180 |
|
|
1181 |
CActiveScheduler::Start();
|
|
1182 |
|
|
1183 |
if (iError != KErrNone)
|
|
1184 |
{
|
|
1185 |
return EInconclusive;
|
|
1186 |
}
|
|
1187 |
|
|
1188 |
TRAP(err, info = &iRecorder->AudioRecorderControllerImplementationInformationL());
|
|
1189 |
|
|
1190 |
if(info->DisplayName().Compare(displayName) != 0)
|
|
1191 |
{
|
|
1192 |
iTestStepResult = EPass;
|
|
1193 |
}
|
|
1194 |
else
|
|
1195 |
{
|
|
1196 |
iTestStepResult = EFail;
|
|
1197 |
}
|
|
1198 |
|
|
1199 |
delete iRecorder;
|
|
1200 |
iRecorder = NULL;
|
|
1201 |
|
|
1202 |
INFO_PRINTF1(_L("finished with this test step"));
|
|
1203 |
// test steps return a result
|
|
1204 |
return iTestStepResult;
|
|
1205 |
}
|
|
1206 |
|
|
1207 |
|