|
1 /* |
|
2 * Copyright (c) 2008 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: EUnit module test class for Homescreen Content Control |
|
15 * server |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef MTHSCCAPICLIENT_H |
|
20 #define MTHSCCAPICLIENT_H |
|
21 |
|
22 // System includes |
|
23 #include <e32base.h> |
|
24 #include <digia/eunit/ceunittestsuiteclass.h> |
|
25 #include <digia/eunit/eunitmacros.h> |
|
26 #include <hscontentcontroller.h> |
|
27 #include <hscontentcontrol.h> |
|
28 |
|
29 // Forward declarations |
|
30 class CHsCcApiClient; |
|
31 class CHsContentInfo; |
|
32 class CHsContentInfoArray; |
|
33 |
|
34 class CMTHsCcApiClient : public CEUnitTestSuiteClass, public MHsContentControl |
|
35 { |
|
36 |
|
37 public: // Constructors and destructors |
|
38 /** |
|
39 * Two-phased constructor. |
|
40 */ |
|
41 static CMTHsCcApiClient* NewL(); |
|
42 |
|
43 /** |
|
44 * Destructor. |
|
45 */ |
|
46 virtual ~CMTHsCcApiClient(); |
|
47 |
|
48 private: // Constructors |
|
49 /** |
|
50 * Constructor |
|
51 */ |
|
52 CMTHsCcApiClient(); |
|
53 |
|
54 /** |
|
55 * Second phase constructor |
|
56 */ |
|
57 void ConstructL(); |
|
58 |
|
59 public: // from MHsContentControl |
|
60 |
|
61 /** |
|
62 * |
|
63 */ |
|
64 void NotifyWidgetListChanged(); |
|
65 |
|
66 /** |
|
67 * |
|
68 */ |
|
69 void NotifyViewListChanged(); |
|
70 |
|
71 /** |
|
72 * |
|
73 */ |
|
74 void NotifyAppListChanged(); |
|
75 |
|
76 private: // from CEUnitTestSuiteClass |
|
77 |
|
78 /** |
|
79 * Setup for the unit test. |
|
80 */ |
|
81 void SetupL(); |
|
82 |
|
83 /** |
|
84 * Unit test teardown. |
|
85 */ |
|
86 void Teardown(); |
|
87 |
|
88 private: // test step functions |
|
89 |
|
90 void ConnectHsCcApiClientL( MHsContentControl* aObserver ); |
|
91 |
|
92 void DisconnectHsCcApiClient(); |
|
93 |
|
94 CHsContentInfo* AddViewL( const TDesC8& aUid ); |
|
95 |
|
96 CHsContentInfo* AddWidgetL( const TDesC8& aUid ); |
|
97 |
|
98 CHsContentInfo* GetViewL( CHsContentInfo* aApp, const TDesC8& aUid ); |
|
99 |
|
100 CHsContentInfo* GetWidgetL( CHsContentInfo* aView, const TDesC8& aUid ); |
|
101 |
|
102 private: // test case functions |
|
103 |
|
104 void ConnectDisconnectHsCcApiClientL(); |
|
105 |
|
106 void RegisterUnregisterHsCcApiObserverL(); |
|
107 |
|
108 void RegisterUnregisterMultipleObserversL(); |
|
109 |
|
110 void WidgetListL(); |
|
111 |
|
112 void AddRemoveWidgetL(); |
|
113 |
|
114 void AddWidgetFails1L(); |
|
115 |
|
116 void RemoveWidgetFails1L(); |
|
117 |
|
118 void WidgetListChangeNtfL(); |
|
119 |
|
120 void ViewListL(); |
|
121 |
|
122 void AddRemoveViewL(); |
|
123 |
|
124 void ActivateViewL(); |
|
125 |
|
126 void AddViewFails1L(); |
|
127 |
|
128 void RemoveViewFails1L(); |
|
129 |
|
130 void ViewListChangeNtfL(); |
|
131 |
|
132 void AppListL(); |
|
133 |
|
134 void ActivateAppL(); |
|
135 |
|
136 void ActiveAppL(); |
|
137 |
|
138 void ActiveAppFails1L(); |
|
139 |
|
140 void ActiveViewL(); |
|
141 |
|
142 void ViewWidgetList1L(); |
|
143 |
|
144 void ViewWidgetList2L(); |
|
145 |
|
146 void ViewWidgetListFailsL(); |
|
147 |
|
148 void AppWidgetList1L(); |
|
149 |
|
150 void AppWidgetListFailsL(); |
|
151 |
|
152 void AppViewList1L(); |
|
153 |
|
154 void AppViewList2L(); |
|
155 |
|
156 void AppViewListFails1L(); |
|
157 |
|
158 private: // Data |
|
159 |
|
160 /** |
|
161 * Homescreen content control api client |
|
162 */ |
|
163 CHsCcApiClient* iApiClient; |
|
164 |
|
165 /** |
|
166 * Widget list notification expected |
|
167 */ |
|
168 TBool iWidgetListNtfExpected; |
|
169 |
|
170 /** |
|
171 * Widget list notification received |
|
172 */ |
|
173 TBool iWidgetListNtfReceived; |
|
174 |
|
175 /** |
|
176 * View list notification expected |
|
177 */ |
|
178 TBool iViewListNtfExpected; |
|
179 |
|
180 /** |
|
181 * View list notification received |
|
182 */ |
|
183 TBool iViewListNtfReceived; |
|
184 |
|
185 /** |
|
186 * Application list notification expected |
|
187 */ |
|
188 TBool iAppListNtfExpected; |
|
189 |
|
190 /** |
|
191 * Application list notification received |
|
192 */ |
|
193 TBool iAppListNtfReceived; |
|
194 |
|
195 CActiveSchedulerWait iWait; |
|
196 |
|
197 /** |
|
198 * Unit test data |
|
199 */ |
|
200 EUNIT_DECLARE_TEST_TABLE; |
|
201 |
|
202 }; |
|
203 |
|
204 #endif // MTHSCCAPICLIENT_H |
|
205 |
|
206 // End of file |