|
1 /* |
|
2 * Copyright (c) 2007-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 "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: Test for slideshow engine |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __T_CSHWSLIDESHOWENGINE_H__ |
|
22 #define __T_CSHWSLIDESHOWENGINE_H__ |
|
23 |
|
24 // EXTERNAL INCLUDES |
|
25 #include <digia/eunit/CEUnitTestSuiteClass.h> |
|
26 #include <digia/eunit/EUnitDecorators.h> |
|
27 |
|
28 // INTERNAL INCLUDES |
|
29 #include "shwengineobserver.h" |
|
30 #include "shweffectmanager.h" |
|
31 #include "shweventobserver.h" |
|
32 #include "shwmusicobserver.h" |
|
33 |
|
34 #include "tmglxmedialist_stub.h" |
|
35 #include "tmglxvisuallist_adapter.h" |
|
36 |
|
37 // FORWARD DECLARATIONS |
|
38 class CShwSlideshowEngine; |
|
39 class CHuiEnv; |
|
40 class CHuiDisplay; |
|
41 class MShwEvent; |
|
42 class T_MShwTestEffect; |
|
43 class T_Scheduler; |
|
44 |
|
45 // CLASS DEFINITION |
|
46 /** |
|
47 * |
|
48 */ |
|
49 NONSHARABLE_CLASS( T_CShwSlideshowEngine ) |
|
50 : public CEUnitTestSuiteClass, |
|
51 public MShwEngineObserver, |
|
52 public MGlxMediaList_Stub_Observer, |
|
53 public MGlxVisualList_Observer, |
|
54 public MShwEffectManager, |
|
55 public MShwEventObserver, |
|
56 public MShwMusicObserver |
|
57 { |
|
58 public: // Constructors and destructors |
|
59 |
|
60 /** |
|
61 * Two phase construction |
|
62 */ |
|
63 static T_CShwSlideshowEngine* NewL(); |
|
64 static T_CShwSlideshowEngine* NewLC(); |
|
65 /** |
|
66 * Destructor |
|
67 */ |
|
68 ~T_CShwSlideshowEngine(); |
|
69 |
|
70 private: // Constructors and destructors |
|
71 |
|
72 T_CShwSlideshowEngine(); |
|
73 void ConstructL(); |
|
74 |
|
75 public: // from MShwEngineObserver |
|
76 |
|
77 void EngineStartedL(); |
|
78 void EnginePausedL(); |
|
79 void EngineResumedL(); |
|
80 void ErrorDuringSlideshowL(); |
|
81 |
|
82 public: // from MGlxMediaList_Stub_Observer and MGlxVisualList_Observer |
|
83 |
|
84 void MGlxMediaList_MethodCalled( TMGlxMediaListMethodId aMethodId ); |
|
85 void MGlxVisualList_MethodCalled( TMGlxVisualListMethodId aMethodId ); |
|
86 |
|
87 public: // from MShwEffectManager |
|
88 |
|
89 void AddEffectL( MShwEffect* aEffects ); |
|
90 MShwEffect* CurrentEffect(); |
|
91 MShwEffect* Effect( TInt aDirection ); |
|
92 void ProceedToEffect( TInt aDirection ); |
|
93 void SetEffectOrder( MShwEffectManager::TShwEffectOrder aOrder ); |
|
94 MShwEffectManager::TShwEffectOrder EffectOrder(); |
|
95 void SetProgrammedEffects( RArray< TShwEffectInfo >& aEffects ); |
|
96 void SetDefaultEffectL(TShwEffectInfo aInfo); |
|
97 void GetActiveEffectsL( RPointerArray< MShwEffect >& aEffects ); |
|
98 |
|
99 public: // from MShwEventObserver |
|
100 |
|
101 void NotifyL( MShwEvent* aEvent ); |
|
102 |
|
103 public: // from MShwMusicObserver |
|
104 |
|
105 void MusicOnL(); |
|
106 void MusicOff(); |
|
107 void MusicVolume( TInt aCurrentVolume, TInt aMaxVolume ); |
|
108 void ErrorWithTrackL( TInt aErrorCode ); |
|
109 |
|
110 public: |
|
111 |
|
112 static TInt LoadThumbnailL( TAny* aThis ); |
|
113 static TInt StopWaiting(TAny* aTestEngine); |
|
114 |
|
115 private: // New methods |
|
116 |
|
117 void EmptyL(); |
|
118 void SetupL(); |
|
119 void Teardown(); |
|
120 |
|
121 void T_ConstructL(); |
|
122 void T_StartLWithListNotReadyL(); |
|
123 void T_StartLWithListReadyL(); |
|
124 void T_StartLTwiceL(); |
|
125 void T_StartLAsynchL(); |
|
126 void T_StartLAsynchSlowImagesL(); |
|
127 void T_PauseLL(); |
|
128 void T_PauseL2L(); |
|
129 void T_StartWithMusicL(); |
|
130 void T_MusicVolumeUpL(); |
|
131 void T_MusicVolumeDownL(); |
|
132 void T_MusicNoVolumeEventsL(); |
|
133 |
|
134 private: // Data |
|
135 |
|
136 CActiveScheduler* iOldScheduler; |
|
137 T_Scheduler* iScheduler; |
|
138 |
|
139 // own: class under test |
|
140 CShwSlideshowEngine* iCShwSlideshowEngine; |
|
141 |
|
142 // own: the dependant objects |
|
143 CHuiEnv* iHuiEnv; |
|
144 CHuiDisplay* iDisplay; |
|
145 TMGlxMediaList_Stub* iStubMedialist; |
|
146 |
|
147 // own: timer to simulate the loading of thumbnails |
|
148 CPeriodic* iThumbnailLoader; |
|
149 TInt iThumbnailLoadIndex; |
|
150 |
|
151 // own: the effects |
|
152 TInt iCurrentEffect; |
|
153 T_MShwTestEffect* iEffect1; |
|
154 T_MShwTestEffect* iEffect2; |
|
155 T_MShwTestEffect* iEffect3; |
|
156 |
|
157 // own: verification information |
|
158 RArray<TInt> iVisualListCalls; |
|
159 RArray<TInt> iMediaListCalls; |
|
160 RArray<MShwEvent*> iEvents; |
|
161 // own: the amount of events received and to wait |
|
162 TInt iEventsReceived; |
|
163 TInt iEventsToWait; |
|
164 // own: the asynch wait object |
|
165 CActiveSchedulerWait iSchedulerWait; |
|
166 |
|
167 // own: The music state |
|
168 TBool iMusicOn; |
|
169 // own: The current and max music volume |
|
170 TInt iCurrentVolume; |
|
171 TInt iMaxVolume; |
|
172 // own: the asynch wait object |
|
173 CActiveSchedulerWait iVolumeWait; |
|
174 // own: timeout for volume callback |
|
175 CPeriodic* iTimer; |
|
176 |
|
177 EUNIT_DECLARE_TEST_TABLE; |
|
178 |
|
179 }; |
|
180 |
|
181 #endif // __T_CSHWSLIDESHOWENGINE_H__ |
|
182 |
|
183 // End of file |