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
1=== modified file 'src/app/webbrowser/ExpandedHistoryView.qml'
2--- src/app/webbrowser/ExpandedHistoryView.qml 2015-08-13 20:41:56 +0000
3+++ src/app/webbrowser/ExpandedHistoryView.qml 2015-11-23 10:36:10 +0000
4@@ -30,6 +30,12 @@
5 signal historyEntryRemoved(url url)
6 signal done()
7
8+ MouseArea {
9+ // Prevent click events from propagating through to the view below
10+ anchors.fill: parent
11+ acceptedButtons: Qt.AllButtons
12+ }
13+
14 Rectangle {
15 anchors.fill: parent
16 color: "#f6f6f6"
17@@ -73,6 +79,7 @@
18
19 Item {
20 id: header
21+ objectName: "header"
22
23 anchors {
24 top: parent.top
25
26=== modified file 'tests/autopilot/webbrowser_app/emulators/browser.py'
27--- tests/autopilot/webbrowser_app/emulators/browser.py 2015-10-22 15:07:18 +0000
28+++ tests/autopilot/webbrowser_app/emulators/browser.py 2015-11-23 10:36:10 +0000
29@@ -527,6 +527,9 @@
30
31 class ExpandedHistoryView(uitk.UbuntuUIToolkitCustomProxyObjectBase):
32
33+ def get_header(self):
34+ return self.select_single(objectName="header")
35+
36 def get_entries(self):
37 return sorted(self.select_many("UrlDelegate",
38 objectName="entriesDelegate"),
39
40=== modified file 'tests/autopilot/webbrowser_app/tests/test_history.py'
41--- tests/autopilot/webbrowser_app/tests/test_history.py 2015-08-31 09:20:40 +0000
42+++ tests/autopilot/webbrowser_app/tests/test_history.py 2015-11-23 10:36:10 +0000
43@@ -14,6 +14,8 @@
44 # You should have received a copy of the GNU General Public License
45 # along with this program. If not, see <http://www.gnu.org/licenses/>.
46
47+import time
48+
49 from testtools.matchers import Equals
50 from autopilot.matchers import Eventually
51
52@@ -61,3 +63,18 @@
53 delegates = expanded_history.get_entries()
54 self.assertThat(sorted([delegate.url for delegate in delegates]),
55 Equals(sorted([self.url, url])))
56+
57+ def test_expanded_history_view_header_swallows_clicks(self):
58+ # Regression test for https://launchpad.net/bugs/1518904
59+ if self.main_window.wide:
60+ self.skipTest("Only on narrow form factors")
61+ history = self.open_history()
62+ self.pointing_device.click_object(history.get_domain_entries()[0])
63+ expanded_history = self.main_window.get_expanded_history_view()
64+ hr = expanded_history.get_header().globalRect
65+ self.pointing_device.move(hr.x + hr.width // 2, hr.y + hr.height - 5)
66+ self.pointing_device.click()
67+ time.sleep(1)
68+ # There should be only one instance on the expanded history view.
69+ # If there’s more, the following call will raise an exception.
70+ self.main_window.get_expanded_history_view()

Subscribers

People subscribed via source and target branches

to status/vote changes: