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
=== modified file 'src/app/webbrowser/Browser.qml'
--- src/app/webbrowser/Browser.qml 2015-09-22 01:27:19 +0000
+++ src/app/webbrowser/Browser.qml 2015-09-24 16:03:10 +0000
@@ -367,21 +367,21 @@
367 objectName: "share"367 objectName: "share"
368 text: i18n.tr("Share")368 text: i18n.tr("Share")
369 iconName: "share"369 iconName: "share"
370 visible: (formFactor == "mobile") && browser.currentWebview && browser.currentWebview.url.toString()370 enabled: (formFactor == "mobile") && browser.currentWebview && browser.currentWebview.url.toString()
371 onTriggered: internal.shareLink(browser.currentWebview.url, browser.currentWebview.title)371 onTriggered: internal.shareLink(browser.currentWebview.url, browser.currentWebview.title)
372 },372 },
373 Action {373 Action {
374 objectName: "history"374 objectName: "history"
375 text: i18n.tr("History")375 text: i18n.tr("History")
376 iconName: "history"376 iconName: "history"
377 visible: browser.historyModel377 enabled: browser.historyModel
378 onTriggered: historyViewLoader.active = true378 onTriggered: historyViewLoader.active = true
379 },379 },
380 Action {380 Action {
381 objectName: "tabs"381 objectName: "tabs"
382 text: i18n.tr("Open tabs")382 text: i18n.tr("Open tabs")
383 iconName: "browser-tabs"383 iconName: "browser-tabs"
384 visible: (formFactor != "mobile") && !browser.wide384 enabled: (formFactor != "mobile") && !browser.wide
385 onTriggered: {385 onTriggered: {
386 recentView.state = "shown"386 recentView.state = "shown"
387 recentToolbar.state = "shown"387 recentToolbar.state = "shown"
@@ -391,14 +391,14 @@
391 objectName: "newtab"391 objectName: "newtab"
392 text: i18n.tr("New tab")392 text: i18n.tr("New tab")
393 iconName: browser.incognito ? "private-tab-new" : "tab-new"393 iconName: browser.incognito ? "private-tab-new" : "tab-new"
394 visible: (formFactor != "mobile") && !browser.wide394 enabled: (formFactor != "mobile") && !browser.wide
395 onTriggered: browser.openUrlInNewTab("", true)395 onTriggered: browser.openUrlInNewTab("", true)
396 },396 },
397 Action {397 Action {
398 objectName: "findinpage"398 objectName: "findinpage"
399 text: i18n.tr("Find in page")399 text: i18n.tr("Find in page")
400 iconName: "search"400 iconName: "search"
401 visible: !chrome.findInPageMode && !newTabViewLoader.active401 enabled: !chrome.findInPageMode && !newTabViewLoader.active
402 onTriggered: {402 onTriggered: {
403 chrome.findInPageMode = true403 chrome.findInPageMode = true
404 chrome.focus = true404 chrome.focus = true
405405
=== modified file 'tests/autopilot/webbrowser_app/tests/test_new_tab_view.py'
--- tests/autopilot/webbrowser_app/tests/test_new_tab_view.py 2015-08-12 12:31:56 +0000
+++ tests/autopilot/webbrowser_app/tests/test_new_tab_view.py 2015-09-24 16:03:10 +0000
@@ -458,8 +458,7 @@
458 bookmark = bookmarks[1]458 bookmark = bookmarks[1]
459 title = bookmark.title459 title = bookmark.title
460 grip = bookmark.get_grip()460 grip = bookmark.get_grip()
461 original_x = grip.globalRect.x461 rect = grip.globalRect
462 original_y = grip.globalRect.y
463462
464 # Test that when hovering normal bookmarks item the grip appears463 # Test that when hovering normal bookmarks item the grip appears
465 self.assertThat(grip.opacity, Equals(0))464 self.assertThat(grip.opacity, Equals(0))
@@ -467,27 +466,39 @@
467 self.assertThat(grip.opacity, Eventually(Equals(1.0)))466 self.assertThat(grip.opacity, Eventually(Equals(1.0)))
468467
469 # Test that an item bounces back when dragged within the list itself468 # Test that an item bounces back when dragged within the list itself
470 self.pointing_device.drag(original_x, original_y,469 self.pointing_device.drag(rect.x, rect.y,
471 original_x, original_y + 200)470 rect.x, rect.y + 200)
471 self.assertThat(grip.globalRect, Eventually(Equals(rect)))
472472
473 # Test that an item bounces back when dragged to the same folder473 # Test that an item bounces back when dragged to the same folder
474 folder = folders[0]474 folder = folders[0]
475 folder_cx = folder.globalRect.x + folder.width / 2475 folder_cx = folder.globalRect.x + folder.width / 2
476 folder_cy = folder.globalRect.y + folder.height / 2476 folder_cy = folder.globalRect.y + folder.height / 2
477 self.pointing_device.drag(original_x, original_y,477 # Work around https://launchpad.net/bugs/1499437 by dragging downwards
478 folder_cx, folder_cy)478 # a little bit first, then to the target folder.
479479 self.pointing_device.move_to_object(grip)
480 self.assertThat(lambda: (grip.globalRect.x, grip.globalRect.y),480 pos = self.pointing_device.position()
481 Eventually(Equals((original_x, original_y))))481 self.pointing_device.press()
482 self.pointing_device.move(pos[0], pos[1] + 20)
483 self.pointing_device.move(folder_cx, folder_cy)
484 self.pointing_device.release()
485 self.assertThat(grip.globalRect, Eventually(Equals(rect)))
482486
483 # Test that dragging an item to another folder removes it from this one487 # Test that dragging an item to another folder removes it from this one
484 # and adds it to the target folder488 # and adds it to the target folder
485 folder = folders[2]489 folder = folders[2]
486 folder_cx = folder.globalRect.x + folder.width / 2490 folder_cx = folder.globalRect.x + folder.width / 2
487 folder_cy = folder.globalRect.y + folder.height / 2491 folder_cy = folder.globalRect.y + folder.height / 2
488 self.pointing_device.drag(original_x, original_y,492 # Work around https://launchpad.net/bugs/1499437 by dragging downwards
489 folder_cx, folder_cy)493 # a little bit first, then to the target folder.
490494 self.pointing_device.move_to_object(grip)
495 pos = self.pointing_device.position()
496 self.pointing_device.press()
497 self.pointing_device.move(pos[0], pos[1] + 20)
498 # Move the cursor to a few pixels below the vertical center of the
499 # folder to ensure that the folder above doesn’t get targetted instead.
500 self.pointing_device.move(folder_cx, folder_cy + 5)
501 self.pointing_device.release()
491 self.assertThat(lambda: len(view.get_bookmarks_list()),502 self.assertThat(lambda: len(view.get_bookmarks_list()),
492 Eventually(NotEquals(previous_count)))503 Eventually(NotEquals(previous_count)))
493504

Subscribers

People subscribed via source and target branches

to status/vote changes: