|
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: Tests for HomeScreenStatePlugin class. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef T_HSMCSSTATES_H |
|
19 #define T_HSMCSSTATES_H |
|
20 |
|
21 #include <QtTest/QtTest> |
|
22 #include <QGraphicsScene> |
|
23 #include <QGraphicsView> |
|
24 #include <QScopedPointer> |
|
25 #include <hsmenuservice.h> |
|
26 #include <caitemmodel.h> |
|
27 #include "t_hsshortcutservice.h" |
|
28 |
|
29 #ifdef Q_OS_SYMBIAN |
|
30 #include <e32std.h> |
|
31 #endif |
|
32 |
|
33 class QStateMachine; |
|
34 class HbMainWindow; |
|
35 class HbAction; |
|
36 class HsCollectionNameDialog; |
|
37 |
|
38 /** |
|
39 * @test Test class for hsutils modules. |
|
40 */ |
|
41 class MenuStatesTest : public QObject |
|
42 { |
|
43 Q_OBJECT |
|
44 |
|
45 private slots: |
|
46 |
|
47 /** |
|
48 * initialize |
|
49 */ |
|
50 void initTestCase(); |
|
51 |
|
52 /* |
|
53 * Tests |
|
54 */ |
|
55 |
|
56 // WorkerState |
|
57 void MenuWorkerState_construction(); |
|
58 |
|
59 |
|
60 // HsPreviewHSWidgetState |
|
61 |
|
62 void HsPreviewHSWidgetState_construction(); |
|
63 void HsPreviewHSWidgetState_onEntry(); |
|
64 void HsPreviewHSWidgetState_showMessageWidgetCorrupted(); |
|
65 void HsPreviewHSWidgetState_buildPreviewDialog(); |
|
66 void HsPreviewHSWidgetState_addToHomeScreen(); |
|
67 // HsAddToHomeScreenState |
|
68 |
|
69 void AddToHomeScreenState_construction(); |
|
70 void AddToHomeScreenState_showMessageWidgetCorrupted(); |
|
71 void AddToHomeScreenState_openHomeScreen(); |
|
72 |
|
73 void AddToHomeScreenState_onEntry(); |
|
74 |
|
75 void AddToHomeScreenState_onEntry_2(); |
|
76 void AddToHomeScreenState_onEntry_3(); |
|
77 void AddToHomeScreenState_onEntry_4(); |
|
78 |
|
79 |
|
80 |
|
81 // HsCollectionNameState |
|
82 void CollectionNameState_construction1(); |
|
83 void CollectionNameState_onEntry(); |
|
84 void CollectionNameState_dialogFinished(); |
|
85 |
|
86 // HsDeleteCollectionItemState |
|
87 void DeleteCollectionItemState_construction(); |
|
88 void DeleteCollectionItemState_onEntry(); |
|
89 |
|
90 // HsUninstallItemState |
|
91 void HsUninstallItemState_construction(); |
|
92 void HsUninstallItemState_onEntry(); |
|
93 #ifdef Q_OS_SYMBIAN |
|
94 void HsUninstallItemState_getApplicationsNames(); |
|
95 #endif // Q_OS_SYMBIAN |
|
96 |
|
97 // HsAddAppsToCollectionState |
|
98 void AddAppsToCollectionState_construction(); |
|
99 void AddAppsToCollectionState_save(); |
|
100 void AddAppsToCollectionState_cleanData(); |
|
101 void AddAppsToCollectionState_setCollectionName(); |
|
102 void AddAppsToCollectionState_setCollectionId(); |
|
103 void AddAppsToCollectionState_setAppList(); |
|
104 void AddAppsToCollectionState_showMessageAppsAdded(); |
|
105 void AddAppsToCollectionState_selectCollection(); |
|
106 void AddAppsToCollectionState_listDialogFinished(); |
|
107 void AddAppsToCollectionState_newCollection(); |
|
108 void AddAppsToCollectionState_editorDialogFinished(); |
|
109 void AddAppsToCollectionState_appsCheckListState(); |
|
110 void AddAppsToCollectionState_selectApplicationsDone(); |
|
111 void AddAppsToCollectionState_collectionSelected(); |
|
112 |
|
113 void AppsCheckList_showAppsCheckboxList(); |
|
114 void AppsCheckList_getItemsList(); |
|
115 void AppsCheckList_setSortOrder(); |
|
116 void AppsCheckList_selectedItemsChanged(); |
|
117 |
|
118 void HsCollectionNameDialog_ConstructWithNoParams(); |
|
119 void HsCollectionNameDialog_ConstructWithId(); |
|
120 void HsCollectionNameDialog_uniqueCollectionName(); |
|
121 void HsCollectionNameDialog_closeEvent(); |
|
122 |
|
123 |
|
124 // HsDeleteCollectionState |
|
125 void DeleteCollectionState_construction1(); |
|
126 |
|
127 void DeleteCollectionState_onEntry(); |
|
128 void DeleteCollectionState_deleteCollection(); |
|
129 |
|
130 // HsArrangeState |
|
131 void ArrangeState_FulfillEntriesList(); |
|
132 void ArrangeState_Save(); |
|
133 void ArrangeState_onEntry(); |
|
134 void ArrangeState_arrangeDialogFinished(); |
|
135 |
|
136 |
|
137 // HsViewAppSettingsState |
|
138 void ViewAppSettings_construction(); |
|
139 void ViewAppSettings_onEntry(); |
|
140 void ViewAppSettings_onExit(); |
|
141 |
|
142 // HsInstallationLogState |
|
143 void HsInstallationLogState_construction(); |
|
144 void HsInstallationLogState_onEntry(); |
|
145 |
|
146 // HsUninstallFailedState |
|
147 void HsUninstallFailedState_construction(); |
|
148 void HsUninstallFailedState_onEntry(); |
|
149 |
|
150 // HsViewAppDetailsState |
|
151 void ViewAppDetails_construction(); |
|
152 void ViewAppDetails_onEntry(); |
|
153 |
|
154 |
|
155 /** |
|
156 * cleanup |
|
157 */ |
|
158 void cleanupTestCase(); |
|
159 void cleanup(); |
|
160 |
|
161 /** |
|
162 * test slot for popup actions |
|
163 */ |
|
164 void testSlot(HbAction* finished); |
|
165 |
|
166 /** |
|
167 * test slot to check if exit() was emitted |
|
168 */ |
|
169 int testExitSlot(); |
|
170 |
|
171 /** |
|
172 * test slot for AppsCheckList_showAppsCheckboxList test |
|
173 */ |
|
174 void testCommitSlot(const QList<int> &appList); |
|
175 |
|
176 /** |
|
177 * test slot for AddAppsToCollectionState_appsCheckListState test |
|
178 */ |
|
179 void testTransitToStateSlot(); |
|
180 |
|
181 private: |
|
182 void checkDialogController(); |
|
183 void startThread(); |
|
184 void stopThread(); |
|
185 |
|
186 #ifdef Q_OS_SYMBIAN |
|
187 RThread iThread; |
|
188 #endif |
|
189 |
|
190 private: |
|
191 QSharedPointer<HsShortcutService> mShortcutService; |
|
192 QStateMachine *mStateMachine; |
|
193 HbMainWindow *mWindow; |
|
194 bool mFinishedEmited; |
|
195 bool mCommitEmited; |
|
196 bool mTransitToStateEmited; |
|
197 }; |
|
198 |
|
199 #endif |