Merge lp:~aacid/unity/testParametrizedActions into lp:unity/phablet
- testParametrizedActions
- Merge into phablet
Status: | Merged |
---|---|
Approved by: | Albert Astals Cid |
Approved revision: | no longer in the source branch. |
Merged at revision: | 522 |
Proposed branch: | lp:~aacid/unity/testParametrizedActions |
Merge into: | lp:unity/phablet |
Prerequisite: | lp:~aacid/unity/testHudRefactor |
Diff against target: |
320 lines (+197/-5) 5 files modified
Hud/Hud.qml (+1/-0) tests/qmluitests/qml/HudClient/fake_libhud_client.cpp (+94/-5) tests/qmluitests/qml/HudClient/libhud_client_stub.cpp (+21/-0) tests/qmluitests/qml/HudClient/libhud_client_stub.h (+11/-0) tests/qmluitests/tst_Hud.qml (+70/-0) |
To merge this branch: | bzr merge lp:~aacid/unity/testParametrizedActions |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Michael Zanetti (community) | Approve | ||
Review via email: mp+154750@code.launchpad.net |
Commit message
Test the parametrized actions
Description of the change
PS Jenkins bot (ps-jenkins) wrote : | # |
Michael Zanetti (mzanetti) : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:512
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
FAILURE: http://
FAILURE: http://
UNSTABLE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
FAILURE: http://
UNSTABLE: http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:512
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:512
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Albert Astals Cid (aacid) wrote : | # |
Last autolanding failed due to jenkins hickup, retriggerting
PS Jenkins bot (ps-jenkins) : | # |
Preview Diff
1 | === modified file 'Hud/Hud.qml' | |||
2 | --- Hud/Hud.qml 2013-03-21 15:54:40 +0000 | |||
3 | +++ Hud/Hud.qml 2013-03-22 15:49:31 +0000 | |||
4 | @@ -485,6 +485,7 @@ | |||
5 | 485 | 485 | ||
6 | 486 | HudParametrizedActionsPage { | 486 | HudParametrizedActionsPage { |
7 | 487 | id: parametrizedActionsPage | 487 | id: parametrizedActionsPage |
8 | 488 | objectName: "parametrizedActionsPage" | ||
9 | 488 | property bool shown: false | 489 | property bool shown: false |
10 | 489 | 490 | ||
11 | 490 | anchors.bottom: parent.bottom | 491 | anchors.bottom: parent.bottom |
12 | 491 | 492 | ||
13 | === modified file 'tests/qmluitests/qml/HudClient/fake_libhud_client.cpp' | |||
14 | --- tests/qmluitests/qml/HudClient/fake_libhud_client.cpp 2013-03-21 10:24:56 +0000 | |||
15 | +++ tests/qmluitests/qml/HudClient/fake_libhud_client.cpp 2013-03-22 15:49:31 +0000 | |||
16 | @@ -41,6 +41,8 @@ | |||
17 | 41 | 41 | ||
18 | 42 | DeeModel *resultsModel = 0; | 42 | DeeModel *resultsModel = 0; |
19 | 43 | DeeModel *appStackModel = 0; | 43 | DeeModel *appStackModel = 0; |
20 | 44 | GMenuModel *parametrizedActionModel = 0; | ||
21 | 45 | GActionGroup *parametrizedActionGroup = 0; | ||
22 | 44 | 46 | ||
23 | 45 | HudClientQuery *hud_client_query_new(const gchar *query) | 47 | HudClientQuery *hud_client_query_new(const gchar *query) |
24 | 46 | { | 48 | { |
25 | @@ -75,11 +77,13 @@ | |||
26 | 75 | columns[0] = g_variant_new_variant(g_variant_new_uint64(2)); | 77 | columns[0] = g_variant_new_variant(g_variant_new_uint64(2)); |
27 | 76 | columns[1] = g_variant_new_string("Foo"); | 78 | columns[1] = g_variant_new_string("Foo"); |
28 | 77 | columns[3] = g_variant_new_string("Show Foo"); | 79 | columns[3] = g_variant_new_string("Show Foo"); |
29 | 80 | columns[7] = g_variant_new_boolean(true); | ||
30 | 78 | dee_model_append_row(resultsModel, columns); | 81 | dee_model_append_row(resultsModel, columns); |
31 | 79 | 82 | ||
32 | 80 | columns[0] = g_variant_new_variant(g_variant_new_uint64(3)); | 83 | columns[0] = g_variant_new_variant(g_variant_new_uint64(3)); |
33 | 81 | columns[1] = g_variant_new_string("Bar"); | 84 | columns[1] = g_variant_new_string("Bar"); |
34 | 82 | columns[3] = g_variant_new_string("Show Bar"); | 85 | columns[3] = g_variant_new_string("Show Bar"); |
35 | 86 | columns[7] = g_variant_new_boolean(false); | ||
36 | 83 | dee_model_append_row(resultsModel, columns); | 87 | dee_model_append_row(resultsModel, columns); |
37 | 84 | 88 | ||
38 | 85 | columns[0] = g_variant_new_variant(g_variant_new_uint64(4)); | 89 | columns[0] = g_variant_new_variant(g_variant_new_uint64(4)); |
39 | @@ -132,13 +136,98 @@ | |||
40 | 132 | Q_UNUSED(timestamp); | 136 | Q_UNUSED(timestamp); |
41 | 133 | for (uint i = 0; i < dee_model_get_n_rows(resultsModel); ++i) { | 137 | for (uint i = 0; i < dee_model_get_n_rows(resultsModel); ++i) { |
42 | 134 | DeeModelIter *iter = dee_model_get_iter_at_row(resultsModel, i); | 138 | DeeModelIter *iter = dee_model_get_iter_at_row(resultsModel, i); |
46 | 135 | GVariant *it_command = dee_model_get_value(resultsModel, iter, 0); | 139 | if (!dee_model_get_bool(resultsModel, iter, 7)) { |
47 | 136 | if (g_variant_equal (command_key, it_command)) { | 140 | GVariant *it_command = dee_model_get_value(resultsModel, iter, 0); |
48 | 137 | HudClientStub::m_lastExecutedCommandRow = i; | 141 | if (g_variant_equal (command_key, it_command)) { |
49 | 142 | HudClientStub::m_lastExecutedCommandRow = i; | ||
50 | 143 | g_variant_unref(it_command); | ||
51 | 144 | return; | ||
52 | 145 | } | ||
53 | 138 | g_variant_unref(it_command); | 146 | g_variant_unref(it_command); |
54 | 139 | return; | ||
55 | 140 | } | 147 | } |
56 | 141 | g_variant_unref(it_command); | ||
57 | 142 | } | 148 | } |
58 | 143 | HudClientStub::m_lastExecutedCommandRow = -1; | 149 | HudClientStub::m_lastExecutedCommandRow = -1; |
59 | 144 | } | 150 | } |
60 | 151 | |||
61 | 152 | HudClientParam *hud_client_query_execute_param_command(HudClientQuery *cquery, GVariant *command_key, guint timestamp) | ||
62 | 153 | { | ||
63 | 154 | Q_UNUSED(cquery); | ||
64 | 155 | Q_UNUSED(timestamp); | ||
65 | 156 | for (uint i = 0; i < dee_model_get_n_rows(resultsModel); ++i) { | ||
66 | 157 | DeeModelIter *iter = dee_model_get_iter_at_row(resultsModel, i); | ||
67 | 158 | if (dee_model_get_bool(resultsModel, iter, 7)) { | ||
68 | 159 | GVariant *it_command = dee_model_get_value(resultsModel, iter, 0); | ||
69 | 160 | if (g_variant_equal (command_key, it_command)) { | ||
70 | 161 | HudClientStub::m_lastExecutedParametrizedCommandRow = i; | ||
71 | 162 | g_variant_unref(it_command); | ||
72 | 163 | // No need to create a real HudClientParam since it's always passed down to us | ||
73 | 164 | return (HudClientParam *)g_object_new(G_TYPE_OBJECT, NULL); | ||
74 | 165 | } | ||
75 | 166 | g_variant_unref(it_command); | ||
76 | 167 | } | ||
77 | 168 | } | ||
78 | 169 | HudClientStub::m_lastExecutedParametrizedCommandRow = -1; | ||
79 | 170 | return NULL; | ||
80 | 171 | } | ||
81 | 172 | |||
82 | 173 | GMenuModel *hud_client_param_get_model(HudClientParam *param) | ||
83 | 174 | { | ||
84 | 175 | Q_UNUSED(param); | ||
85 | 176 | |||
86 | 177 | if (!parametrizedActionModel) { | ||
87 | 178 | GMenu *menu = g_menu_new(); | ||
88 | 179 | GMenuItem *item = g_menu_item_new("Item1Label", NULL); | ||
89 | 180 | g_menu_item_set_attribute_value(item, "parameter-type", g_variant_new_string("slider")); | ||
90 | 181 | g_menu_item_set_attribute_value(item, "min", g_variant_new_double(10)); | ||
91 | 182 | g_menu_item_set_attribute_value(item, "max", g_variant_new_double(80)); | ||
92 | 183 | g_menu_item_set_attribute_value(item, "live", g_variant_new_boolean(true)); | ||
93 | 184 | g_menu_item_set_attribute_value(item, "value", g_variant_new_double(75)); | ||
94 | 185 | g_menu_item_set_attribute_value(item, "action", g_variant_new_string("costAction")); | ||
95 | 186 | g_menu_append_item (menu, item); | ||
96 | 187 | |||
97 | 188 | parametrizedActionModel = G_MENU_MODEL(menu); | ||
98 | 189 | } | ||
99 | 190 | |||
100 | 191 | return parametrizedActionModel; | ||
101 | 192 | } | ||
102 | 193 | |||
103 | 194 | void hud_client_param_send_cancel(HudClientParam *param) | ||
104 | 195 | { | ||
105 | 196 | Q_UNUSED(param); | ||
106 | 197 | g_clear_object(¶metrizedActionModel); | ||
107 | 198 | parametrizedActionModel = 0; | ||
108 | 199 | HudClientStub::m_lastParametrizedCommandCommited = false; | ||
109 | 200 | } | ||
110 | 201 | |||
111 | 202 | static void on_signal_activated (GSimpleAction *action, GVariant *parameter, gpointer /*user_data*/) | ||
112 | 203 | { | ||
113 | 204 | // Only double for the moment | ||
114 | 205 | HudClientStub::m_activatedActions.insert(g_action_get_name(G_ACTION(action)), QVariant(g_variant_get_double(parameter))); | ||
115 | 206 | } | ||
116 | 207 | |||
117 | 208 | GActionGroup *hud_client_param_get_actions(HudClientParam *param) | ||
118 | 209 | { | ||
119 | 210 | Q_UNUSED(param); | ||
120 | 211 | if (!parametrizedActionGroup) { | ||
121 | 212 | GSimpleActionGroup *actionGroup = g_simple_action_group_new(); | ||
122 | 213 | GSimpleAction *action = g_simple_action_new("costAction", G_VARIANT_TYPE_DOUBLE); | ||
123 | 214 | g_simple_action_group_insert(actionGroup, G_ACTION(action)); | ||
124 | 215 | |||
125 | 216 | g_signal_connect (action, "activate", G_CALLBACK (on_signal_activated), NULL); | ||
126 | 217 | |||
127 | 218 | |||
128 | 219 | parametrizedActionGroup = G_ACTION_GROUP(actionGroup); | ||
129 | 220 | } | ||
130 | 221 | |||
131 | 222 | return parametrizedActionGroup; | ||
132 | 223 | } | ||
133 | 224 | |||
134 | 225 | void hud_client_param_send_commit(HudClientParam *param) | ||
135 | 226 | { | ||
136 | 227 | Q_UNUSED(param); | ||
137 | 228 | g_object_unref(parametrizedActionGroup); | ||
138 | 229 | parametrizedActionGroup = 0; | ||
139 | 230 | g_clear_object(¶metrizedActionModel); | ||
140 | 231 | parametrizedActionModel = 0; | ||
141 | 232 | HudClientStub::m_lastParametrizedCommandCommited = true; | ||
142 | 233 | } | ||
143 | 145 | 234 | ||
144 | === modified file 'tests/qmluitests/qml/HudClient/libhud_client_stub.cpp' | |||
145 | --- tests/qmluitests/qml/HudClient/libhud_client_stub.cpp 2013-03-21 15:57:43 +0000 | |||
146 | +++ tests/qmluitests/qml/HudClient/libhud_client_stub.cpp 2013-03-22 15:49:31 +0000 | |||
147 | @@ -22,6 +22,9 @@ | |||
148 | 22 | QString HudClientStub::m_lastSetAppStackApplicationId; | 22 | QString HudClientStub::m_lastSetAppStackApplicationId; |
149 | 23 | QString HudClientStub::m_lastSetQuery; | 23 | QString HudClientStub::m_lastSetQuery; |
150 | 24 | int HudClientStub::m_lastExecutedCommandRow; | 24 | int HudClientStub::m_lastExecutedCommandRow; |
151 | 25 | int HudClientStub::m_lastExecutedParametrizedCommandRow; | ||
152 | 26 | bool HudClientStub::m_lastParametrizedCommandCommited; | ||
153 | 27 | QVariantMap HudClientStub::m_activatedActions; | ||
154 | 25 | 28 | ||
155 | 26 | int HudClientStub::lastExecutedToolbarItem() const | 29 | int HudClientStub::lastExecutedToolbarItem() const |
156 | 27 | { | 30 | { |
157 | @@ -43,12 +46,30 @@ | |||
158 | 43 | return m_lastExecutedCommandRow; | 46 | return m_lastExecutedCommandRow; |
159 | 44 | } | 47 | } |
160 | 45 | 48 | ||
161 | 49 | int HudClientStub::lastExecutedParametrizedCommandRow() const | ||
162 | 50 | { | ||
163 | 51 | return m_lastExecutedParametrizedCommandRow; | ||
164 | 52 | } | ||
165 | 53 | |||
166 | 54 | bool HudClientStub::lastParametrizedCommandCommited() const | ||
167 | 55 | { | ||
168 | 56 | return m_lastParametrizedCommandCommited; | ||
169 | 57 | } | ||
170 | 58 | |||
171 | 59 | QVariantMap HudClientStub::activatedActions() const | ||
172 | 60 | { | ||
173 | 61 | return m_activatedActions; | ||
174 | 62 | } | ||
175 | 63 | |||
176 | 46 | void HudClientStub::reset() | 64 | void HudClientStub::reset() |
177 | 47 | { | 65 | { |
178 | 48 | m_lastExecutedToolbarItem = -1; | 66 | m_lastExecutedToolbarItem = -1; |
179 | 49 | m_lastSetAppStackApplicationId.clear(); | 67 | m_lastSetAppStackApplicationId.clear(); |
180 | 50 | m_lastSetQuery.clear(); | 68 | m_lastSetQuery.clear(); |
181 | 51 | m_lastExecutedCommandRow = -1; | 69 | m_lastExecutedCommandRow = -1; |
182 | 70 | m_lastExecutedParametrizedCommandRow = -1; | ||
183 | 71 | m_lastParametrizedCommandCommited = false; | ||
184 | 72 | m_activatedActions.clear(); | ||
185 | 52 | } | 73 | } |
186 | 53 | 74 | ||
187 | 54 | int HudClientStub::fullScreenToolbarItemValue() const | 75 | int HudClientStub::fullScreenToolbarItemValue() const |
188 | 55 | 76 | ||
189 | === modified file 'tests/qmluitests/qml/HudClient/libhud_client_stub.h' | |||
190 | --- tests/qmluitests/qml/HudClient/libhud_client_stub.h 2013-03-21 15:57:43 +0000 | |||
191 | +++ tests/qmluitests/qml/HudClient/libhud_client_stub.h 2013-03-22 15:49:31 +0000 | |||
192 | @@ -19,6 +19,8 @@ | |||
193 | 19 | 19 | ||
194 | 20 | #include <QObject> | 20 | #include <QObject> |
195 | 21 | 21 | ||
196 | 22 | #include <QVariantMap> | ||
197 | 23 | |||
198 | 22 | class HudClientStub : public QObject | 24 | class HudClientStub : public QObject |
199 | 23 | { | 25 | { |
200 | 24 | Q_OBJECT | 26 | Q_OBJECT |
201 | @@ -27,12 +29,18 @@ | |||
202 | 27 | Q_PROPERTY(QString lastSetAppStackApplicationId READ lastSetAppStackApplicationId) | 29 | Q_PROPERTY(QString lastSetAppStackApplicationId READ lastSetAppStackApplicationId) |
203 | 28 | Q_PROPERTY(QString lastSetQuery READ lastSetQuery) | 30 | Q_PROPERTY(QString lastSetQuery READ lastSetQuery) |
204 | 29 | Q_PROPERTY(int lastExecutedCommandRow READ lastExecutedCommandRow) | 31 | Q_PROPERTY(int lastExecutedCommandRow READ lastExecutedCommandRow) |
205 | 32 | Q_PROPERTY(int lastExecutedParametrizedCommandRow READ lastExecutedParametrizedCommandRow) | ||
206 | 33 | Q_PROPERTY(bool lastParametrizedCommandCommited READ lastParametrizedCommandCommited) | ||
207 | 34 | Q_PROPERTY(QVariantMap activatedActions READ activatedActions) | ||
208 | 30 | 35 | ||
209 | 31 | public: | 36 | public: |
210 | 32 | int lastExecutedToolbarItem() const; | 37 | int lastExecutedToolbarItem() const; |
211 | 33 | QString lastSetAppStackApplicationId() const; | 38 | QString lastSetAppStackApplicationId() const; |
212 | 34 | QString lastSetQuery() const; | 39 | QString lastSetQuery() const; |
213 | 35 | int lastExecutedCommandRow() const; | 40 | int lastExecutedCommandRow() const; |
214 | 41 | int lastExecutedParametrizedCommandRow() const; | ||
215 | 42 | bool lastParametrizedCommandCommited() const; | ||
216 | 43 | QVariantMap activatedActions() const; | ||
217 | 36 | 44 | ||
218 | 37 | Q_INVOKABLE void reset(); | 45 | Q_INVOKABLE void reset(); |
219 | 38 | Q_INVOKABLE int fullScreenToolbarItemValue() const; | 46 | Q_INVOKABLE int fullScreenToolbarItemValue() const; |
220 | @@ -45,6 +53,9 @@ | |||
221 | 45 | static QString m_lastSetAppStackApplicationId; | 53 | static QString m_lastSetAppStackApplicationId; |
222 | 46 | static QString m_lastSetQuery; | 54 | static QString m_lastSetQuery; |
223 | 47 | static int m_lastExecutedCommandRow; | 55 | static int m_lastExecutedCommandRow; |
224 | 56 | static int m_lastExecutedParametrizedCommandRow; | ||
225 | 57 | static bool m_lastParametrizedCommandCommited; | ||
226 | 58 | static QVariantMap m_activatedActions; | ||
227 | 48 | }; | 59 | }; |
228 | 49 | 60 | ||
229 | 50 | 61 | ||
230 | 51 | 62 | ||
231 | === modified file 'tests/qmluitests/tst_Hud.qml' | |||
232 | --- tests/qmluitests/tst_Hud.qml 2013-03-21 15:58:18 +0000 | |||
233 | +++ tests/qmluitests/tst_Hud.qml 2013-03-22 15:49:31 +0000 | |||
234 | @@ -34,9 +34,12 @@ | |||
235 | 34 | when: windowShown | 34 | when: windowShown |
236 | 35 | 35 | ||
237 | 36 | function resetToInitialState() { | 36 | function resetToInitialState() { |
238 | 37 | var parametrizedActionsPage = findChild(hud, "parametrizedActionsPage") | ||
239 | 38 | |||
240 | 37 | hud.show() | 39 | hud.show() |
241 | 38 | hud.resetToInitialState() | 40 | hud.resetToInitialState() |
242 | 39 | hudClientStub.reset() | 41 | hudClientStub.reset() |
243 | 42 | tryCompare(parametrizedActionsPage, "x", hud.width) // Make sure the parametrized page action animation is finished | ||
244 | 40 | } | 43 | } |
245 | 41 | 44 | ||
246 | 42 | function test_hud_toolbar() { | 45 | function test_hud_toolbar() { |
247 | @@ -201,6 +204,73 @@ | |||
248 | 201 | 204 | ||
249 | 202 | mouseClick(resultListRepeater.itemAt(1), 0, 0) | 205 | mouseClick(resultListRepeater.itemAt(1), 0, 0) |
250 | 203 | compare(hudClientStub.lastExecutedCommandRow, 1, "Last executed row was 1") | 206 | compare(hudClientStub.lastExecutedCommandRow, 1, "Last executed row was 1") |
251 | 207 | compare(hud.shown, false, "Should not be shown after executing") | ||
252 | 208 | } | ||
253 | 209 | |||
254 | 210 | function number_of_activated_actions(activatedActionsObject) { | ||
255 | 211 | var activatedActions = 0 | ||
256 | 212 | for(var key in activatedActionsObject) { | ||
257 | 213 | ++activatedActions | ||
258 | 214 | } | ||
259 | 215 | return activatedActions | ||
260 | 216 | } | ||
261 | 217 | |||
262 | 218 | function test_hud_result_suggestion_parametrized_execution_and_back() { | ||
263 | 219 | var resultListRepeater = findChild(hud, "resultListRepeater") | ||
264 | 220 | var parametrizedActionsPage = findChild(hud, "parametrizedActionsPage") | ||
265 | 221 | var backButton = parametrizedActionsPage.children[1].children[0] | ||
266 | 222 | resetToInitialState() | ||
267 | 223 | |||
268 | 224 | compare(parametrizedActionsPage.shown, false, "Parametrized action page should be hidden at start") | ||
269 | 225 | tryCompare(parametrizedActionsPage, "x", hud.width) | ||
270 | 226 | |||
271 | 227 | mouseClick(resultListRepeater.itemAt(2), 0, 0) | ||
272 | 228 | compare(hudClientStub.lastExecutedCommandRow, -1, "We executed a param action not a regular one") | ||
273 | 229 | compare(hudClientStub.lastExecutedParametrizedCommandRow, 2, "Last executed row was 2") | ||
274 | 230 | compare(parametrizedActionsPage.shown, true, "Parametrized action page should be shown after executing a parametrized action") | ||
275 | 231 | tryCompare(parametrizedActionsPage, "x", 0) | ||
276 | 232 | |||
277 | 233 | var sliderLabel = parametrizedActionsPage.children[0].children[0].children[0].children[1].children[0] | ||
278 | 234 | var slider = parametrizedActionsPage.children[0].children[0].children[0].children[1].children[1] | ||
279 | 235 | compare(sliderLabel.text, "Item1Label") | ||
280 | 236 | compare(slider.minimumValue, 10) | ||
281 | 237 | compare(slider.maximumValue, 80) | ||
282 | 238 | compare(slider.live, true) | ||
283 | 239 | compare(number_of_activated_actions(hudClientStub.activatedActions), 0) | ||
284 | 240 | |||
285 | 241 | // Since it's live moving the slider will activate it already | ||
286 | 242 | var slider = parametrizedActionsPage.children[0].children[0].children[0].children[1].children[1] | ||
287 | 243 | mouseClick(slider, units.gu(1), units.gu(1)) | ||
288 | 244 | compare(number_of_activated_actions(hudClientStub.activatedActions), 1) | ||
289 | 245 | compare(hudClientStub.activatedActions["costAction"], 10) | ||
290 | 246 | |||
291 | 247 | mouseClick(backButton, 0, 0) | ||
292 | 248 | compare(parametrizedActionsPage.shown, false, "Parametrized action page should be hidden after going back") | ||
293 | 249 | compare(hudClientStub.lastParametrizedCommandCommited, false, "Cancelling does not commit") | ||
294 | 250 | tryCompare(parametrizedActionsPage, "x", hud.width) | ||
295 | 251 | } | ||
296 | 252 | |||
297 | 253 | function test_hud_result_suggestion_parametrized_execution_and_confirm() { | ||
298 | 254 | var resultListRepeater = findChild(hud, "resultListRepeater") | ||
299 | 255 | var parametrizedActionsPage = findChild(hud, "parametrizedActionsPage") | ||
300 | 256 | var confirmButton = parametrizedActionsPage.children[1].children[2] | ||
301 | 257 | resetToInitialState() | ||
302 | 258 | |||
303 | 259 | compare(parametrizedActionsPage.shown, false, "Parametrized action page should be hidden at start") | ||
304 | 260 | tryCompare(parametrizedActionsPage, "x", hud.width) | ||
305 | 261 | |||
306 | 262 | mouseClick(resultListRepeater.itemAt(2), 0, 0) | ||
307 | 263 | compare(hudClientStub.lastExecutedCommandRow, -1, "We executed a param action not a regular one") | ||
308 | 264 | compare(hudClientStub.lastExecutedParametrizedCommandRow, 2, "Last executed row was 2") | ||
309 | 265 | compare(parametrizedActionsPage.shown, true, "Parametrized action page should be shown after executing a parametrized action") | ||
310 | 266 | tryCompare(parametrizedActionsPage, "x", 0) | ||
311 | 267 | compare(number_of_activated_actions(hudClientStub.activatedActions), 0) | ||
312 | 268 | |||
313 | 269 | mouseClick(confirmButton, 0, 0) | ||
314 | 270 | compare(hud.shown, false, "Should not be shown after executing") | ||
315 | 271 | compare(number_of_activated_actions(hudClientStub.activatedActions), 1) | ||
316 | 272 | compare(hudClientStub.activatedActions["costAction"], 75) | ||
317 | 273 | compare(hudClientStub.lastParametrizedCommandCommited, true, "Confirming does commit") | ||
318 | 204 | } | 274 | } |
319 | 205 | } | 275 | } |
320 | 206 | } | 276 | } |
PASSED: Continuous integration, rev:509 jenkins. qa.ubuntu. com/job/ unity-phablet- ci/122/ jenkins. qa.ubuntu. com/job/ unity-phablet- quantal- armhf-ci/ 123 jenkins. qa.ubuntu. com/job/ unity-phablet- quantal- armhf-ci/ 123/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ unity-phablet- quantal- i386-ci/ 122 jenkins. qa.ubuntu. com/job/ generic- mediumtests- runner/ 229
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins: 8080/job/ unity-phablet- ci/122/ rebuild
http://