77
|
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 TSANIMCTRL_H
|
|
19 |
#define TSANIMCTRL_H
|
|
20 |
|
|
21 |
// INCLUDES
|
|
22 |
#include <StifLogger.h>
|
|
23 |
#include <TestScripterInternal.h>
|
|
24 |
#include <StifTestModule.h>
|
|
25 |
#include <TestclassAssert.h>
|
|
26 |
|
|
27 |
// CONSTANTS
|
|
28 |
//const ?type ?constant_var = ?constant;
|
|
29 |
|
|
30 |
// MACROS
|
|
31 |
//#define ?macro ?macro_def
|
|
32 |
#define TEST_CLASS_VERSION_MAJOR 0
|
|
33 |
#define TEST_CLASS_VERSION_MINOR 0
|
|
34 |
#define TEST_CLASS_VERSION_BUILD 0
|
|
35 |
|
|
36 |
// Logging path
|
|
37 |
_LIT( KTSanimctrlLogPath, "\\logs\\testframework\\TSanimctrl\\" );
|
|
38 |
// Log file
|
|
39 |
_LIT( KTSanimctrlLogFile, "TSanimctrl.txt" );
|
|
40 |
_LIT( KTSanimctrlLogFileWithTitle, "TSanimctrl_[%S].txt" );
|
|
41 |
|
|
42 |
|
|
43 |
#include <e32def.h>
|
|
44 |
#include "sanimstartupctrl.h"
|
|
45 |
|
|
46 |
class CSAnimMockView;
|
|
47 |
class CTestWaiter;
|
|
48 |
class CTSanimctrl;
|
|
49 |
|
|
50 |
NONSHARABLE_CLASS(CTSanimctrl) : public CScriptBase
|
|
51 |
{
|
|
52 |
public: // Constructors and destructor
|
|
53 |
|
|
54 |
/**
|
|
55 |
* Two-phased constructor.
|
|
56 |
*/
|
|
57 |
static CTSanimctrl* NewL( CTestModuleIf& aTestModuleIf,CSAnimMockView& aview );
|
|
58 |
|
|
59 |
/**
|
|
60 |
* Destructor.
|
|
61 |
*/
|
|
62 |
virtual ~CTSanimctrl();
|
|
63 |
|
|
64 |
public: // New functions
|
|
65 |
|
|
66 |
/**
|
|
67 |
* ?member_description.
|
|
68 |
* @since ?Series60_version
|
|
69 |
* @param ?arg1 ?description
|
|
70 |
* @return ?description
|
|
71 |
*/
|
|
72 |
//?type ?member_function( ?type ?arg1 );
|
|
73 |
|
|
74 |
public: // Functions from base classes
|
|
75 |
|
|
76 |
/**
|
|
77 |
* From CScriptBase Runs a script line.
|
|
78 |
* @since ?Series60_version
|
|
79 |
* @param aItem Script line containing method name and parameters
|
|
80 |
* @return Symbian OS error code
|
|
81 |
*/
|
|
82 |
virtual TInt RunMethodL( CStifItemParser& aItem );
|
|
83 |
|
|
84 |
protected: // New functions
|
|
85 |
|
|
86 |
/**
|
|
87 |
* ?member_description.
|
|
88 |
* @since ?Series60_version
|
|
89 |
* @param ?arg1 ?description
|
|
90 |
* @return ?description
|
|
91 |
*/
|
|
92 |
//?type ?member_function( ?type ?arg1 );
|
|
93 |
|
|
94 |
protected: // Functions from base classes
|
|
95 |
|
|
96 |
/**
|
|
97 |
* From ?base_class ?member_description
|
|
98 |
*/
|
|
99 |
//?type ?member_function();
|
|
100 |
|
|
101 |
private:
|
|
102 |
|
|
103 |
/**
|
|
104 |
* C++ default constructor.
|
|
105 |
*/
|
|
106 |
CTSanimctrl( CTestModuleIf& aTestModuleIf,CSAnimMockView& aview );
|
|
107 |
|
|
108 |
/**
|
|
109 |
* By default Symbian 2nd phase constructor is private.
|
|
110 |
*/
|
|
111 |
void ConstructL();
|
|
112 |
|
|
113 |
// Prohibit copy constructor if not deriving from CBase.
|
|
114 |
// ?classname( const ?classname& );
|
|
115 |
// Prohibit assigment operator if not deriving from CBase.
|
|
116 |
// ?classname& operator=( const ?classname& );
|
|
117 |
|
|
118 |
/**
|
|
119 |
* Frees all resources allocated from test methods.
|
|
120 |
* @since ?Series60_version
|
|
121 |
*/
|
|
122 |
void Delete();
|
|
123 |
|
|
124 |
/**
|
|
125 |
* Test methods are listed below.
|
|
126 |
*/
|
|
127 |
|
|
128 |
/**
|
|
129 |
* Example test method.
|
|
130 |
* @since ?Series60_version
|
|
131 |
* @param aItem Script line containing parameters.
|
|
132 |
* @return Symbian OS error code.
|
|
133 |
*/
|
|
134 |
virtual TInt ExampleL( CStifItemParser& aItem );
|
|
135 |
void SetupParamsL(
|
|
136 |
const TDesC& aImageFileName,
|
|
137 |
const TDesC& aToneFileName,
|
|
138 |
const TInt aFrameDelay,
|
|
139 |
const TInt aVolume,
|
|
140 |
const TInt aVolumeRamp );
|
|
141 |
TInt SetupProfileL( const TInt aRingingType, const TInt aRingingVolume );
|
|
142 |
TInt InitObjL();
|
|
143 |
TInt SetupEmptyL();
|
|
144 |
TInt SetupEmptyValuesL();
|
|
145 |
TInt SetupUnknownFileL();
|
|
146 |
TInt SetupProtectedFileL();
|
|
147 |
TInt SetupExistingImageFileL();
|
|
148 |
TInt SetupExistingToneFileSilentL();
|
|
149 |
TInt SetupExistingToneFileVeryLowVolumeL();
|
|
150 |
TInt SetupExistingToneFileLowVolumeL();
|
|
151 |
TInt SetupExistingToneFileNormalVolumeL();
|
|
152 |
TInt SetupExistingToneFileTooLowVolumeL();
|
|
153 |
TInt SetupExistingToneFileTooHighVolumeL();
|
|
154 |
TInt SetupUnknownToneFileNormalVolumeL();
|
|
155 |
TInt SetupObjL();
|
|
156 |
TInt SetupEmptyShowL();
|
|
157 |
TInt SetupShowL();
|
|
158 |
TInt Teardown();
|
|
159 |
|
|
160 |
TInt TestConstructorL();
|
|
161 |
TInt TestConstructorNoMemoryL();
|
|
162 |
TInt TestLoadNoContentL();
|
|
163 |
TInt TestLoadHasContentL();
|
|
164 |
TInt TestLoadNoMemoryL();
|
|
165 |
TInt TestCancelLoadL();
|
|
166 |
TInt TestLoadWhenActiveL();
|
|
167 |
TInt TestStartL();
|
|
168 |
TInt TestCancelStartL();
|
|
169 |
TInt TestStartWhenActiveL();
|
|
170 |
|
|
171 |
|
|
172 |
// CtrTestSuite
|
|
173 |
TInt SetupEmptyCtrL();
|
|
174 |
TInt SetupObjCtrL();
|
|
175 |
TInt SetupObjLoadedCtrL();
|
|
176 |
TInt TeardownCtr();
|
|
177 |
|
|
178 |
TInt TestConstructorCtrL();
|
|
179 |
TInt TestConstructorNoMemoryCtrL();
|
|
180 |
TInt TestLoadEmptyCtrL();
|
|
181 |
TInt TestLoadImageCtrL();
|
|
182 |
TInt TestLoadToneCtrL();
|
|
183 |
TInt TestLoadBothCtrL();
|
|
184 |
TInt TestLoadWhenActiveCtrL();
|
|
185 |
TInt TestCancelLoadCtrL();
|
|
186 |
|
|
187 |
TInt TestStartCtrL();
|
|
188 |
TInt TestCancelStartCtrL();
|
|
189 |
TInt TestStartNoMemoryCtrL();
|
|
190 |
TInt TestStartWhenActiveCtrL();
|
|
191 |
|
|
192 |
|
|
193 |
|
|
194 |
/**
|
|
195 |
* Method used to log version of test class
|
|
196 |
*/
|
|
197 |
void SendTestClassVersion();
|
|
198 |
private: // data
|
|
199 |
//ADD NEW METHOD DEC HERE
|
|
200 |
//[TestMethods] - Do not remove
|
|
201 |
|
|
202 |
/** Parent control for the object to be tested. */
|
|
203 |
CSAnimMockView& iView;
|
|
204 |
|
|
205 |
|
|
206 |
/** Parameters to use in testing. */
|
|
207 |
CSAnimStartupCtrl::TAnimationParams iParams;
|
|
208 |
|
|
209 |
|
|
210 |
/** Instance of the class that this test suite is testing. */
|
|
211 |
CSAnimStartupCtrl* iTestObj;
|
|
212 |
|
|
213 |
/** Instance of the class that this test suite is testing. */
|
|
214 |
CSAnimCtrl* iTestObj2;
|
|
215 |
|
|
216 |
/** For testing async calls. */
|
|
217 |
CTestWaiter* iWaiter;
|
|
218 |
CTestWaiter* iWaiter2;
|
|
219 |
|
|
220 |
|
|
221 |
};
|
|
222 |
|
|
223 |
#endif // TSANIMCTRL_H
|
|
224 |
|
|
225 |
// End of File
|