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 testing steps for the Unit
|
|
15 |
// test of the MMF 'Deprecated' Audio Clients.
|
|
16 |
// Tests opening sounds of various formats
|
|
17 |
// from a file with various parameters and constructor calls
|
|
18 |
//
|
|
19 |
//
|
|
20 |
|
|
21 |
|
|
22 |
#ifndef __TEST_STEP_RECORDER_ALLOCFAIL__
|
|
23 |
#define __TEST_STEP_RECORDER_ALLOCFAIL__
|
|
24 |
|
|
25 |
#include <mda/client/utility.h>
|
|
26 |
#include "mmfclientaudiorecorder.h"
|
|
27 |
|
|
28 |
/**
|
|
29 |
*
|
|
30 |
* Alloc Failure New Recorder utility
|
|
31 |
*
|
|
32 |
* @lib "TSU_MMF_ACLNT_01.lib"
|
|
33 |
*
|
|
34 |
* @xxxx
|
|
35 |
*
|
|
36 |
*/
|
|
37 |
class CTestStepRecorderAllocFailNew : public CTestStepUnitMMFAudClient,
|
|
38 |
public MMdaObjectStateChangeObserver
|
|
39 |
{
|
|
40 |
public:
|
|
41 |
static CTestStepRecorderAllocFailNew* NewL();
|
|
42 |
CTestStepRecorderAllocFailNew();
|
|
43 |
~CTestStepRecorderAllocFailNew();
|
|
44 |
virtual TVerdict DoTestStepL();
|
|
45 |
|
|
46 |
// from MMdaObjectStateChangeObserver
|
|
47 |
void MoscoStateChangeEvent(CBase* /*aObject*/, TInt /*aPreviousState*/, TInt /*aCurrentState*/, TInt /*aErrorcCode*/);
|
|
48 |
|
|
49 |
private:
|
|
50 |
TInt iError;
|
|
51 |
CMMFMdaAudioRecorderUtility* iRecorder;
|
|
52 |
};
|
|
53 |
|
|
54 |
/**
|
|
55 |
*
|
|
56 |
* Alloc Failure Open sound from file
|
|
57 |
*
|
|
58 |
* @lib "TSU_MMF_ACLNT_01.lib"
|
|
59 |
*
|
|
60 |
* @xxxx
|
|
61 |
*
|
|
62 |
*/
|
|
63 |
class CTestStepRecorderAllocFailOpenFile : public CTestStepUnitMMFAudClient,
|
|
64 |
public MMdaObjectStateChangeObserver
|
|
65 |
{
|
|
66 |
public:
|
|
67 |
static CTestStepRecorderAllocFailOpenFile* NewL(TBool aUseFileHandle);
|
|
68 |
virtual enum TVerdict DoTestStepPreambleL(void);
|
|
69 |
virtual enum TVerdict DoTestStepPostambleL(void);
|
|
70 |
virtual TVerdict DoTestStepL();
|
|
71 |
|
|
72 |
// from MMdaObjectStateChangeObserver
|
|
73 |
void MoscoStateChangeEvent(CBase* /*aObject*/, TInt /*aPreviousState*/, TInt /*aCurrentState*/, TInt /*aErrorcCode*/);
|
|
74 |
|
|
75 |
private:
|
|
76 |
CMdaAudioRecorderUtility* iRecorder;
|
|
77 |
TBool iResultOK;
|
|
78 |
TBool iAllocOK;
|
|
79 |
TBool iUseFileHandle;
|
|
80 |
|
|
81 |
#ifdef __WINS__
|
|
82 |
TBool iKErrGeneralIgnored; //Ignore KErrGeneral on EMULATOR
|
|
83 |
#endif
|
|
84 |
};
|
|
85 |
|
|
86 |
/**
|
|
87 |
*
|
|
88 |
* Alloc Failure Open sound specifying a descriptor
|
|
89 |
*
|
|
90 |
* @lib "TSU_MMF_ACLNT_01.lib"
|
|
91 |
*
|
|
92 |
* @xxxx
|
|
93 |
*
|
|
94 |
*/
|
|
95 |
class CTestStepRecorderAllocFailOpenDesc : public CTestStepUnitMMFAudClient,
|
|
96 |
public MMdaObjectStateChangeObserver
|
|
97 |
{
|
|
98 |
public:
|
|
99 |
static CTestStepRecorderAllocFailOpenDesc* NewL();
|
|
100 |
CTestStepRecorderAllocFailOpenDesc();
|
|
101 |
~CTestStepRecorderAllocFailOpenDesc();
|
|
102 |
virtual enum TVerdict DoTestStepPreambleL(void);
|
|
103 |
virtual enum TVerdict DoTestStepPostambleL(void);
|
|
104 |
virtual TVerdict DoTestStepL();
|
|
105 |
|
|
106 |
// from MMdaObjectStateChangeObserver
|
|
107 |
void MoscoStateChangeEvent(CBase* /*aObject*/, TInt /*aPreviousState*/, TInt /*aCurrentState*/, TInt /*aErrorcCode*/);
|
|
108 |
|
|
109 |
private:
|
|
110 |
void OpenDescAndStartSchedulerL();
|
|
111 |
|
|
112 |
private:
|
|
113 |
TInt iError;
|
|
114 |
CMMFMdaAudioRecorderUtility* iRecorder;
|
|
115 |
HBufC8* iBuf;
|
|
116 |
TPtr8* iDes8;
|
|
117 |
};
|
|
118 |
|
|
119 |
/**
|
|
120 |
*
|
|
121 |
* Alloc Failure Open sound specifying a url
|
|
122 |
*
|
|
123 |
* @lib "TSU_MMF_ACLNT_01.lib"
|
|
124 |
*
|
|
125 |
* @xxxx
|
|
126 |
*
|
|
127 |
*/
|
|
128 |
class CTestStepRecorderAllocFailOpenUrl : public CTestStepUnitMMFAudClient,
|
|
129 |
public MMdaObjectStateChangeObserver
|
|
130 |
{
|
|
131 |
public:
|
|
132 |
static CTestStepRecorderAllocFailOpenUrl* NewL();
|
|
133 |
CTestStepRecorderAllocFailOpenUrl();
|
|
134 |
~CTestStepRecorderAllocFailOpenUrl();
|
|
135 |
virtual enum TVerdict DoTestStepPreambleL(void);
|
|
136 |
virtual enum TVerdict DoTestStepPostambleL(void);
|
|
137 |
virtual TVerdict DoTestStepL();
|
|
138 |
|
|
139 |
// from MMdaObjectStateChangeObserver
|
|
140 |
void MoscoStateChangeEvent(CBase* /*aObject*/, TInt /*aPreviousState*/, TInt /*aCurrentState*/, TInt /*aErrorcCode*/);
|
|
141 |
|
|
142 |
private:
|
|
143 |
void OpenUrlAndStartSchedulerL();
|
|
144 |
|
|
145 |
private:
|
|
146 |
TInt iError;
|
|
147 |
CMMFMdaAudioRecorderUtility* iRecorder;
|
|
148 |
};
|
|
149 |
|
|
150 |
|
|
151 |
/**
|
|
152 |
*
|
|
153 |
* Alloc Failure Play sound
|
|
154 |
*
|
|
155 |
* @lib "TSU_MMF_ACLNT_01.lib"
|
|
156 |
*
|
|
157 |
* @xxxx
|
|
158 |
*
|
|
159 |
*/
|
|
160 |
class CTestStepRecorderAllocFailOpen : public CTestStepUnitMMFAudClient,
|
|
161 |
public MMdaObjectStateChangeObserver
|
|
162 |
{
|
|
163 |
public:
|
|
164 |
static CTestStepRecorderAllocFailOpen* NewL();
|
|
165 |
CTestStepRecorderAllocFailOpen();
|
|
166 |
~CTestStepRecorderAllocFailOpen();
|
|
167 |
virtual enum TVerdict DoTestStepPreambleL(void);
|
|
168 |
virtual enum TVerdict DoTestStepPostambleL(void);
|
|
169 |
virtual TVerdict DoTestStepL();
|
|
170 |
|
|
171 |
// from MMdaObjectStateChangeObserver
|
|
172 |
void MoscoStateChangeEvent(CBase* /*aObject*/, TInt /*aPreviousState*/, TInt /*aCurrentState*/, TInt /*aErrorcCode*/);
|
|
173 |
|
|
174 |
private:
|
|
175 |
void OpenAndStartSchedulerL();
|
|
176 |
|
|
177 |
private:
|
|
178 |
TInt iError;
|
|
179 |
CMMFMdaAudioRecorderUtility* iRecorder;
|
|
180 |
TMdaFileClipLocation* iClipLocation;
|
|
181 |
TMdaClipFormat* iFormat;
|
|
182 |
};
|
|
183 |
|
|
184 |
/**
|
|
185 |
*
|
|
186 |
* Alloc Failure Play sound
|
|
187 |
*
|
|
188 |
* @lib "TSU_MMF_ACLNT_01.lib"
|
|
189 |
*
|
|
190 |
* @xxxx
|
|
191 |
*
|
|
192 |
*/
|
|
193 |
class CTestStepRecorderAllocFailPlay : public CTestStepUnitMMFAudClient,
|
|
194 |
public MMdaObjectStateChangeObserver
|
|
195 |
{
|
|
196 |
public:
|
|
197 |
static CTestStepRecorderAllocFailPlay* NewL();
|
|
198 |
CTestStepRecorderAllocFailPlay();
|
|
199 |
~CTestStepRecorderAllocFailPlay();
|
|
200 |
virtual enum TVerdict DoTestStepPreambleL(void);
|
|
201 |
virtual enum TVerdict DoTestStepPostambleL(void);
|
|
202 |
virtual TVerdict DoTestStepL();
|
|
203 |
|
|
204 |
// from MMdaObjectStateChangeObserver
|
|
205 |
void MoscoStateChangeEvent(CBase* /*aObject*/, TInt /*aPreviousState*/, TInt /*aCurrentState*/, TInt /*aErrorcCode*/);
|
|
206 |
|
|
207 |
private:
|
|
208 |
void PlayAndStartSchedulerL();
|
|
209 |
|
|
210 |
private:
|
|
211 |
TInt iError;
|
|
212 |
CMMFMdaAudioRecorderUtility* iRecorder;
|
|
213 |
};
|
|
214 |
|
|
215 |
/**
|
|
216 |
*
|
|
217 |
* Alloc Failure Record sound
|
|
218 |
*
|
|
219 |
* @lib "TSU_MMF_ACLNT_01.lib"
|
|
220 |
*
|
|
221 |
* @xxxx
|
|
222 |
*
|
|
223 |
*/
|
|
224 |
class CTestStepRecorderAllocFailRecord : public CTestStepUnitMMFAudClient,
|
|
225 |
public MMdaObjectStateChangeObserver
|
|
226 |
{
|
|
227 |
public:
|
|
228 |
static CTestStepRecorderAllocFailRecord* NewL();
|
|
229 |
CTestStepRecorderAllocFailRecord();
|
|
230 |
~CTestStepRecorderAllocFailRecord();
|
|
231 |
virtual enum TVerdict DoTestStepPreambleL(void);
|
|
232 |
virtual enum TVerdict DoTestStepPostambleL(void);
|
|
233 |
virtual TVerdict DoTestStepL();
|
|
234 |
|
|
235 |
// from MMdaObjectStateChangeObserver
|
|
236 |
void MoscoStateChangeEvent(CBase* /*aObject*/, TInt /*aPreviousState*/, TInt /*aCurrentState*/, TInt /*aErrorcCode*/);
|
|
237 |
|
|
238 |
private:
|
|
239 |
void RecordAndStartSchedulerL();
|
|
240 |
|
|
241 |
private:
|
|
242 |
TInt iError;
|
|
243 |
TBool iHasRecorded;
|
|
244 |
CMMFMdaAudioRecorderUtility* iRecorder;
|
|
245 |
TBool iSimulateDriveRemoval;
|
|
246 |
};
|
|
247 |
|
|
248 |
/**
|
|
249 |
*
|
|
250 |
* Alloc Failure Crop sound
|
|
251 |
*
|
|
252 |
* @lib "TSU_MMF_ACLNT_01.lib"
|
|
253 |
*
|
|
254 |
* @xxxx
|
|
255 |
*
|
|
256 |
*/
|
|
257 |
class CTestStepRecorderAllocFailCrop : public CTestStepUnitMMFAudClient,
|
|
258 |
public MMdaObjectStateChangeObserver
|
|
259 |
{
|
|
260 |
public:
|
|
261 |
static CTestStepRecorderAllocFailCrop* NewL();
|
|
262 |
CTestStepRecorderAllocFailCrop();
|
|
263 |
~CTestStepRecorderAllocFailCrop();
|
|
264 |
virtual enum TVerdict DoTestStepPreambleL(void);
|
|
265 |
virtual enum TVerdict DoTestStepPostambleL(void);
|
|
266 |
virtual TVerdict DoTestStepL();
|
|
267 |
|
|
268 |
// from MMdaObjectStateChangeObserver
|
|
269 |
void MoscoStateChangeEvent(CBase* /*aObject*/, TInt /*aPreviousState*/, TInt /*aCurrentState*/, TInt /*aErrorcCode*/);
|
|
270 |
|
|
271 |
private:
|
|
272 |
void CropAndStartSchedulerL();
|
|
273 |
|
|
274 |
private:
|
|
275 |
TInt iError;
|
|
276 |
TInt64 iOrigDuration;
|
|
277 |
TBool iHasCropped;
|
|
278 |
TBuf<100> iFileNameTmp;
|
|
279 |
CFileMan* iFileMan;
|
|
280 |
CMMFMdaAudioRecorderUtility* iRecorder;
|
|
281 |
};
|
|
282 |
|
|
283 |
|
|
284 |
|
|
285 |
|
|
286 |
#endif //(__TEST_STEP_RECORDER_ALLOCFAIL__)
|