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