|
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 TSANIMSVG_H |
|
19 #define TSANIMSVG_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <StifLogger.h> |
|
23 #include <TestScripterInternal.h> |
|
24 #include <StifTestModule.h> |
|
25 #include <TestclassAssert.h> |
|
26 |
|
27 |
|
28 #include <e32def.h> |
|
29 #include <f32file.h> |
|
30 #include "sanimobserver.h" |
|
31 |
|
32 class CSAnimImagePlugin; |
|
33 class CTestWaiter; |
|
34 // FORWARD DECLARATIONS |
|
35 //class ?FORWARD_CLASSNAME; |
|
36 class CTSanimsvg; |
|
37 |
|
38 |
|
39 |
|
40 NONSHARABLE_CLASS( TMockSvgAnimationObserver ) : public MSAnimObserver |
|
41 { |
|
42 public: |
|
43 TMockSvgAnimationObserver( CTSanimsvg& aTestSuite ) : iTestSuite( aTestSuite ) {} |
|
44 virtual void UpdateScreen( const CFbsBitmap& /*aFrame*/, const CFbsBitmap& /*aMask*/ ); |
|
45 virtual void UpdateScreen( const CFbsBitmap& /*aFrame*/ ); |
|
46 private: |
|
47 CTSanimsvg& iTestSuite; |
|
48 }; |
|
49 |
|
50 |
|
51 |
|
52 // CONSTANTS |
|
53 //const ?type ?constant_var = ?constant; |
|
54 |
|
55 // MACROS |
|
56 //#define ?macro ?macro_def |
|
57 #define TEST_CLASS_VERSION_MAJOR 0 |
|
58 #define TEST_CLASS_VERSION_MINOR 0 |
|
59 #define TEST_CLASS_VERSION_BUILD 0 |
|
60 |
|
61 // Logging path |
|
62 _LIT( KTSanimsvgLogPath, "\\logs\\testframework\\TSanimsvg\\" ); |
|
63 // Log file |
|
64 _LIT( KTSanimsvgLogFile, "TSanimsvg.txt" ); |
|
65 _LIT( KTSanimsvgLogFileWithTitle, "TSanimsvg_[%S].txt" ); |
|
66 |
|
67 // FUNCTION PROTOTYPES |
|
68 //?type ?function_name(?arg_list); |
|
69 |
|
70 |
|
71 // DATA TYPES |
|
72 //enum ?declaration |
|
73 //typedef ?declaration |
|
74 //extern ?data_type; |
|
75 |
|
76 // CLASS DECLARATION |
|
77 |
|
78 /** |
|
79 * CTSanimsvg test class for STIF Test Framework TestScripter. |
|
80 * ?other_description_lines |
|
81 * |
|
82 * @lib ?library |
|
83 * @since ?Series60_version |
|
84 */ |
|
85 NONSHARABLE_CLASS(CTSanimsvg) : public CScriptBase |
|
86 { |
|
87 public: // Constructors and destructor |
|
88 |
|
89 /** |
|
90 * Two-phased constructor. |
|
91 */ |
|
92 static CTSanimsvg* NewL( CTestModuleIf& aTestModuleIf ); |
|
93 |
|
94 /** |
|
95 * Destructor. |
|
96 */ |
|
97 virtual ~CTSanimsvg(); |
|
98 |
|
99 public: // New functions |
|
100 |
|
101 /** |
|
102 * ?member_description. |
|
103 * @since ?Series60_version |
|
104 * @param ?arg1 ?description |
|
105 * @return ?description |
|
106 */ |
|
107 //?type ?member_function( ?type ?arg1 ); |
|
108 |
|
109 public: // Functions from base classes |
|
110 |
|
111 /** |
|
112 * From CScriptBase Runs a script line. |
|
113 * @since ?Series60_version |
|
114 * @param aItem Script line containing method name and parameters |
|
115 * @return Symbian OS error code |
|
116 */ |
|
117 virtual TInt RunMethodL( CStifItemParser& aItem ); |
|
118 |
|
119 protected: // New functions |
|
120 |
|
121 /** |
|
122 * ?member_description. |
|
123 * @since ?Series60_version |
|
124 * @param ?arg1 ?description |
|
125 * @return ?description |
|
126 */ |
|
127 //?type ?member_function( ?type ?arg1 ); |
|
128 |
|
129 protected: // Functions from base classes |
|
130 |
|
131 /** |
|
132 * From ?base_class ?member_description |
|
133 */ |
|
134 //?type ?member_function(); |
|
135 |
|
136 private: |
|
137 |
|
138 /** |
|
139 * C++ default constructor. |
|
140 */ |
|
141 CTSanimsvg( CTestModuleIf& aTestModuleIf ); |
|
142 |
|
143 /** |
|
144 * By default Symbian 2nd phase constructor is private. |
|
145 */ |
|
146 void ConstructL(); |
|
147 |
|
148 // Prohibit copy constructor if not deriving from CBase. |
|
149 // ?classname( const ?classname& ); |
|
150 // Prohibit assigment operator if not deriving from CBase. |
|
151 // ?classname& operator=( const ?classname& ); |
|
152 |
|
153 /** |
|
154 * Frees all resources allocated from test methods. |
|
155 * @since ?Series60_version |
|
156 */ |
|
157 void Delete(); |
|
158 |
|
159 /** |
|
160 * Test methods are listed below. |
|
161 */ |
|
162 |
|
163 /** |
|
164 * Example test method. |
|
165 * @since ?Series60_version |
|
166 * @param aItem Script line containing parameters. |
|
167 * @return Symbian OS error code. |
|
168 */ |
|
169 virtual TInt ExampleL( CStifItemParser& aItem ); |
|
170 |
|
171 /** |
|
172 * Method used to log version of test class |
|
173 */ |
|
174 void SendTestClassVersion(); |
|
175 |
|
176 |
|
177 TInt SetupEmptyL(); |
|
178 TInt SetupObjL(); |
|
179 void SetupFileL( const TDesC& aFileName ); |
|
180 TInt SetupStillImageL(); |
|
181 TInt SetupScaledAnimationL(); |
|
182 TInt SetupUnscaledAnimationL(); |
|
183 TInt SetupAnimationWithTextL(); |
|
184 TInt SetupStillImageBinaryL(); |
|
185 TInt SetupScaledAnimationBinaryL(); |
|
186 TInt SetupFinishedL(); |
|
187 TInt Teardown(); |
|
188 |
|
189 TInt TestConstructorL(); |
|
190 TInt TestConstructorNoMemoryL(); |
|
191 TInt TestUnknownFileL(); |
|
192 TInt TestCorruptFileL(); |
|
193 TInt TestLoadStillImageL(); |
|
194 TInt TestLoadScaledAnimationL(); |
|
195 TInt TestLoadUnscaledAnimationL(); |
|
196 TInt TestLoadAnimationWithTextL(); |
|
197 TInt TestLoadStillImageBinaryL(); |
|
198 TInt TestLoadScaledAnimationBinaryL(); |
|
199 TInt TestLoadNoMemoryL(); |
|
200 TInt TestCancelLoadL(); |
|
201 TInt TestShowStillImageL(); |
|
202 TInt TestShowAnimationL(); |
|
203 TInt TestShowNoMemoryL(); |
|
204 TInt TestCancelStillImageL(); |
|
205 TInt TestCancelAnimationL(); |
|
206 TInt TestCancelNotActiveL(); |
|
207 TInt TestShowBeforeLoadL(); |
|
208 TInt TestSetDisplayModeL(); |
|
209 TInt TestSetSizeL(); |
|
210 TInt TestSetFrameDelayL(); |
|
211 TInt TestBackroundColourL(); |
|
212 |
|
213 private: // data |
|
214 |
|
215 |
|
216 friend class TMockSvgAnimationObserver; |
|
217 |
|
218 /** File server session used in testing. */ |
|
219 RFs iFs; |
|
220 |
|
221 /** Instance of the class that this test suite is testing. */ |
|
222 CSAnimImagePlugin* iTestObj; |
|
223 |
|
224 /** A 32 bit identifer returned by ECom to identify this instance to the framework. */ |
|
225 TUid iDtorKey; |
|
226 |
|
227 /** For testing async calls. */ |
|
228 CTestWaiter* iWaiter; |
|
229 |
|
230 /** For testing correct number of calls to animation observer. */ |
|
231 TInt iFrameCounter; |
|
232 |
|
233 /** Animation observer for testing. */ |
|
234 TMockSvgAnimationObserver iObserver; |
|
235 |
|
236 }; |
|
237 |
|
238 #endif // TSANIMSVG_H |
|
239 |
|
240 // End of File |