Merge lp:~aacid/unity/fixTestMouseFlick into lp:unity/phablet

Proposed by Albert Astals Cid
Status: Merged
Approved by: Michael Zanetti
Approved revision: no longer in the source branch.
Merged at revision: 485
Proposed branch: lp:~aacid/unity/fixTestMouseFlick
Merge into: lp:unity/phablet
Diff against target: 32 lines (+5/-4)
2 files modified
tests/qmluitests/UnityTestCase.qml (+4/-3)
tests/qmluitests/tst_Hud.qml (+1/-1)
To merge this branch: bzr merge lp:~aacid/unity/fixTestMouseFlick
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Michael Zanetti (community) Approve
Review via email: mp+154017@code.launchpad.net

Commit message

Fix mouseFlick in UnityTestCase to flick to the correct x, y

To post a comment you must log in.
Revision history for this message
Michael Zanetti (mzanetti) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/qmluitests/UnityTestCase.qml'
2--- tests/qmluitests/UnityTestCase.qml 2013-03-15 11:12:20 +0000
3+++ tests/qmluitests/UnityTestCase.qml 2013-03-19 09:37:24 +0000
4@@ -23,11 +23,12 @@
5 function mouseFlick(item, x, y, toX, toY, pressMouse, releaseMouse) {
6 pressMouse = ((pressMouse != null) ? pressMouse : true); // Default to true for pressMouse if not present
7 releaseMouse = ((releaseMouse != null) ? releaseMouse : true); // Default to true for releaseMouse if not present
8- var diffX = toX - x
9- var diffY = toY - y
10+ var nIterations = 5
11+ var diffX = (toX - x) / nIterations
12+ var diffY = (toY - y) / nIterations
13 if (pressMouse)
14 mousePress(item, x, y)
15- for (var i = 0; i < 5; ++i)
16+ for (var i = 0; i < nIterations; ++i)
17 mouseMove(item, x + (i + 1) * diffX, y + (i + 1) * diffY)
18 if (releaseMouse)
19 mouseRelease(item, toX, toY)
20
21=== modified file 'tests/qmluitests/tst_Hud.qml'
22--- tests/qmluitests/tst_Hud.qml 2013-03-18 14:43:15 +0000
23+++ tests/qmluitests/tst_Hud.qml 2013-03-19 09:37:24 +0000
24@@ -89,7 +89,7 @@
25
26 // Check that when dragging right the special item appears at pos hud.appStack.width - itemwidth
27 start_x = units.gu(1)
28- stop_x = units.gu(45)
29+ stop_x = units.gu(150)
30 mouseFlick(hud.appStack.__flickable, start_x, 0, stop_x, 0, true, false)
31 tryCompare(hud.appStack.__specialItem, "visible", true)
32 compare(hud.appStack.__specialItem.x + hud.appStack.__specialItem.width, hud.appStack.width, "Special item on right")

Subscribers

People subscribed via source and target branches