Merge lp:~ahayzen/webbrowser-app/fix-1491279-depend-on-download-manager into lp:webbrowser-app/staging

Proposed by Andrew Hayzen
Status: Merged
Merged at revision: 1575
Proposed branch: lp:~ahayzen/webbrowser-app/fix-1491279-depend-on-download-manager
Merge into: lp:webbrowser-app/staging
Diff against target: 90 lines (+31/-10)
2 files modified
debian/control (+5/-0)
tests/autopilot/webbrowser_app/tests/test_downloads.py (+26/-10)
To merge this branch: bzr merge lp:~ahayzen/webbrowser-app/fix-1491279-depend-on-download-manager
Reviewer Review Type Date Requested Status
Olivier Tilloy Approve
Review via email: mp+309669@code.launchpad.net

Commit message

* Add qtdeclarative5-ubuntu-content1 and qtdeclarative5-ubuntu-download-manager0.1 as depends as they are in main and then fixes issues with saving images
* Enable autopilot TestDownloads on desktop as depends are now met

Description of the change

* Add qtdeclarative5-ubuntu-content1 and qtdeclarative5-ubuntu-download-manager0.1 as depends as they are in main and then fixes issues with saving images
* Enable autopilot TestDownloads on desktop as depends are now met

To post a comment you must log in.
Revision history for this message
Olivier Tilloy (osomon) wrote :

Please keep the list of dependencies alphabetically sorted.

Please add those two runtime deps to webapp-container as well. The fact that shared QML files are being installed by the webbrowser-app package is an implementation detail that might not hold true forever, so having the dependencies list explicitly is more future-proof.

review: Needs Fixing
1565. By Andrew Hayzen

* Fixed alphabetical ordering
* Added depends to webapp-container

Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Fixed the alphabetical ordering and added webapp-container deps, please retest :-)

1566. By Andrew Hayzen

* Enable TestDownloads on desktop as depends are now met

Revision history for this message
Olivier Tilloy (osomon) wrote :

webbrowser_app.tests.test_downloads.TestDownloads.test_picker reliably fails on my desktop, most likely because there’s no app installed that can handle the application/pdf mimetype.
Ideally this should be mocked in contenthub so that the test can always be run with predictable results. If not possible, please make it conditional (or remove it altogether, are we guaranteed to have a pdf reader application always installed on touch devices?).

review: Needs Fixing
1567. By Andrew Hayzen

* Run content-hub-peer-hook-wrapper in the setup for the test_picker test, to ensure that test peers are registered
* Add content-hub-testability as a depends for webbrowser-app autopilot

1568. By Andrew Hayzen

* Merge of lp:webbrowser-app/staging

1569. By Andrew Hayzen

* Reduce diff

Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Updated this to use content-hub-testability (note you'll need to install the package). And to ensure that the test peer has been registered before the test, in the setUp it runs /usr/lib/*/content-hub/content-hub-peer-hook-wrapper.

Please retest :-)

1570. By Andrew Hayzen

* Use UITK autopilot helper to get the arch triplet for finding content-hub-peer-hook-wrapper

Revision history for this message
Olivier Tilloy (osomon) wrote :

It looks like subprocess.run(…) is a recent addition to the subprocess module, it’s not available on my arale’s python3:

phablet@ubuntu-phablet:~$ python3 -c "import subprocess; subprocess.run"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: 'module' object has no attribute 'run'

review: Needs Fixing
1571. By Andrew Hayzen

* Use check_call instead of run from subprocess as this was added in Python 3.5 and isn't on devices

Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Updated to use check_call, please retest :-)

Revision history for this message
Olivier Tilloy (osomon) wrote :

LGTM now, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2016-10-27 08:21:44 +0000
3+++ debian/control 2016-11-03 18:00:54 +0000
4@@ -53,6 +53,8 @@
5 qml-module-qtquick-layouts,
6 qml-module-qtquick-window2 (>= 5.3),
7 qml-module-ubuntu-web (= ${binary:Version}),
8+ qtdeclarative5-ubuntu-content1,
9+ qtdeclarative5-ubuntu-download-manager0.1,
10 qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.3) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.3),
11 qtdeclarative5-unity-action-plugin,
12 Replaces: webbrowser-app-assets,
13@@ -76,6 +78,8 @@
14 qml-module-qtquick-window2 (>= 5.3),
15 qml-module-ubuntu-onlineaccounts,
16 qml-module-ubuntu-web (= ${binary:Version}),
17+ qtdeclarative5-ubuntu-content1,
18+ qtdeclarative5-ubuntu-download-manager0.1,
19 qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.3) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.3),
20 qtdeclarative5-unity-action-plugin,
21 unity-webapps-qml,
22@@ -164,6 +168,7 @@
23 Multi-Arch: foreign
24 Depends: ${misc:Depends},
25 autopilot-qt5,
26+ content-hub-testability,
27 python3-autopilot,
28 python3-fixtures,
29 python3-psutil,
30
31=== modified file 'tests/autopilot/webbrowser_app/tests/test_downloads.py'
32--- tests/autopilot/webbrowser_app/tests/test_downloads.py 2016-11-03 13:09:29 +0000
33+++ tests/autopilot/webbrowser_app/tests/test_downloads.py 2016-11-03 18:00:54 +0000
34@@ -21,11 +21,12 @@
35
36 from testtools.matchers import Equals
37
38+import ubuntuuitoolkit as uitk
39+
40+import subprocess
41 import testtools
42
43
44-@testtools.skipIf(model() == "Desktop", "Don't run on desktop, as "
45- "dependencies aren't guaranteed")
46 class TestDownloads(StartOpenRemotePageTestCaseBase):
47
48 def test_open_close_downloads_page(self):
49@@ -60,14 +61,6 @@
50 self.assertThat(options_dialog.visible, Eventually(Equals(True)))
51 self.main_window.click_cancel_download_button()
52
53- def test_picker(self):
54- self.main_window.go_to_url(self.base_url + "/downloadpdf")
55- options_dialog = self.main_window.get_download_options_dialog()
56- self.assertThat(options_dialog.visible, Eventually(Equals(True)))
57- self.main_window.click_choose_app_button()
58- picker = self.main_window.get_peer_picker()
59- self.assertThat(picker.visible, Eventually(Equals(True)))
60-
61 def test_download(self):
62 self.main_window.go_to_url(self.base_url + "/downloadpdf")
63 options_dialog = self.main_window.get_download_options_dialog()
64@@ -111,3 +104,26 @@
65 # Check that there are no entries in the public downloads window
66 entries = public_downloads_page.get_download_entries()
67 self.assertThat(len(entries), Equals(0))
68+
69+
70+class TestDownloadsWithContentHubTestability(StartOpenRemotePageTestCaseBase):
71+ def setUp(self):
72+ # Run content-hub-peer-hook-wrapper which ensures that
73+ # content-hub-testability has been register for the ContentPeersModel
74+
75+ # Find arch path of content-hub-peer-hook-wrapper
76+ path = ("/usr/lib/%s/content-hub/content-hub-peer-hook-wrapper" %
77+ uitk.base.get_host_multiarch())
78+
79+ return_code = subprocess.check_call([path])
80+ self.assertThat(return_code, Equals(0))
81+
82+ super(TestDownloadsWithContentHubTestability, self).setUp()
83+
84+ def test_picker(self):
85+ self.main_window.go_to_url(self.base_url + "/downloadpdf")
86+ options_dialog = self.main_window.get_download_options_dialog()
87+ self.assertThat(options_dialog.visible, Eventually(Equals(True)))
88+ self.main_window.click_choose_app_button()
89+ picker = self.main_window.get_peer_picker()
90+ self.assertThat(picker.visible, Eventually(Equals(True)))

Subscribers

People subscribed via source and target branches