|
1 // Copyright (c) 2007-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 // Declarations of Integration test step classes for A3F DevSound Tone cases. |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef TSI_A3F_DEVSOUND_TONE_H |
|
19 #define TSI_A3F_DEVSOUND_TONE_H |
|
20 |
|
21 // User includes |
|
22 #include "tsi_a3f_devsound_teststep.h" |
|
23 |
|
24 // Enumerations |
|
25 enum TDevSoundToneState |
|
26 { |
|
27 EStateToneStart = 0, |
|
28 EStateToneInitializing, |
|
29 EStateTonePlaying, |
|
30 EStateTonePaused |
|
31 }; |
|
32 |
|
33 enum TDevSoundToneEvents |
|
34 { |
|
35 EEventToneStart = 0, |
|
36 EEventInitCompleteTone, |
|
37 EEventToneTimerComplete |
|
38 }; |
|
39 |
|
40 class RTestStepA3FDevSoundToneBase : public RAsyncTestStep, |
|
41 public MDevSoundObserver |
|
42 { |
|
43 public: |
|
44 // From RAsyncTestStep |
|
45 virtual void KickoffTestL(); |
|
46 void CloseTest(); |
|
47 |
|
48 protected: |
|
49 RTestStepA3FDevSoundToneBase(const TDesC& aTestName, const TDesC& aSectName); |
|
50 RTestStepA3FDevSoundToneBase(const TDesC& aTestName); |
|
51 |
|
52 virtual void DoKickoffTestL() = 0; |
|
53 |
|
54 // Executes the tone events of DevSound using a Finite State Machine |
|
55 virtual void Fsm(TDevSoundToneEvents aDevSoundEvent, TInt aError) = 0; |
|
56 |
|
57 // From MDevSoundObserver |
|
58 virtual void InitializeComplete(TInt aError); |
|
59 virtual void ToneFinished(TInt aError); |
|
60 virtual void BufferToBeFilled(CMMFBuffer* aBuffer); |
|
61 virtual void PlayError(TInt aError); |
|
62 virtual void BufferToBeEmptied(CMMFBuffer* aBuffer); |
|
63 virtual void RecordError(TInt aError); |
|
64 virtual void ConvertError(TInt aError); |
|
65 virtual void DeviceMessage(TUid aMessageType, const TDesC8& aMsg); |
|
66 |
|
67 // Timer Callback |
|
68 static TInt TimerCallback(TAny*); |
|
69 virtual void DoTimerCallback(); |
|
70 |
|
71 TUint ConvertDesToTMMFSampleRate(const TDesC& aSampleRateString); |
|
72 |
|
73 protected: |
|
74 |
|
75 CMMFDevSound* iMMFDevSound; |
|
76 TBuf<KNameSize> iSectName; |
|
77 CPeriodic* iTimer; |
|
78 TCallBack iCallBack; |
|
79 TDevSoundToneState iState; |
|
80 TPtrC iSampleRate; |
|
81 |
|
82 }; |
|
83 |
|
84 /* |
|
85 * |
|
86 * RStepA3FDevSoundDTMFTonePlay |
|
87 * - Set DTMF lengths and play DTMF string |
|
88 * |
|
89 */ |
|
90 class RStepA3FDevSoundDTMFTonePlay : public RTestStepA3FDevSoundToneBase |
|
91 { |
|
92 public: |
|
93 static RStepA3FDevSoundDTMFTonePlay* NewL(const TDesC& aTestName); |
|
94 |
|
95 private: |
|
96 RStepA3FDevSoundDTMFTonePlay(const TDesC& aTestName); |
|
97 |
|
98 // From RTestStepA3FDevSoundToneBase |
|
99 virtual void DoKickoffTestL(); |
|
100 virtual void Fsm(TDevSoundToneEvents aDevSoundEvent, TInt aError); |
|
101 |
|
102 }; |
|
103 |
|
104 /* |
|
105 * |
|
106 * RStepA3FDevSoundNormalAndDualTonePlay |
|
107 * - Set tone repeats and play normal tone |
|
108 * - Set tone repeats and play dual tone |
|
109 * |
|
110 */ |
|
111 class RStepA3FDevSoundNormalAndDualTonePlay : public RTestStepA3FDevSoundToneBase |
|
112 { |
|
113 public: |
|
114 static RStepA3FDevSoundNormalAndDualTonePlay* NewL(const TDesC& aTestName, const TDesC& aSectName); |
|
115 |
|
116 private: |
|
117 RStepA3FDevSoundNormalAndDualTonePlay(const TDesC& aTestName, const TDesC& aSectName); |
|
118 |
|
119 // From RTestStepA3FDevSoundToneBase |
|
120 virtual void DoKickoffTestL(); |
|
121 virtual void Fsm(TDevSoundToneEvents aDevSoundEvent, TInt aError); |
|
122 |
|
123 private: |
|
124 TInt iRepeat; |
|
125 TBool iDualTone; |
|
126 |
|
127 }; |
|
128 |
|
129 /* |
|
130 * |
|
131 * RStepA3FDevSoundInitializeWhileTonePlaying |
|
132 * |
|
133 */ |
|
134 class RStepA3FDevSoundInitializeWhileTonePlaying : public RTestStepA3FDevSoundToneBase |
|
135 { |
|
136 public: |
|
137 static RStepA3FDevSoundInitializeWhileTonePlaying* NewL(const TDesC& aTestName); |
|
138 |
|
139 private: |
|
140 RStepA3FDevSoundInitializeWhileTonePlaying(const TDesC& aTestName); |
|
141 |
|
142 // From RTestStepA3FDevSoundToneBase |
|
143 virtual void DoKickoffTestL(); |
|
144 virtual void Fsm(TDevSoundToneEvents aDevSoundEvent, TInt aError); |
|
145 |
|
146 }; |
|
147 |
|
148 /* |
|
149 * |
|
150 * RStepA3FDevSoundNotSupportedPlayFixedSeq |
|
151 * |
|
152 */ |
|
153 class RStepA3FDevSoundNotSupportedPlayFixedSeq : public RTestStepA3FDevSoundToneBase |
|
154 { |
|
155 public: |
|
156 static RStepA3FDevSoundNotSupportedPlayFixedSeq* NewL(const TDesC& aTestName); |
|
157 |
|
158 private: |
|
159 RStepA3FDevSoundNotSupportedPlayFixedSeq(const TDesC& aTestName); |
|
160 |
|
161 // From RTestStepA3FDevSoundToneBase |
|
162 virtual void DoKickoffTestL(); |
|
163 virtual void Fsm(TDevSoundToneEvents aDevSoundEvent, TInt aError); |
|
164 |
|
165 }; |
|
166 |
|
167 /* |
|
168 * |
|
169 * RStepA3FDevSoundInvalidInitializeForTone |
|
170 * |
|
171 */ |
|
172 class RStepA3FDevSoundInvalidInitializeForTone : public RTestStepA3FDevSoundToneBase |
|
173 { |
|
174 public: |
|
175 static RStepA3FDevSoundInvalidInitializeForTone* NewL(const TDesC& aTestName); |
|
176 |
|
177 private: |
|
178 RStepA3FDevSoundInvalidInitializeForTone(const TDesC& aTestName); |
|
179 |
|
180 // From RTestStepA3FDevSoundToneBase |
|
181 virtual void DoKickoffTestL(); |
|
182 virtual void Fsm(TDevSoundToneEvents aDevSoundEvent, TInt aError); |
|
183 |
|
184 }; |
|
185 |
|
186 /* |
|
187 * |
|
188 * RStepA3FDevSoundCancelInitializeTone |
|
189 * |
|
190 */ |
|
191 class RStepA3FDevSoundCancelInitializeTone : public RTestStepA3FDevSoundToneBase |
|
192 { |
|
193 public: |
|
194 static RStepA3FDevSoundCancelInitializeTone* NewL(const TDesC& aTestName, const TDesC& aSectName); |
|
195 |
|
196 private: |
|
197 RStepA3FDevSoundCancelInitializeTone(const TDesC& aTestName, const TDesC& aSectName); |
|
198 |
|
199 // From RTestStepA3FDevSoundToneBase |
|
200 virtual void DoKickoffTestL(); |
|
201 virtual void Fsm(TDevSoundToneEvents aDevSoundEvent, TInt aError); |
|
202 |
|
203 // From TimerCallback |
|
204 virtual void DoTimerCallback(); |
|
205 |
|
206 // From MDevSoundObserver |
|
207 virtual void InitializeComplete(TInt aError); |
|
208 |
|
209 }; |
|
210 |
|
211 /* |
|
212 * |
|
213 * RStepA3FDevSoundEmptyBuffersInitializedForTone |
|
214 * |
|
215 */ |
|
216 class RStepA3FDevSoundEmptyBuffersInitializedForTone : public RTestStepA3FDevSoundToneBase |
|
217 { |
|
218 public: |
|
219 static RStepA3FDevSoundEmptyBuffersInitializedForTone* NewL(const TDesC& aTestName, const TDesC& aSectName); |
|
220 |
|
221 private: |
|
222 RStepA3FDevSoundEmptyBuffersInitializedForTone(const TDesC& aTestName, const TDesC& aSectName); |
|
223 |
|
224 // From RTestStepA3FDevSoundToneBase |
|
225 virtual void DoKickoffTestL(); |
|
226 virtual void Fsm(TDevSoundToneEvents aDevSoundEvent, TInt aError); |
|
227 |
|
228 }; |
|
229 |
|
230 /* |
|
231 * |
|
232 * RStepA3FDevSoundEmptyBuffersWhileTonePlaying |
|
233 * |
|
234 */ |
|
235 class RStepA3FDevSoundEmptyBuffersWhileTonePlaying : public RTestStepA3FDevSoundToneBase |
|
236 { |
|
237 public: |
|
238 static RStepA3FDevSoundEmptyBuffersWhileTonePlaying* NewL(const TDesC& aTestName); |
|
239 |
|
240 private: |
|
241 RStepA3FDevSoundEmptyBuffersWhileTonePlaying(const TDesC& aTestName); |
|
242 |
|
243 // From RTestStepA3FDevSoundToneBase |
|
244 virtual void DoKickoffTestL(); |
|
245 virtual void Fsm(TDevSoundToneEvents aDevSoundEvent, TInt aError); |
|
246 |
|
247 }; |
|
248 |
|
249 #endif // TSI_A3F_DEVSOUND_TONE_H |