|
1 /* |
|
2 * Copyright (c) 2007 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 the License "Symbian Foundation License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Declaration of CSAnimSvgPluginTestSuite class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef SANIMSVGPLUGINTESTSUITE_H |
|
20 #define SANIMSVGPLUGINTESTSUITE_H |
|
21 |
|
22 #include <ceunittestsuiteclass.h> |
|
23 #include <e32def.h> |
|
24 #include <f32file.h> |
|
25 #include "sanimobserver.h" |
|
26 |
|
27 class CSAnimImagePlugin; |
|
28 class CSAnimSvgPluginTestSuite; |
|
29 class CTestWaiter; |
|
30 |
|
31 NONSHARABLE_CLASS( TMockSvgAnimationObserver ) : public MSAnimObserver |
|
32 { |
|
33 public: |
|
34 TMockSvgAnimationObserver( CSAnimSvgPluginTestSuite& aTestSuite ) : iTestSuite( aTestSuite ) {} |
|
35 virtual void UpdateScreen( const CFbsBitmap& /*aFrame*/, const CFbsBitmap& /*aMask*/ ); |
|
36 virtual void UpdateScreen( const CFbsBitmap& /*aFrame*/ ); |
|
37 private: |
|
38 CSAnimSvgPluginTestSuite& iTestSuite; |
|
39 }; |
|
40 |
|
41 /** |
|
42 * Test cases for CSAnimSvgPlugin class. |
|
43 * |
|
44 * @lib None |
|
45 * @since S60 3.2 |
|
46 */ |
|
47 NONSHARABLE_CLASS( CSAnimSvgPluginTestSuite ) : public CEUnitTestSuiteClass |
|
48 { |
|
49 |
|
50 public: |
|
51 |
|
52 /** |
|
53 * Constructs a CSAnimSvgPluginTestSuite object. |
|
54 * |
|
55 * @since S60 3.2 |
|
56 * |
|
57 * @return The new object |
|
58 */ |
|
59 static CSAnimSvgPluginTestSuite* NewL(); |
|
60 static CSAnimSvgPluginTestSuite* NewLC(); |
|
61 |
|
62 /** |
|
63 * Destructor. |
|
64 * |
|
65 * @since S60 3.2 |
|
66 */ |
|
67 virtual ~CSAnimSvgPluginTestSuite(); |
|
68 |
|
69 private: |
|
70 |
|
71 /** |
|
72 * First phase constructor. |
|
73 * |
|
74 * @since S60 3.2 |
|
75 */ |
|
76 CSAnimSvgPluginTestSuite(); |
|
77 |
|
78 /** |
|
79 * Second phase constructor. |
|
80 * |
|
81 * @since S60 3.2 |
|
82 */ |
|
83 void ConstructL(); |
|
84 |
|
85 private: // New methods |
|
86 |
|
87 void SetupEmptyL(); |
|
88 void SetupObjL(); |
|
89 void SetupFileL( const TDesC& aFileName ); |
|
90 void SetupStillImageL(); |
|
91 void SetupScaledAnimationL(); |
|
92 void SetupUnscaledAnimationL(); |
|
93 void SetupAnimationWithTextL(); |
|
94 void SetupStillImageBinaryL(); |
|
95 void SetupScaledAnimationBinaryL(); |
|
96 void SetupFinishedL(); |
|
97 void Teardown(); |
|
98 |
|
99 void TestConstructorL(); |
|
100 void TestConstructorNoMemoryL(); |
|
101 void TestUnknownFileL(); |
|
102 void TestCorruptFileL(); |
|
103 void TestLoadStillImageL(); |
|
104 void TestLoadScaledAnimationL(); |
|
105 void TestLoadUnscaledAnimationL(); |
|
106 void TestLoadAnimationWithTextL(); |
|
107 void TestLoadStillImageBinaryL(); |
|
108 void TestLoadScaledAnimationBinaryL(); |
|
109 void TestLoadNoMemoryL(); |
|
110 void TestCancelLoadL(); |
|
111 void TestShowStillImageL(); |
|
112 void TestShowAnimationL(); |
|
113 void TestShowNoMemoryL(); |
|
114 void TestCancelStillImageL(); |
|
115 void TestCancelAnimationL(); |
|
116 void TestCancelNotActiveL(); |
|
117 void TestShowBeforeLoadL(); |
|
118 void TestSetDisplayModeL(); |
|
119 void TestSetSizeL(); |
|
120 void TestSetFrameDelayL(); |
|
121 void TestBackroundColourL(); |
|
122 |
|
123 private: // data |
|
124 |
|
125 EUNIT_DECLARE_TEST_TABLE; |
|
126 |
|
127 friend class TMockSvgAnimationObserver; |
|
128 |
|
129 /** File server session used in testing. */ |
|
130 RFs iFs; |
|
131 |
|
132 /** Instance of the class that this test suite is testing. */ |
|
133 CSAnimImagePlugin* iTestObj; |
|
134 |
|
135 /** A 32 bit identifer returned by ECom to identify this instance to the framework. */ |
|
136 TUid iDtorKey; |
|
137 |
|
138 /** For testing async calls. */ |
|
139 CTestWaiter* iWaiter; |
|
140 |
|
141 /** For testing correct number of calls to animation observer. */ |
|
142 TInt iFrameCounter; |
|
143 |
|
144 /** Animation observer for testing. */ |
|
145 TMockSvgAnimationObserver iObserver; |
|
146 |
|
147 }; |
|
148 |
|
149 #endif // SANIMSVGPLUGINTESTSUITE_H |