Ubuntu Pastebin

Paste from Albert Astals Cid at Fri, 9 Jan 2015 08:58:18 +0000

Download as text
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
=== modified file 'tests/qmltests/Dash/Previews/tst_PreviewRatingDisplay.qml'
--- tests/qmltests/Dash/Previews/tst_PreviewRatingDisplay.qml	2014-07-04 07:42:00 +0000
+++ tests/qmltests/Dash/Previews/tst_PreviewRatingDisplay.qml	2015-01-09 08:51:03 +0000
@@ -118,7 +118,7 @@
             compare(rating.value, reviewsModel1["reviews"][1]["rating"]);
 
             // Tap on first star
-            mouseClick(rating, 0, 0);
+            mouseClick(rating);
             compare(rating.value, reviewsModel1["reviews"][1]["rating"]);
         }
     }

=== modified file 'tests/qmltests/Dash/tst_Dash.qml'
--- tests/qmltests/Dash/tst_Dash.qml	2015-01-08 11:32:30 +0000
+++ tests/qmltests/Dash/tst_Dash.qml	2015-01-09 08:53:27 +0000
@@ -90,7 +90,7 @@
             var scopesList = findChild(dash, "scopesList");
             var scopesListPageHeader = findChild(scopesList, "pageHeader");
             var backButton = findChild(findChild(scopesListPageHeader, "innerPageHeader"), "customBackButton");
-            mouseClick(backButton, 0, 0);
+            mouseClick(backButton);
             tryCompare(bottomEdgeController, "progress", 0);
         }
 
@@ -106,7 +106,7 @@
             tryCompare(favScopesListCategoryList, "currentIndex", 0);
 
             // Click in first item
-            mouseClick(favScopesListCategoryList.currentItem, 0, 0);
+            mouseClick(favScopesListCategoryList.currentItem);
 
             // Make sure animation went back
             tryCompare(bottomEdgeController, "progress", 0);
@@ -128,7 +128,7 @@
 
             // Click in second item
             favScopesListCategoryList.currentIndex = 1;
-            mouseClick(favScopesListCategoryList.currentItem, 0, 0);
+            mouseClick(favScopesListCategoryList.currentItem);
 
             // Make sure animation went back
             tryCompare(bottomEdgeController, "progress", 0);
@@ -148,7 +148,7 @@
             tryCompare(nonfavScopesListCategoryList, "currentIndex", 0);
 
             // Click on a non favorite scope
-            mouseClick(nonfavScopesListCategoryList.currentItem, 0, 0);
+            mouseClick(nonfavScopesListCategoryList.currentItem);
 
             // Check the bottom edge (manage dash) is disabled from temp scope
             var overviewDragHandle = findChild(dash, "overviewDragHandle");
@@ -165,7 +165,7 @@
             // Go back
             var dashTempScopeItemHeader = findChild(dashTempScopeItem, "scopePageHeader");
             var backButton = findChild(findChild(dashTempScopeItemHeader, "innerPageHeader"), "customBackButton");
-            mouseClick(backButton, 0, 0);
+            mouseClick(backButton);
 
             // Check temp scope is gone
             tryCompare(dashTempScopeItem, "x", dash.width);
@@ -189,7 +189,7 @@
             var scopesList = findChild(dash, "scopesList");
             var scopesListPageHeader = findChild(scopesList, "pageHeader");
             var searchButton = findChild(scopesListPageHeader, "search_header_button");
-            mouseClick(searchButton, 0, 0);
+            mouseClick(searchButton);
 
             // Type something
             keyClick(Qt.Key_H);
@@ -218,7 +218,7 @@
             // Go back
             var dashTempScopeItemHeader = findChild(dashTempScopeItem, "scopePageHeader");
             var backButton = findChild(findChild(dashTempScopeItemHeader, "innerPageHeader"), "customBackButton");
-            mouseClick(backButton, 0, 0);
+            mouseClick(backButton);
 
             // Check temp scope is gone
             tryCompare(dashTempScopeItem, "x", dash.width);
@@ -244,7 +244,7 @@
             var scopesList = findChild(dash, "scopesList");
             var scopesListPageHeader = findChild(scopesList, "pageHeader");
             var backButton = findChild(findChild(scopesListPageHeader, "innerPageHeader"), "customBackButton");
-            mouseClick(backButton, 0, 0);
+            mouseClick(backButton);
             tryCompare(bottomEdgeController, "progress", 0);
         }
 
@@ -320,7 +320,7 @@
             // Click on the store
             var scopesListPageHeader = findChild(scopesList, "pageHeader");
             var searchButton = findChild(scopesListPageHeader, "store_header_button");
-            mouseClick(searchButton, 0, 0);
+            mouseClick(searchButton);
 
             spy.wait();
             compare(spy.signalArguments[0][0], "scope://com.canonical.scopes.clickstore");
@@ -345,9 +345,9 @@
             // Enter edit mode
             var scopesList = findChild(dash, "scopesList");
             var clickScope = findChild(favScopesListCategoryList, "delegateclickscope");
-            mousePress(clickScope, 0, 0);
+            mousePress(clickScope);
             tryCompare(scopesList, "state", "edit");
-            mouseRelease(clickScope, 0, 0);
+            mouseRelease(clickScope);
 
             var starArea = findChild(clickScope, "starArea");
             touchFlick(starArea, 0, 0, 0, -units.gu(10));
@@ -356,8 +356,8 @@
             var scopesList = findChild(dash, "scopesList");
             var scopesListPageHeader = findChild(scopesList, "pageHeader");
             var backButton = findChild(findChild(scopesListPageHeader, "innerPageHeader"), "customBackButton");
-            mouseClick(backButton, 0, 0);
-            mouseClick(backButton, 0, 0);
+            mouseClick(backButton);
+            mouseClick(backButton);
             tryCompare(bottomEdgeController, "progress", 0);
 
             tryCompare(dashContentList, "currentIndex", 0);
@@ -387,9 +387,9 @@
             // Enter edit mode
             var scopesList = findChild(dash, "scopesList");
             var clickScope = findChild(favScopesListCategoryList, "delegateclickscope");
-            mousePress(clickScope, 0, 0);
+            mousePress(clickScope);
             tryCompare(scopesList, "state", "edit");
-            mouseRelease(clickScope, 0, 0);
+            mouseRelease(clickScope);
 
             var starArea = findChild(clickScope, "starArea");
             touchFlick(starArea, 0, 0, 0, -units.gu(10));
@@ -401,12 +401,12 @@
             var scopesList = findChild(dash, "scopesList");
             var scopesListPageHeader = findChild(scopesList, "pageHeader");
             var backButton = findChild(findChild(scopesListPageHeader, "innerPageHeader"), "customBackButton");
-            mouseClick(backButton, 0, 0);
+            mouseClick(backButton);
 
             // Click on third scope
             var mockScope5 = findChild(favScopesListCategoryList, "delegateMockScope5");
             waitForRendering(mockScope5)
-            mouseClick(mockScope5, 0, 0);
+            mouseClick(mockScope5);
             tryCompare(bottomEdgeController, "progress", 0);
             tryCompare(dashContentList, "currentIndex", 2);
             compare(dashContentList.currentItem.scopeId, "MockScope5");

=== modified file 'tests/qmltests/Dash/tst_DashContent.qml'
--- tests/qmltests/Dash/tst_DashContent.qml	2014-12-15 14:06:38 +0000
+++ tests/qmltests/Dash/tst_DashContent.qml	2015-01-09 08:54:28 +0000
@@ -288,7 +288,7 @@
             var dashNavigationButton = findChild(dashContentList.currentItem, "navigationButton");
             compare(dashNavigationButton.showList, false);
             waitForRendering(dashNavigationButton);
-            mouseClick(dashNavigationButton, dashNavigationButton.width / 2, dashNavigationButton.height / 2);
+            mouseClick(dashNavigationButton);
             compare(dashNavigationButton.showList, true);
 
             var navigationListView = findChild(dashNavigationButton, "navigationListView");
@@ -304,30 +304,30 @@
             compare(allButton.visible, false);
 
             var navigation = findChild(dashNavigationButton, "navigation0child3");
-            mouseClick(navigation, 0, 0);
+            mouseClick(navigation);
             compare(dashNavigationButton.showList, false);
             tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle3");
             tryCompare(navigationListView.currentItem.navigation, "navigationId", "root");
 
-            mouseClick(dashNavigationButton, 0, 0);
+            mouseClick(dashNavigationButton);
             compare(dashNavigationButton.showList, true);
             waitForRendering(navigationListView);
             waitForRendering(navigationListView.currentItem);
             compare(allButton.visible, true);
 
-            mouseClick(allButton, 0, 0);
+            mouseClick(allButton);
             compare(dashNavigationButton.showList, false);
             tryCompare(dashNavigationButton.currentNavigation, "navigationId", "root");
             tryCompare(navigationListView.currentItem.navigation, "navigationId", "root");
 
-            mouseClick(dashNavigationButton, 0, 0);
+            mouseClick(dashNavigationButton);
             compare(dashNavigationButton.showList, true);
             waitForRendering(navigationListView);
             waitForRendering(navigationListView.currentItem);
             compare(allButton.visible, false);
 
             navigation = findChild(dashNavigationButton, "navigation0child2");
-            mouseClick(navigation, 0, 0);
+            mouseClick(navigation);
             compare(dashNavigationButton.showList, true);
             tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle2");
             tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2");
@@ -340,12 +340,12 @@
 
             tryCompare(navigationListView, "contentX", navigationList1.x);
             waitForRendering(navigationListView);
-            mouseClick(allButton, 0, 0);
+            mouseClick(allButton);
             compare(dashNavigationButton.showList, false);
             tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle2");
             tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2");
 
-            mouseClick(dashNavigationButton, 0, 0);
+            mouseClick(dashNavigationButton);
             compare(dashNavigationButton.showList, true);
             waitForRendering(navigationListView);
             waitForRendering(navigationListView.currentItem);
@@ -354,47 +354,47 @@
 
             tryCompare(navigationList1.navigation, "loaded", true);
             navigation = findChild(dashNavigationButton, "navigation1child2");
-            mouseClick(navigation, 0, 0);
+            mouseClick(navigation);
             compare(dashNavigationButton.showList, false);
             tryCompare(dashNavigationButton.currentNavigation, "navigationId", "childmiddle22");
             tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2");
 
-            mouseClick(dashNavigationButton, 0, 0);
+            mouseClick(dashNavigationButton);
             compare(dashNavigationButton.showList, true);
             waitForRendering(navigationListView);
             waitForRendering(navigationListView.currentItem);
 
             tryCompare(navigationList1.navigation, "loaded", true);
             navigation = findChild(dashNavigationButton, "navigation1child3");
-            mouseClick(navigation, 0, 0);
+            mouseClick(navigation);
             compare(dashNavigationButton.showList, false);
             tryCompare(dashNavigationButton.currentNavigation, "navigationId", "childmiddle23");
             tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2");
 
-            mouseClick(dashNavigationButton, 0, 0);
+            mouseClick(dashNavigationButton);
             compare(dashNavigationButton.showList, true);
             waitForRendering(navigationListView);
             waitForRendering(navigationListView.currentItem);
-            mouseClick(backButton, 0, 0);
+            mouseClick(backButton);
 
             tryCompare(dashNavigationButton.currentNavigation, "navigationId", "root");
             tryCompare(navigationListView.currentItem.navigation, "navigationId", "root");
             compare(dashNavigationButton.showList, true);
-            mouseClick(dashNavigationButton, 0, 0);
+            mouseClick(dashNavigationButton);
             compare(dashNavigationButton.showList, false);
 
-            mouseClick(dashNavigationButton, 0, 0);
+            mouseClick(dashNavigationButton);
             compare(dashNavigationButton.showList, true);
             tryCompare(navigationListView.currentItem.navigation, "loaded", true);
             navigation = findChild(dashNavigationButton, "navigation0child2");
-            mouseClick(navigation, 0, 0);
+            mouseClick(navigation);
             compare(dashNavigationButton.showList, true);
             navigationList1 = findChild(dashNavigationButton, "navigation1");
             compare(navigationList1.navigation.loaded, false);
             tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle2");
             allButton = findChild(navigationList1, "allButton");
             tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle2");
-            mouseClick(allButton, 0, 0);
+            mouseClick(allButton);
             tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle2");
         }
 
@@ -408,7 +408,7 @@
 
             compare(dashNavigationButton.showList, false);
             waitForRendering(dashNavigationButton);
-            mouseClick(dashNavigationButton, 0, 0);
+            mouseClick(dashNavigationButton);
             compare(dashNavigationButton.showList, true);
 
             var navigationListView = findChild(dashNavigationButton, "navigationListView");
@@ -429,24 +429,24 @@
             compare(backButton.visible, false);
 
             var navigation = findChild(dashNavigationButton, "navigation0child3");
-            mouseClick(navigation, 0, 0);
+            mouseClick(navigation);
             compare(dashNavigationButton.showList, false);
             tryCompare(dashNavigationButton.currentNavigation, "navigationId", "altrootChild3");
             tryCompare(navigationListView.currentItem.navigation, "navigationId", "altroot");
 
-            mouseClick(dashNavigationButton, 0, 0);
+            mouseClick(dashNavigationButton);
             compare(dashNavigationButton.showList, true);
             waitForRendering(navigationListView);
             waitForRendering(navigationListView.currentItem);
             compare(allButton.visible, false);
 
             navigation = findChild(dashNavigationButton, "navigation0child2");
-            mouseClick(navigation, 0, 0);
+            mouseClick(navigation);
             compare(dashNavigationButton.showList, false);
             tryCompare(dashNavigationButton.currentNavigation, "navigationId", "altrootChild2");
             tryCompare(navigationListView.currentItem.navigation, "navigationId", "altroot");
 
-            mouseClick(dashNavigationButton, 0, 0);
+            mouseClick(dashNavigationButton);
             compare(dashNavigationButton.showList, true);
             waitForRendering(navigationListView);
             waitForRendering(navigationListView.currentItem);
@@ -454,7 +454,7 @@
 
             compare(navigationListView.count, 1, "There should be no second-level navigation");
 
-            mouseClick(dashNavigationButton, 0, 0);
+            mouseClick(dashNavigationButton);
             compare(dashNavigationButton.showList, false);
         }
 
@@ -474,7 +474,7 @@
             compare(dashNavigationButton.showList, false);
             compare(dashAltNavigationButton.showList, false);
 
-            mouseClick(dashNavigation, 0, 0);
+            mouseClick(dashNavigation);
             compare(dashNavigationButton.showList, false);
             compare(dashAltNavigationButton.showList, true);
 
@@ -500,7 +500,7 @@
             navigationListView = findChild(dashNavigationButton, "navigationListView");
             tryCompare(navigationListView.currentItem.navigation, "loaded", true);
 
-            mouseClick(dashNavigation, 0, 0);
+            mouseClick(dashNavigation);
             compare(dashNavigationButton.showList, false);
             compare(dashAltNavigationButton.showList, false);
         }

=== modified file 'tests/qmltests/Dash/tst_PageHeader.qml'
--- tests/qmltests/Dash/tst_PageHeader.qml	2014-08-27 14:36:22 +0000
+++ tests/qmltests/Dash/tst_PageHeader.qml	2015-01-09 08:53:44 +0000
@@ -157,7 +157,7 @@
             var recentSearches = findChild(headerContainer.popover, "recentSearches");
             verify(recentSearches, "Could not find recent searches in the popover");
             waitForRendering(recentSearches);
-            mouseClick(recentSearches.itemAt(0), 0, 0);
+            mouseClick(recentSearches.itemAt(0));
 
             compare(pageHeader.searchQuery, "Search2");
             tryCompareFunction(function() { return headerContainer.popover === null; }, true);

=== modified file 'tests/utils/modules/Unity/Test/UnityTestCase.qml'
--- tests/utils/modules/Unity/Test/UnityTestCase.qml	2014-11-24 11:17:33 +0000
+++ tests/utils/modules/Unity/Test/UnityTestCase.qml	2015-01-09 08:56:13 +0000
@@ -37,6 +37,67 @@
         this.getCurrentTimeMs = function() {return this.currentTimeMs}
     }
 
+    function mouseClick(item, x, y, button, modifiers, delay) {
+        if (button === undefined)
+            button = Qt.LeftButton;
+        if (modifiers === undefined)
+            modifiers = Qt.NoModifier;
+        if (delay == undefined)
+            delay = -1;
+        if (x == undefined)
+            x = item.width / 2;
+        if (y == undefined)
+            y = item.height / 2;
+        if (qtest_events.mouseClick(item, x, y, button, modifiers, delay))
+            qtest_fail("window not shown", 2);
+    }
+
+    function mouseDoubleClick(item, x, y, button, modifiers, delay) {
+        if (button === undefined)
+            button = Qt.LeftButton
+        if (modifiers === undefined)
+            modifiers = Qt.NoModifier
+        if (delay == undefined)
+            delay = -1
+        if (x == undefined)
+            x = item.width / 2;
+        if (y == undefined)
+            y = item.height / 2;
+        if (!qtest_events.mouseDoubleClick(item, x, y, button, modifiers, delay))
+            qtest_fail("window not shown", 2)
+    }
+
+    function mousePress(item, x, y, button, modifiers, delay) {
+        if (button === undefined)
+            button = Qt.LeftButton
+        if (modifiers === undefined)
+            modifiers = Qt.NoModifier
+        if (delay == undefined)
+            delay = -1
+        if (x == undefined)
+            x = item.width / 2;
+        if (y == undefined)
+            y = item.height / 2;
+        if (!qtest_events.mousePress(item, x, y, button, modifiers, delay))
+            qtest_fail("window not shown", 2)
+    }
+
+    function mouseRelease(item, x, y, button, modifiers, delay) {
+        if (button === undefined)
+            button = Qt.LeftButton
+        if (modifiers === undefined)
+            modifiers = Qt.NoModifier
+        if (delay == undefined)
+            delay = -1
+        if (x == undefined)
+            x = item.width / 2;
+        if (y == undefined)
+            y = item.height / 2;
+        if (!qtest_events.mouseRelease(item, x, y, button, modifiers, delay))
+            qtest_fail("window not shown", 2)
+    }
+
+
     // Flickable won't recognise a single mouse move as dragging the flickable.
     // Use 5 steps because it's what
     // Qt uses in QQuickViewTestUtil::flick
Download as text