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