Merge lp:~osomon/webbrowser-app/autopilot-failures-desktop-1499411 into lp:webbrowser-app

Proposed by Olivier Tilloy
Status: Merged
Approved by: Olivier Tilloy
Approved revision: 1203
Merged at revision: 1208
Proposed branch: lp:~osomon/webbrowser-app/autopilot-failures-desktop-1499411
Merge into: lp:webbrowser-app
Diff against target: 108 lines (+28/-17)
2 files modified
src/app/webbrowser/Browser.qml (+5/-5)
tests/autopilot/webbrowser_app/tests/test_new_tab_view.py (+23/-12)
To merge this branch: bzr merge lp:~osomon/webbrowser-app/autopilot-failures-desktop-1499411
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu Phablet Team Pending
Review via email: mp+272275@code.launchpad.net

Commit message

Fix a couple of autopilot test failures on desktop.

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/app/webbrowser/Browser.qml'
2--- src/app/webbrowser/Browser.qml 2015-09-22 01:27:19 +0000
3+++ src/app/webbrowser/Browser.qml 2015-09-24 16:03:10 +0000
4@@ -367,21 +367,21 @@
5 objectName: "share"
6 text: i18n.tr("Share")
7 iconName: "share"
8- visible: (formFactor == "mobile") && browser.currentWebview && browser.currentWebview.url.toString()
9+ enabled: (formFactor == "mobile") && browser.currentWebview && browser.currentWebview.url.toString()
10 onTriggered: internal.shareLink(browser.currentWebview.url, browser.currentWebview.title)
11 },
12 Action {
13 objectName: "history"
14 text: i18n.tr("History")
15 iconName: "history"
16- visible: browser.historyModel
17+ enabled: browser.historyModel
18 onTriggered: historyViewLoader.active = true
19 },
20 Action {
21 objectName: "tabs"
22 text: i18n.tr("Open tabs")
23 iconName: "browser-tabs"
24- visible: (formFactor != "mobile") && !browser.wide
25+ enabled: (formFactor != "mobile") && !browser.wide
26 onTriggered: {
27 recentView.state = "shown"
28 recentToolbar.state = "shown"
29@@ -391,14 +391,14 @@
30 objectName: "newtab"
31 text: i18n.tr("New tab")
32 iconName: browser.incognito ? "private-tab-new" : "tab-new"
33- visible: (formFactor != "mobile") && !browser.wide
34+ enabled: (formFactor != "mobile") && !browser.wide
35 onTriggered: browser.openUrlInNewTab("", true)
36 },
37 Action {
38 objectName: "findinpage"
39 text: i18n.tr("Find in page")
40 iconName: "search"
41- visible: !chrome.findInPageMode && !newTabViewLoader.active
42+ enabled: !chrome.findInPageMode && !newTabViewLoader.active
43 onTriggered: {
44 chrome.findInPageMode = true
45 chrome.focus = true
46
47=== modified file 'tests/autopilot/webbrowser_app/tests/test_new_tab_view.py'
48--- tests/autopilot/webbrowser_app/tests/test_new_tab_view.py 2015-08-12 12:31:56 +0000
49+++ tests/autopilot/webbrowser_app/tests/test_new_tab_view.py 2015-09-24 16:03:10 +0000
50@@ -458,8 +458,7 @@
51 bookmark = bookmarks[1]
52 title = bookmark.title
53 grip = bookmark.get_grip()
54- original_x = grip.globalRect.x
55- original_y = grip.globalRect.y
56+ rect = grip.globalRect
57
58 # Test that when hovering normal bookmarks item the grip appears
59 self.assertThat(grip.opacity, Equals(0))
60@@ -467,27 +466,39 @@
61 self.assertThat(grip.opacity, Eventually(Equals(1.0)))
62
63 # Test that an item bounces back when dragged within the list itself
64- self.pointing_device.drag(original_x, original_y,
65- original_x, original_y + 200)
66+ self.pointing_device.drag(rect.x, rect.y,
67+ rect.x, rect.y + 200)
68+ self.assertThat(grip.globalRect, Eventually(Equals(rect)))
69
70 # Test that an item bounces back when dragged to the same folder
71 folder = folders[0]
72 folder_cx = folder.globalRect.x + folder.width / 2
73 folder_cy = folder.globalRect.y + folder.height / 2
74- self.pointing_device.drag(original_x, original_y,
75- folder_cx, folder_cy)
76-
77- self.assertThat(lambda: (grip.globalRect.x, grip.globalRect.y),
78- Eventually(Equals((original_x, original_y))))
79+ # Work around https://launchpad.net/bugs/1499437 by dragging downwards
80+ # a little bit first, then to the target folder.
81+ self.pointing_device.move_to_object(grip)
82+ pos = self.pointing_device.position()
83+ self.pointing_device.press()
84+ self.pointing_device.move(pos[0], pos[1] + 20)
85+ self.pointing_device.move(folder_cx, folder_cy)
86+ self.pointing_device.release()
87+ self.assertThat(grip.globalRect, Eventually(Equals(rect)))
88
89 # Test that dragging an item to another folder removes it from this one
90 # and adds it to the target folder
91 folder = folders[2]
92 folder_cx = folder.globalRect.x + folder.width / 2
93 folder_cy = folder.globalRect.y + folder.height / 2
94- self.pointing_device.drag(original_x, original_y,
95- folder_cx, folder_cy)
96-
97+ # Work around https://launchpad.net/bugs/1499437 by dragging downwards
98+ # a little bit first, then to the target folder.
99+ self.pointing_device.move_to_object(grip)
100+ pos = self.pointing_device.position()
101+ self.pointing_device.press()
102+ self.pointing_device.move(pos[0], pos[1] + 20)
103+ # Move the cursor to a few pixels below the vertical center of the
104+ # folder to ensure that the folder above doesn’t get targetted instead.
105+ self.pointing_device.move(folder_cx, folder_cy + 5)
106+ self.pointing_device.release()
107 self.assertThat(lambda: len(view.get_bookmarks_list()),
108 Eventually(NotEquals(previous_count)))
109

Subscribers

People subscribed via source and target branches

to status/vote changes: