|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: STIF testclass declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef SettingsTestMODULE_H |
|
19 #define SettingsTestMODULE_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <StifLogger.h> |
|
23 #include <TestScripterInternal.h> |
|
24 #include <StifTestModule.h> |
|
25 #include <TestclassAssert.h> |
|
26 //INTERNAL INCLUDES |
|
27 #include "cradiosettings.h" |
|
28 #include "mradiosettingsobserver.h" |
|
29 #include "trace.h" |
|
30 |
|
31 |
|
32 // CONSTANTS |
|
33 const TInt KErrBadTestParameter= -1000; // Error on configuration file |
|
34 |
|
35 const TInt KErrEventPending =-2000; // Timeout and not callback |
|
36 const TInt KErrCallbackErrorCode = -2001; // Callback return error code |
|
37 const TInt KErrUnexpectedValue =-2002; // Unexpected value at setting |
|
38 const TInt KExpectedFrequencyChange = -2003; // Is not finding more than one station |
|
39 const TInt KErrTimeoutController = -2007; // Unexpected notification |
|
40 |
|
41 // MACROS |
|
42 //#define ?macro ?macro_def |
|
43 #define TEST_CLASS_VERSION_MAJOR 1 |
|
44 #define TEST_CLASS_VERSION_MINOR 1 |
|
45 #define TEST_CLASS_VERSION_BUILD 1 |
|
46 |
|
47 // Logging path |
|
48 _LIT( KSettingsTestModuleLogPath, "\\logs\\testframework\\SettingsTestModule\\" ); |
|
49 // Log file |
|
50 _LIT( KSettingsTestModuleLogFile, "SettingsTestModule.txt" ); |
|
51 _LIT( KSettingsTestModuleLogFileWithTitle, "SettingsTestModule_[%S].txt" ); |
|
52 |
|
53 // FUNCTION PROTOTYPES |
|
54 //?type ?function_name(?arg_list); |
|
55 |
|
56 // FORWARD DECLARATIONS |
|
57 //class ?FORWARD_CLASSNAME; |
|
58 //class CSettingsTestModule; |
|
59 |
|
60 // DATA TYPES |
|
61 //enum ?declaration |
|
62 //typedef ?declaration |
|
63 //extern ?data_type; |
|
64 |
|
65 // CLASS DECLARATION |
|
66 |
|
67 /** |
|
68 * CSettingsTestModule test class for STIF Test Framework TestScripter. |
|
69 * ?other_description_lines |
|
70 * |
|
71 * @lib ?library |
|
72 * @since ?Series60_version |
|
73 */ |
|
74 NONSHARABLE_CLASS(CSettingsTestModule) : public CScriptBase, public MRadioSettingsObserver |
|
75 { |
|
76 public: // Constructors and destructor |
|
77 |
|
78 /** |
|
79 * Two-phased constructor. |
|
80 */ |
|
81 static CSettingsTestModule* NewL( CTestModuleIf& aTestModuleIf ); |
|
82 |
|
83 /** |
|
84 * Destructor. |
|
85 */ |
|
86 virtual ~CSettingsTestModule(); |
|
87 |
|
88 public: // New functions |
|
89 |
|
90 /** |
|
91 * ?member_description. |
|
92 * @since ?Series60_version |
|
93 * @param ?arg1 ?description |
|
94 * @return ?description |
|
95 */ |
|
96 //?type ?member_function( ?type ?arg1 ); |
|
97 |
|
98 public: // Functions from base classes |
|
99 |
|
100 /** |
|
101 * From CScriptBase Runs a script line. |
|
102 * @since ?Series60_version |
|
103 * @param aItem Script line containing method name and parameters |
|
104 * @return Symbian OS error code |
|
105 */ |
|
106 virtual TInt RunMethodL( CStifItemParser& aItem ); |
|
107 |
|
108 // MRadioSettingsObserver |
|
109 |
|
110 /** |
|
111 * From MRadioSettingsObserver. |
|
112 * Notifies of the change in RDS alternate frequency setting |
|
113 * |
|
114 * @param aEnabled ETrue if AF search is enabled, otherwise EFalse |
|
115 */ |
|
116 virtual void RdsAfSearchSettingChangedL( TBool aEnabled ); |
|
117 |
|
118 /** |
|
119 * From MRadioSettingsObserver. |
|
120 * Notifies of the change in region setting when it is changed |
|
121 * outside of the particular radio settings instance |
|
122 * |
|
123 * @param aRegion The new region ID |
|
124 */ |
|
125 virtual void RegionSettingChangedL( TInt aRegion ); |
|
126 |
|
127 protected: // New functions |
|
128 |
|
129 /** |
|
130 * ?member_description. |
|
131 * @since ?Series60_version |
|
132 * @param ?arg1 ?description |
|
133 * @return ?description |
|
134 */ |
|
135 //?type ?member_function( ?type ?arg1 ); |
|
136 // Test case functions |
|
137 TInt CreateSettingsL( CStifItemParser& aItem ); |
|
138 TInt DestroySettingsL( CStifItemParser& aItem ); |
|
139 |
|
140 TInt IsRegionAllowed( CStifItemParser& aItem ); |
|
141 |
|
142 TInt ResolveDriveL( CStifItemParser& aItem ); |
|
143 |
|
144 // Application Settings functions |
|
145 |
|
146 TInt SetFirstTimeStartPerformed( CStifItemParser& aItem ); |
|
147 TInt IsFirstTimeStart( CStifItemParser& aItem ); |
|
148 |
|
149 TInt SetUiFlags( CStifItemParser& aItem ); |
|
150 |
|
151 TInt UiFlags( CStifItemParser& aItem ); |
|
152 |
|
153 // Settings functions |
|
154 |
|
155 TInt HeadsetVolume ( CStifItemParser& aItem ); |
|
156 TInt SpeakerVolume ( CStifItemParser& aItem ); |
|
157 TInt Volume ( CStifItemParser& aItem ); |
|
158 TInt OutputMode ( CStifItemParser& aItem ); |
|
159 TInt AudioRoute ( CStifItemParser& aItem ); |
|
160 TInt IsHeadsetVolMuted ( CStifItemParser& aItem ); |
|
161 TInt IsSpeakerVolMuted ( CStifItemParser& aItem ); |
|
162 TInt IsVolMuted ( CStifItemParser& aItem ); |
|
163 TInt IsPowerOn ( CStifItemParser& aItem ); |
|
164 TInt TunedFrequency ( CStifItemParser& aItem ); |
|
165 TInt DefaultMinVolumeLevel ( CStifItemParser& aItem ); |
|
166 TInt CountRegions ( CStifItemParser& aItem ); |
|
167 TInt Region ( CStifItemParser& aItem ); |
|
168 TInt RegionId ( CStifItemParser& aItem ); |
|
169 TInt FrequencyStepSize ( CStifItemParser& aItem ); |
|
170 TInt MaxFrequency ( CStifItemParser& aItem ); |
|
171 TInt MinFrequency ( CStifItemParser& aItem ); |
|
172 TInt DecimalCount ( CStifItemParser& aItem ); |
|
173 TInt DefaultRegion ( CStifItemParser& aItem ); |
|
174 TInt NetworkId ( CStifItemParser& aItem ); |
|
175 TInt CountryCode ( CStifItemParser& aItem ); |
|
176 TInt OperatorMusicStoreURL ( CStifItemParser& aItem ); |
|
177 TInt OperatorMusicStoreName ( CStifItemParser& aItem ); |
|
178 |
|
179 // Setter functions |
|
180 |
|
181 TInt SetHeadsetVolume ( CStifItemParser& aItem ); |
|
182 TInt SetSpeakerVolume ( CStifItemParser& aItem ); |
|
183 TInt SetVolume ( CStifItemParser& aItem ); |
|
184 TInt SetOutputMode ( CStifItemParser& aItem ); |
|
185 TInt SetAudioRoute ( CStifItemParser& aItem ); |
|
186 TInt SetHeadsetVolMuted ( CStifItemParser& aItem ); |
|
187 TInt SetSpeakerVolMuted ( CStifItemParser& aItem ); |
|
188 TInt SetVolMuted ( CStifItemParser& aItem ); |
|
189 TInt SetPowerOn ( CStifItemParser& aItem ); |
|
190 TInt SetTunedFrequency ( CStifItemParser& aItem ); |
|
191 TInt SetRegionId ( CStifItemParser& aItem ); |
|
192 TInt SetNetworkId ( CStifItemParser& aItem ); |
|
193 TInt SetCountryCode ( CStifItemParser& aItem ); |
|
194 TInt SetOperatorMusicStoreURL ( CStifItemParser& aItem ); |
|
195 TInt SetOperatorMusicStoreName ( CStifItemParser& aItem ); |
|
196 |
|
197 // Tst functions |
|
198 TInt ReadConfigurableKeysL ( CStifItemParser& aItem ); |
|
199 TInt tstSetRegionIdL ( CStifItemParser& aItem ); |
|
200 TInt tstIsRegionSettingChangeNotified ( CStifItemParser& aItem ); |
|
201 TInt tstResetStartCount ( CStifItemParser& aItem ); |
|
202 |
|
203 protected: // Functions from base classes |
|
204 |
|
205 /** |
|
206 * From ?base_class ?member_description |
|
207 */ |
|
208 //?type ?member_function(); |
|
209 |
|
210 private: |
|
211 |
|
212 /** |
|
213 * C++ default constructor. |
|
214 */ |
|
215 CSettingsTestModule( CTestModuleIf& aTestModuleIf ); |
|
216 |
|
217 /** |
|
218 * By default Symbian 2nd phase constructor is private. |
|
219 */ |
|
220 void ConstructL(); |
|
221 |
|
222 // Prohibit copy constructor if not deriving from CBase. |
|
223 // ?classname( const ?classname& ); |
|
224 // Prohibit assigment operator if not deriving from CBase. |
|
225 // ?classname& operator=( const ?classname& ); |
|
226 |
|
227 /** |
|
228 * Frees all resources allocated from test methods. |
|
229 * @since ?Series60_version |
|
230 */ |
|
231 void Delete(); |
|
232 |
|
233 /** |
|
234 * Test methods are listed below. |
|
235 */ |
|
236 |
|
237 /** |
|
238 * Example test method. |
|
239 * @since ?Series60_version |
|
240 * @param aItem Script line containing parameters. |
|
241 * @return Symbian OS error code. |
|
242 */ |
|
243 virtual TInt ExampleL( CStifItemParser& aItem ); |
|
244 |
|
245 /** |
|
246 * Method used to log version of test class |
|
247 */ |
|
248 void SendTestClassVersion(); |
|
249 |
|
250 //ADD NEW METHOD DEC HERE |
|
251 //[TestMethods] - Do not remove |
|
252 |
|
253 public: // Data |
|
254 // ?one_line_short_description_of_data |
|
255 //?data_declaration; |
|
256 |
|
257 protected: // Data |
|
258 // ?one_line_short_description_of_data |
|
259 //?data_declaration; |
|
260 |
|
261 private: // Data |
|
262 |
|
263 // ?one_line_short_description_of_data |
|
264 //?data_declaration; |
|
265 |
|
266 // Reserved pointer for future extension |
|
267 //TAny* iReserved; |
|
268 |
|
269 /** Radio Settings */ |
|
270 CRadioSettings* iSettings; |
|
271 |
|
272 TBool iRegionSettingChangeNotified; |
|
273 |
|
274 |
|
275 public: // Friend classes |
|
276 //?friend_class_declaration; |
|
277 protected: // Friend classes |
|
278 //?friend_class_declaration; |
|
279 private: // Friend classes |
|
280 //?friend_class_declaration; |
|
281 |
|
282 }; |
|
283 |
|
284 #endif // SettingsTestMODULE_H |
|
285 |
|
286 // End of File |