0
|
1 |
// Copyright (c) 2006-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 |
|
|
49 |
#include "../../ctlfrm/TS_Codes.h"
|
|
50 |
|
|
51 |
|
|
52 |
/**
|
|
53 |
*
|
|
54 |
* Static constructor for CTestStepRecorderOpenTryNextCtrl.
|
|
55 |
*
|
|
56 |
*
|
|
57 |
* @return "CTestStepRecorderOpenTryNextCtrl*"
|
|
58 |
* The constructed CTestStepRecorderOpenTryNextCtrl
|
|
59 |
*
|
|
60 |
* @xxxx
|
|
61 |
*
|
|
62 |
*/
|
|
63 |
CTestStepRecorderOpenTryNextCtrl* CTestStepRecorderOpenTryNextCtrl::NewL()
|
|
64 |
{
|
|
65 |
CTestStepRecorderOpenTryNextCtrl* self = new(ELeave) CTestStepRecorderOpenTryNextCtrl;
|
|
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 |
CTestStepRecorderOpenTryNextCtrl::CTestStepRecorderOpenTryNextCtrl()
|
|
78 |
{
|
|
79 |
// store the name of this test case
|
|
80 |
// this is the name that is used by the script file
|
|
81 |
iTestStepName = _L("MM-MMF-ACLNT-U-0960-CP");
|
|
82 |
}
|
|
83 |
|
|
84 |
/**
|
|
85 |
*
|
|
86 |
* Test step destructor.
|
|
87 |
*
|
|
88 |
* @xxxx
|
|
89 |
*
|
|
90 |
*/
|
|
91 |
CTestStepRecorderOpenTryNextCtrl::~CTestStepRecorderOpenTryNextCtrl()
|
|
92 |
{
|
|
93 |
}
|
|
94 |
|
|
95 |
/**
|
|
96 |
*
|
|
97 |
* Test step Preamble.
|
|
98 |
*
|
|
99 |
* @xxxx
|
|
100 |
*
|
|
101 |
*/
|
|
102 |
enum TVerdict CTestStepRecorderOpenTryNextCtrl::DoTestStepPreambleL(void)
|
|
103 |
{
|
|
104 |
enum TVerdict verdict;
|
|
105 |
// this installs the scheduler
|
|
106 |
verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL();
|
|
107 |
|
|
108 |
// Printing to the console and log file
|
|
109 |
INFO_PRINTF1(_L("MM-MMF-ACLNT-U-0960-CP"));
|
|
110 |
INFO_PRINTF1(_L("this is a test of CMdaAudioRecorderUtility::OpenUrlL()"));
|
|
111 |
|
|
112 |
if(!GetStringFromConfig(_L("SectionOne"), _L("AudioURLTestNextController"), iURL) )
|
|
113 |
{
|
|
114 |
return EInconclusive;
|
|
115 |
}
|
|
116 |
|
|
117 |
return verdict;
|
|
118 |
|
|
119 |
}
|
|
120 |
|
|
121 |
/**
|
|
122 |
*
|
|
123 |
* Test step Postamble.
|
|
124 |
*
|
|
125 |
* @xxxx
|
|
126 |
*
|
|
127 |
*/
|
|
128 |
enum TVerdict CTestStepRecorderOpenTryNextCtrl::DoTestStepPostambleL(void)
|
|
129 |
{
|
|
130 |
delete iRecorder;
|
|
131 |
iRecorder = NULL;
|
|
132 |
//[ Destroy the scheduler ]
|
|
133 |
return CTestStepUnitMMFAudClient::DoTestStepPostambleL();
|
|
134 |
}
|
|
135 |
|
|
136 |
/**
|
|
137 |
*
|
|
138 |
* Callback Handle.
|
|
139 |
*
|
|
140 |
* @xxxx
|
|
141 |
*
|
|
142 |
*/
|
|
143 |
void CTestStepRecorderOpenTryNextCtrl::MoscoStateChangeEvent(CBase* /*aObject*/,
|
|
144 |
TInt /*aPreviousState*/,
|
|
145 |
TInt /*aCurrentState*/,
|
|
146 |
TInt aErrorcCode)
|
|
147 |
{
|
|
148 |
iError = aErrorcCode;
|
|
149 |
CActiveScheduler::Stop();
|
|
150 |
}
|
|
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 CTestStepRecorderOpenTryNextCtrl::DoTestStepL()
|
|
165 |
{
|
|
166 |
iTestStepResult = EPass;
|
|
167 |
TInt err = KErrNone;
|
|
168 |
|
|
169 |
// create the Recorder utility
|
|
170 |
TRAP(err, iRecorder = CMMFMdaAudioRecorderUtility::NewL(*this));
|
|
171 |
|
|
172 |
if (err != KErrNone)
|
|
173 |
{
|
|
174 |
return EInconclusive;
|
|
175 |
}
|
|
176 |
|
|
177 |
TRAP(err, SetTestMediaIdL(iRecorder));
|
|
178 |
|
|
179 |
if (err != KErrNone)
|
|
180 |
{
|
|
181 |
return EInconclusive;
|
|
182 |
}
|
|
183 |
|
|
184 |
// load matching to filename
|
|
185 |
TRAP(err,iRecorder->OpenUrlL(iURL, KTestIap ));
|
|
186 |
|
|
187 |
if (err!=KErrNone)
|
|
188 |
{
|
|
189 |
return EInconclusive;
|
|
190 |
}
|
|
191 |
|
|
192 |
CActiveScheduler::Start();
|
|
193 |
|
|
194 |
if (iRecorder == NULL ||
|
|
195 |
err != KErrNone ||
|
|
196 |
iError != KErrNotSupported )
|
|
197 |
{
|
|
198 |
return EFail;
|
|
199 |
}
|
|
200 |
//need to remove <n>yes tag from 101f7790.RSS to really check for Trying Next Ctrl.
|
|
201 |
//in that case, KErrNone returned
|
|
202 |
if (iError == KErrNotSupported)
|
|
203 |
{
|
|
204 |
iTestStepResult = EPass;
|
|
205 |
}
|
|
206 |
else
|
|
207 |
{
|
|
208 |
iTestStepResult = EFail;
|
|
209 |
}
|
|
210 |
|
|
211 |
delete iRecorder;
|
|
212 |
iRecorder = NULL;
|
|
213 |
|
|
214 |
INFO_PRINTF1(_L("finished with this test step"));
|
|
215 |
// test steps return a result
|
|
216 |
return iTestStepResult;
|
|
217 |
}
|
|
218 |
|