|
1 /* |
|
2 * Copyright (c) 2002 - 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __MT_GSFRAMEWORK_H__ |
|
20 #define __MT_GSFRAMEWORK_H__ |
|
21 |
|
22 // EXTERNAL INCLUDES |
|
23 #include <CEUnitTestSuiteClass.h> |
|
24 #include <EUnitDecorators.h> |
|
25 #include <GSTabHelper.h> |
|
26 #include <GSPluginLoader.h> |
|
27 #include <GSPubSubsListener.h> |
|
28 #include <MGSSettingPSObserver.h> |
|
29 #include <GSParentPlugin.h> |
|
30 |
|
31 // INTERNAL INCLUDES |
|
32 #include "TestGSBaseView.h" |
|
33 |
|
34 // FORWARD DECLARATIONS |
|
35 |
|
36 |
|
37 // CLASS DEFINITION |
|
38 NONSHARABLE_CLASS( MT_GSFramework ) |
|
39 : public CEUnitTestSuiteClass, MGSTabbedViewOwner, MGSPluginLoadObserver, MGSSettingPSObserver |
|
40 { |
|
41 public: // Constructors and destructors |
|
42 |
|
43 /** |
|
44 * Two phase construction |
|
45 */ |
|
46 static MT_GSFramework* NewL(); |
|
47 static MT_GSFramework* NewLC(); |
|
48 /** |
|
49 * Destructor |
|
50 */ |
|
51 ~MT_GSFramework(); |
|
52 |
|
53 public: |
|
54 // From MGSTabbedViewOwner |
|
55 CArrayPtrFlat<CGSPluginInterface>* TabbedViews(); |
|
56 void TabChangedL( TUid selectedTabUid ); |
|
57 |
|
58 // From MGSPluginLoadObserver |
|
59 void HandlePluginLoaded( KGSPluginLoaderStatus aStatus ); |
|
60 |
|
61 // From MGSSettingPSObserver |
|
62 void HandleNotifyPSL( const TUid aUid, |
|
63 const TInt& aKey, |
|
64 const TRequestStatus& aStatus ); |
|
65 |
|
66 |
|
67 private: // Constructors and destructors |
|
68 |
|
69 MT_GSFramework(); |
|
70 void ConstructL(); |
|
71 |
|
72 private: |
|
73 // Test setup and teardown functions |
|
74 |
|
75 // CGSTabHelper |
|
76 void SetupTabHelperL(); |
|
77 void TeardownTabHelper(); |
|
78 |
|
79 // CGSTabHelper test cases |
|
80 void T_CGSTabHelper_NewLL(); |
|
81 void T_CGSTabHelper_NewLCL(); |
|
82 //~Destructor |
|
83 void T_CGSTabHelper__CGSTabHelperL(); |
|
84 void T_CGSTabHelper_CreateTabGroupLL(); |
|
85 void T_CGSTabHelper_CreateTabGroupL2L(); |
|
86 void T_CGSTabHelper_CreateTabGroupL3L(); |
|
87 void T_CGSTabHelper_RemoveTabGroupL(); |
|
88 void T_CGSTabHelper_TabChangedLL(); |
|
89 |
|
90 // CGSParentContainer test cases |
|
91 void SetupParentContainerL(); |
|
92 void TearDownParentContainer(); |
|
93 |
|
94 void T_CGSParentContainer_FocusChanged(); |
|
95 |
|
96 // CGSPluginLoader test cases |
|
97 void SetupPluginLoaderL(); |
|
98 void TearDownPluginLoader(); |
|
99 |
|
100 void T_CGSPluginLoader_NewL(); |
|
101 void T_CGSPluginLoader__CGSPluginLoader(); |
|
102 void T_CGSPluginLoader_LoadAsyncL(); |
|
103 void T_CGSPluginLoader_SetObserver(); |
|
104 void T_CGSPluginLoader_AbortAsyncLoad(); |
|
105 void T_CGSPluginLoader_SortPluginsL(); |
|
106 |
|
107 |
|
108 // CGSPubSubsListener test cases |
|
109 void SetupPubSubsListenerL(); |
|
110 void TearDownPubSubsListener(); |
|
111 |
|
112 void T_CGSPubSubsListener_NewL(); |
|
113 void T_CGSPubSubsListener__CGSPubSubsListener(); |
|
114 void T_CGSPubSubsListener_Get1(); |
|
115 void T_CGSPubSubsListener_Get2(); |
|
116 void T_CGSPubSubsListener_Get3(); |
|
117 |
|
118 |
|
119 // Empty Setup & TearDown |
|
120 void SetupNone(); |
|
121 void TeardownNone(); |
|
122 |
|
123 |
|
124 void SetupLaunch(); |
|
125 void TeardownLaunch(); |
|
126 |
|
127 static TInt CloseTopMostWindow( TAny* aPtr ); |
|
128 void DoCloseTopMostWindowL(); |
|
129 |
|
130 void LaunchGsApp1L(); |
|
131 TBool GetKeyCodeCase1( TKeyCode& aKeyCode ); |
|
132 |
|
133 void LaunchGsApp2L(); |
|
134 TBool GetKeyCodeCase2( TKeyCode& aKeyCode ); |
|
135 |
|
136 void LaunchGsApp3L(); |
|
137 TBool GetKeyCodeCase3( TKeyCode& aKeyCode ); |
|
138 |
|
139 void LaunchGsApp4L(); |
|
140 TBool GetKeyCodeCase4( TKeyCode& aKeyCode ); |
|
141 |
|
142 static TInt SimulateKeyEvent( TAny* aPtr ); |
|
143 void DoSimulateKeyEventL(); |
|
144 |
|
145 TBool GetKeyCodeCase0( TKeyCode& aKeyCode ); |
|
146 |
|
147 |
|
148 // CGSBaseView test cases |
|
149 void SetupCGSBaseViewL(); |
|
150 void TeardownCGSBaseView(); |
|
151 void MT_CGSBaseView_SetCurrentItemL(); |
|
152 void MT_CGSBaseView_ContainerL(); |
|
153 void MT_CGSBaseView_SetNaviPaneLL(); |
|
154 void MT_CGSBaseView_CreateNaviPaneContextLL(); |
|
155 |
|
156 // CGSParentPlugin test cases |
|
157 void SetupCGSParentPluginL(); |
|
158 void TeardownCGSParentPlugin(); |
|
159 void MT_CGSParentPlugin_UpperLevelViewUidL(); |
|
160 void MT_CGSParentPlugin_UpdateViewL(); |
|
161 void MT_CGSParentPlugin_SetOptionFlagsL(); |
|
162 void MT_CGSParentPlugin_OptionFlagsL(); |
|
163 void MT_CGSParentPlugin_GetHelpContextL(); |
|
164 void MT_CGSParentPlugin_SelectedPluginL(); |
|
165 void MT_CGSParentPlugin_TransferDynamicPluginLL(); |
|
166 |
|
167 // CGSPluginInterface test cases |
|
168 void MT_CGSPluginInterface_ItemTypeL(); |
|
169 void MT_CGSPluginInterface_HandleSelectionL(); |
|
170 void MT_CGSPluginInterface_PluginProviderCategoryL(); |
|
171 void MT_CGSPluginInterface_CustomOperationLL(); |
|
172 void MT_CGSPluginInterface_SetOrderL(); |
|
173 void MT_CGSPluginInterface_CreateIconLL(); |
|
174 void MT_CGSPluginInterface_GetEcomDestructorKey(); |
|
175 |
|
176 |
|
177 private: // Data |
|
178 |
|
179 // For CGSTabHelper |
|
180 CGSTabHelper* iCGSTabHelper; |
|
181 CArrayPtrFlat<CGSPluginInterface>* iPlugins; |
|
182 CArrayPtrFlat<MGSTabbedView>* iTabbedViews; |
|
183 |
|
184 // For CGSPluginLoader |
|
185 CGSPluginLoader* iCGSPluginLoader; |
|
186 |
|
187 // For CGSPubSubsListener |
|
188 CGSPubSubsListener* iCGSPubSubsListener; |
|
189 |
|
190 // For launching Gs application test cases |
|
191 CPeriodic* iPeriodic; |
|
192 TInt ikeySimulateCase; |
|
193 TInt iKeyNumber; |
|
194 |
|
195 // For CTestGSBaseView |
|
196 CTestGSBaseView* iTestBaseView; |
|
197 |
|
198 // For CGSParentPlugin |
|
199 CGSParentPlugin* iParentPlugin; |
|
200 |
|
201 EUNIT_DECLARE_TEST_TABLE; |
|
202 |
|
203 }; |
|
204 |
|
205 #endif // __MT_GSFRAMEWORK_H__ |
|
206 |
|
207 // End of file |