Merge lp:~osomon/webbrowser-app/expanded-historyview-header into lp:webbrowser-app

Proposed by Olivier Tilloy
Status: Merged
Approved by: Olivier Tilloy
Approved revision: 1281
Merged at revision: 1285
Proposed branch: lp:~osomon/webbrowser-app/expanded-historyview-header
Merge into: lp:webbrowser-app
Diff against target: 70 lines (+27/-0)
3 files modified
src/app/webbrowser/ExpandedHistoryView.qml (+7/-0)
tests/autopilot/webbrowser_app/emulators/browser.py (+3/-0)
tests/autopilot/webbrowser_app/tests/test_history.py (+17/-0)
To merge this branch: bzr merge lp:~osomon/webbrowser-app/expanded-historyview-header
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Ugo Riboni (community) Approve
Review via email: mp+278299@code.launchpad.net

Commit message

Prevent click events from propagating through the expanded history view to the view below.

To post a comment you must log in.
Revision history for this message
Ugo Riboni (uriboni) wrote :

Code LGTM, does what it says, tests pass.

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
=== modified file 'src/app/webbrowser/ExpandedHistoryView.qml'
--- src/app/webbrowser/ExpandedHistoryView.qml 2015-08-13 20:41:56 +0000
+++ src/app/webbrowser/ExpandedHistoryView.qml 2015-11-23 10:36:10 +0000
@@ -30,6 +30,12 @@
30 signal historyEntryRemoved(url url)30 signal historyEntryRemoved(url url)
31 signal done()31 signal done()
3232
33 MouseArea {
34 // Prevent click events from propagating through to the view below
35 anchors.fill: parent
36 acceptedButtons: Qt.AllButtons
37 }
38
33 Rectangle {39 Rectangle {
34 anchors.fill: parent40 anchors.fill: parent
35 color: "#f6f6f6"41 color: "#f6f6f6"
@@ -73,6 +79,7 @@
7379
74 Item {80 Item {
75 id: header81 id: header
82 objectName: "header"
7683
77 anchors {84 anchors {
78 top: parent.top85 top: parent.top
7986
=== modified file 'tests/autopilot/webbrowser_app/emulators/browser.py'
--- tests/autopilot/webbrowser_app/emulators/browser.py 2015-10-22 15:07:18 +0000
+++ tests/autopilot/webbrowser_app/emulators/browser.py 2015-11-23 10:36:10 +0000
@@ -527,6 +527,9 @@
527527
528class ExpandedHistoryView(uitk.UbuntuUIToolkitCustomProxyObjectBase):528class ExpandedHistoryView(uitk.UbuntuUIToolkitCustomProxyObjectBase):
529529
530 def get_header(self):
531 return self.select_single(objectName="header")
532
530 def get_entries(self):533 def get_entries(self):
531 return sorted(self.select_many("UrlDelegate",534 return sorted(self.select_many("UrlDelegate",
532 objectName="entriesDelegate"),535 objectName="entriesDelegate"),
533536
=== modified file 'tests/autopilot/webbrowser_app/tests/test_history.py'
--- tests/autopilot/webbrowser_app/tests/test_history.py 2015-08-31 09:20:40 +0000
+++ tests/autopilot/webbrowser_app/tests/test_history.py 2015-11-23 10:36:10 +0000
@@ -14,6 +14,8 @@
14# You should have received a copy of the GNU General Public License14# You should have received a copy of the GNU General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.15# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
17import time
18
17from testtools.matchers import Equals19from testtools.matchers import Equals
18from autopilot.matchers import Eventually20from autopilot.matchers import Eventually
1921
@@ -61,3 +63,18 @@
61 delegates = expanded_history.get_entries()63 delegates = expanded_history.get_entries()
62 self.assertThat(sorted([delegate.url for delegate in delegates]),64 self.assertThat(sorted([delegate.url for delegate in delegates]),
63 Equals(sorted([self.url, url])))65 Equals(sorted([self.url, url])))
66
67 def test_expanded_history_view_header_swallows_clicks(self):
68 # Regression test for https://launchpad.net/bugs/1518904
69 if self.main_window.wide:
70 self.skipTest("Only on narrow form factors")
71 history = self.open_history()
72 self.pointing_device.click_object(history.get_domain_entries()[0])
73 expanded_history = self.main_window.get_expanded_history_view()
74 hr = expanded_history.get_header().globalRect
75 self.pointing_device.move(hr.x + hr.width // 2, hr.y + hr.height - 5)
76 self.pointing_device.click()
77 time.sleep(1)
78 # There should be only one instance on the expanded history view.
79 # If there’s more, the following call will raise an exception.
80 self.main_window.get_expanded_history_view()

Subscribers

People subscribed via source and target branches

to status/vote changes: