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 "TestStepRecorder.h"
|
|
44 |
|
|
45 |
|
|
46 |
#include "MmfAudioController.h"
|
|
47 |
#include "mmfclientaudiorecorder.h"
|
|
48 |
//#include "MmfClientAudioPlayer.h"
|
|
49 |
//#include <mmffourcc.h>
|
|
50 |
//#include <mmfpaniccodes.h>
|
|
51 |
//#include <mmfFormatImplementationUIDs.hrh>
|
|
52 |
// --------------------------------------------
|
|
53 |
|
|
54 |
/**
|
|
55 |
*
|
|
56 |
* Static constructor for CTestStepRecorderNew.
|
|
57 |
*
|
|
58 |
*
|
|
59 |
* @return "CTestStepRecorderNew*"
|
|
60 |
* The constructed CTestStepRecorderNew
|
|
61 |
*
|
|
62 |
* @xxxx
|
|
63 |
*
|
|
64 |
*/
|
|
65 |
CTestStepRecorderNew* CTestStepRecorderNew::NewL()
|
|
66 |
{
|
|
67 |
CTestStepRecorderNew* self = new(ELeave) CTestStepRecorderNew;
|
|
68 |
return self;
|
|
69 |
}
|
|
70 |
|
|
71 |
/**
|
|
72 |
*
|
|
73 |
* Test step constructor.
|
|
74 |
* Each test step initialises its own name.
|
|
75 |
*
|
|
76 |
* @xxxx
|
|
77 |
*
|
|
78 |
*/
|
|
79 |
CTestStepRecorderNew::CTestStepRecorderNew()
|
|
80 |
{
|
|
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-0200-CP");
|
|
84 |
}
|
|
85 |
|
|
86 |
/**
|
|
87 |
*
|
|
88 |
* Test step destructor.
|
|
89 |
*
|
|
90 |
* @xxxx
|
|
91 |
*
|
|
92 |
*/
|
|
93 |
CTestStepRecorderNew::~CTestStepRecorderNew()
|
|
94 |
{
|
|
95 |
}
|
|
96 |
|
|
97 |
void CTestStepRecorderNew::MoscoStateChangeEvent(CBase* /*aObject*/,
|
|
98 |
TInt /*aPreviousState*/,
|
|
99 |
TInt /*aCurrentState*/,
|
|
100 |
TInt aErrorcCode)
|
|
101 |
{
|
|
102 |
iError = aErrorcCode;
|
|
103 |
CActiveScheduler::Stop();
|
|
104 |
}
|
|
105 |
|
|
106 |
/**
|
|
107 |
*
|
|
108 |
* Do the test step.
|
|
109 |
* Each test step must supply an implementation for DoTestStepL.
|
|
110 |
*
|
|
111 |
* @return "TVerdict"
|
|
112 |
* The result of the test step
|
|
113 |
*
|
|
114 |
* @xxxx
|
|
115 |
*
|
|
116 |
*/
|
|
117 |
TVerdict CTestStepRecorderNew::DoTestStepL()
|
|
118 |
{
|
|
119 |
iTestStepResult = EPass;
|
|
120 |
|
|
121 |
// Printing to the console and log file
|
|
122 |
INFO_PRINTF1(_L("MM-MMF-ACLNT-U-0200-CP"));
|
|
123 |
INFO_PRINTF1(_L("this is a test of CMdaAudioRecordererUtility::NewL() "));
|
|
124 |
|
|
125 |
//__MM_HEAP_MARK;
|
|
126 |
iRecorder = CMMFMdaAudioRecorderUtility::NewL(*this);
|
|
127 |
|
|
128 |
if (iRecorder == NULL ||
|
|
129 |
iError != KErrNone ||
|
|
130 |
iRecorder->State() != CMdaAudioRecorderUtility::ENotReady )
|
|
131 |
iTestStepResult = EFail;
|
|
132 |
|
|
133 |
delete iRecorder;
|
|
134 |
iRecorder = NULL;
|
|
135 |
//__MM_HEAP_MARKEND;
|
|
136 |
|
|
137 |
INFO_PRINTF1(_L("finished with this test step"));
|
|
138 |
// test steps return a result
|
|
139 |
return iTestStepResult;
|
|
140 |
}
|
|
141 |
|