Merge lp:~abreu-alexandre/webbrowser-app/fix-webapp-name-handling into lp:webbrowser-app
- fix-webapp-name-handling
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Olivier Tilloy |
Approved revision: | 1145 |
Merged at revision: | 1147 |
Proposed branch: | lp:~abreu-alexandre/webbrowser-app/fix-webapp-name-handling |
Merge into: | lp:webbrowser-app |
Diff against target: |
133 lines (+98/-1) 2 files modified
src/app/webcontainer/WebApp.qml (+10/-1) tests/autopilot/webapp_container/tests/test_webapp_name_precedence.py (+88/-0) |
To merge this branch: | bzr merge lp:~abreu-alexandre/webbrowser-app/fix-webapp-name-handling |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Needs Fixing | |
Olivier Tilloy | Approve | ||
Review via email: mp+264429@code.launchpad.net |
Commit message
Fix webapp name logic
Description of the change
Fix webapp name logic
PS Jenkins bot (ps-jenkins) wrote : | # |
- 1095. By CI Train Bot Account
-
Resync trunk.
- 1096. By Launchpad Translations on behalf of phablet-team
-
Launchpad automatic translations update.
- 1097. By Launchpad Translations on behalf of phablet-team
-
Launchpad automatic translations update.
- 1098. By Launchpad Translations on behalf of phablet-team
-
Launchpad automatic translations update.
- 1099. By Launchpad Translations on behalf of phablet-team
-
Launchpad automatic translations update.
- 1100. By Launchpad Translations on behalf of phablet-team
-
Launchpad automatic translations update.
- 1101. By Launchpad Translations on behalf of phablet-team
-
Launchpad automatic translations update.
- 1102. By Launchpad Translations on behalf of phablet-team
-
Launchpad automatic translations update.
- 1103. By Launchpad Translations on behalf of phablet-team
-
Launchpad automatic translations update.
- 1104. By Olivier Tilloy
-
Fix narrowing conversion that makes the build fail with GCC 5. Fixes: #1475621
Approved by: Alexandre Abreu, PS Jenkins bot - 1105. By CI Train Bot Account
-
Releasing 0.23+15.
10.20150728- 0ubuntu1 - 1106. By Launchpad Translations on behalf of phablet-team
-
Launchpad automatic translations update.
- 1107. By Olivier Tilloy
-
When clearing browsing data, confirm action with a dialog, to give the user a chance to cancel it. Fixes: #1471747
Approved by: PS Jenkins bot, Riccardo Padovani - 1108. By Olivier Tilloy
-
Ensure a value is always returned by BookmarksModel:
:addFolder( …).
Approved by: PS Jenkins bot - 1109. By Olivier Tilloy
-
Update icon, per UI specification. Fixes: #1412732
Approved by: PS Jenkins bot, Riccardo Padovani - 1110. By CI Train Bot Account
-
Releasing 0.23+15.
10.20150729- 0ubuntu1 - 1111. By CI Train Bot Account
-
Resync trunk.
- 1112. By Launchpad Translations on behalf of phablet-team
-
Launchpad automatic translations update.
- 1113. By Olivier Tilloy
-
Update translation template.
- 1114. By Launchpad Translations on behalf of phablet-team
-
Launchpad automatic translations update.
- 1115. By Launchpad Translations on behalf of phablet-team
-
Launchpad automatic translations update.
- 1116. By Launchpad Translations on behalf of phablet-team
-
Launchpad automatic translations update.
- 1117. By Launchpad Translations on behalf of phablet-team
-
Launchpad automatic translations update.
- 1118. By Steve Langasek
-
Add missing changelog entry due to direct upload.
- 1119. By Launchpad Translations on behalf of phablet-team
-
Launchpad automatic translations update.
- 1120. By Olivier Tilloy
-
Update all imports of:
- Ubuntu.Components to 1.3
- QtQuick to 2.4
- QtQuick.Window to 2.2This bumps the required versions of qtdeclarative5-
ubuntu- ui-toolkit- plugin, qml-module-qtquick2 and qml-module- qtquick- window2 in debian/control. Fixes: #1483279 - 1121. By CI Train Bot Account
-
Releasing 0.23+15.
10.20150810- 0ubuntu1 - 1122. By Olivier Tilloy
-
Implement the "Find in Page" feature.
This bumps the runtime dependency on liboxideqt-qmlplugin to 1.8. Fixes: #1312260
Approved by: Riccardo Padovani - 1123. By Olivier Tilloy
-
Drop old names for QML dependencies.
Original patch by Robert Ancell. - 1124. By Olivier Tilloy
-
Highlight matching terms in one pass. Fixes: #1481206
Approved by: PS Jenkins bot, Ugo Riboni - 1125. By CI Train Bot Account
-
Releasing 0.23+15.
10.20150811- 0ubuntu1 - 1126. By Olivier Tilloy
-
Update translation template.
- 1127. By Launchpad Translations on behalf of phablet-team
-
Launchpad automatic translations update.
- 1128. By Arthur Mello
-
Wide screen versions of the history view and new tab view, per design specification.
This adds a build dependency on qml-module-qt-labs- settings (for unit tests). Fixes: #1351157, #1481647 - 1129. By CI Train Bot Account
-
Releasing 0.23+15.
10.20150812. 1-0ubuntu1 - 1130. By Olivier Tilloy
-
Update translation template.
- 1131. By Launchpad Translations on behalf of phablet-team
-
Launchpad automatic translations update.
- 1132. By Olivier Tilloy
-
Remove strong typing of the contextualActions and selectionActions properties.
This would cause issues if an app imported Ubuntu.Web along with Ubuntu.Components < 1.3 and overrode one of these properties, because the webview expected an ActionList 1.3, and would get an earlier version. Fixes: #1484437 - 1133. By CI Train Bot Account
-
Releasing 0.23+15.
10.20150813. 1-0ubuntu1 - 1134. By CI Train Bot Account
-
Resync trunk.
- 1135. By Ugo Riboni
-
Delay the exit from fullscreen mode until focus remains lost for a certain amount of time. Fixes: #1477308
Approved by: Olivier Tilloy - 1136. By Ugo Riboni
-
Disable find in page when the new tab view is active. Fixes: #1483847
Approved by: Olivier Tilloy - 1137. By CI Train Bot Account
-
Releasing 0.23+15.
10.20150814- 0ubuntu1 - 1138. By Launchpad Translations on behalf of phablet-team
-
Launchpad automatic translations update.
- 1139. By Launchpad Translations on behalf of phablet-team
-
Launchpad automatic translations update.
- 1140. By Launchpad Translations on behalf of phablet-team
-
Launchpad automatic translations update.
- 1141. By Colin Watson
-
Fix versioned dependencies on qtdeclarative5-
ubuntu- ui-toolkit- plugin to allow qtdeclarative5- ubuntu- ui-toolkit- plugin- gles.
Approved by: Olivier Tilloy - 1142. By Arthur Mello
-
Wait for OptionSelector's collapsing transition to finish Fixes: #1484175
Approved by: Olivier Tilloy - 1143. By Arthur Mello
-
Make sure to set the historyModel to the HistoryView component when browser wide property changes Fixes: #1484555
Approved by: Olivier Tilloy - 1144. By CI Train Bot Account
-
Releasing 0.23+15.
10.20150817- 0ubuntu1
Olivier Tilloy (osomon) wrote : | # |
flake8 raises 4 errors.
Olivier Tilloy (osomon) wrote : | # |
The change otherwise looks good to me.
Alexandre Abreu (abreu-alexandre) wrote : | # |
Updated
- 1145. By Alexandre Abreu
-
Fix webapp name logic
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1145
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1145
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === modified file 'src/app/webcontainer/WebApp.qml' |
2 | --- src/app/webcontainer/WebApp.qml 2015-08-10 15:22:00 +0000 |
3 | +++ src/app/webcontainer/WebApp.qml 2015-08-18 14:29:10 +0000 |
4 | @@ -37,7 +37,6 @@ |
5 | |
6 | property string webappModelSearchPath: "" |
7 | |
8 | - property alias webappName: webview.webappName |
9 | property var webappUrlPatterns |
10 | property alias popupRedirectionUrlPrefixPattern: webview.popupRedirectionUrlPrefixPattern |
11 | property alias webviewOverrideFile: webview.webviewOverrideFile |
12 | @@ -46,6 +45,8 @@ |
13 | property alias dataPath: webview.dataPath |
14 | property alias runningLocalApplication: webview.runningLocalApplication |
15 | |
16 | + property string webappName: "" |
17 | + |
18 | property bool backForwardButtonsVisible: false |
19 | property bool chromeVisible: false |
20 | readonly property bool chromeless: !chromeVisible && !backForwardButtonsVisible && !accountSwitcher |
21 | @@ -130,11 +131,19 @@ |
22 | } |
23 | height: parent.height - osk.height |
24 | developerExtrasEnabled: webapp.developerExtrasEnabled |
25 | + |
26 | onSamlRequestUrlPatternReceived: { |
27 | addGeneratedUrlPattern(urlPattern) |
28 | } |
29 | webappUrlPatterns: mergeUrlPatternSets(urlPatternSettings.generatedUrlPatterns, |
30 | webapp.webappUrlPatterns) |
31 | + |
32 | + /** |
33 | + * Use the --webapp parameter value w/ precedence, but also take into account |
34 | + * the fact that a webapp 'name' can come from a webapp-properties.json file w/o |
35 | + * being explictly defined here. |
36 | + */ |
37 | + webappName: webapp.webappName === "" ? unityWebapps.name : webapp.webappName |
38 | } |
39 | |
40 | Loader { |
41 | |
42 | === added file 'tests/autopilot/webapp_container/tests/test_webapp_name_precedence.py' |
43 | --- tests/autopilot/webapp_container/tests/test_webapp_name_precedence.py 1970-01-01 00:00:00 +0000 |
44 | +++ tests/autopilot/webapp_container/tests/test_webapp_name_precedence.py 2015-08-18 14:29:10 +0000 |
45 | @@ -0,0 +1,88 @@ |
46 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
47 | +# Copyright 2015 Canonical |
48 | +# |
49 | +# This program is free software: you can redistribute it and/or modify it |
50 | +# under the terms of the GNU General Public License version 3, as published |
51 | +# by the Free Software Foundation. |
52 | +# |
53 | +# This program is distributed in the hope that it will be useful, |
54 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
55 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
56 | +# GNU General Public License for more details. |
57 | +# |
58 | +# You should have received a copy of the GNU General Public License |
59 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
60 | + |
61 | +from contextlib import contextmanager |
62 | +import os |
63 | +import tempfile |
64 | +import shutil |
65 | + |
66 | +from testtools.matchers import Equals |
67 | +from autopilot.matchers import Eventually |
68 | + |
69 | +from webapp_container.tests import WebappContainerTestCaseWithLocalContentBase |
70 | + |
71 | + |
72 | +@contextmanager |
73 | +def generate_temp_webapp(manifest_filename='manifest.json'): |
74 | + tmpdir = tempfile.mkdtemp() |
75 | + webapp_folder_name = '{}/unity-webapps-test'.format(tmpdir) |
76 | + os.mkdir(webapp_folder_name) |
77 | + manifest_content = """ |
78 | + { |
79 | + "includes": ["http://test.com:*/*"], |
80 | + "name": "test", |
81 | + "scripts": ["test.user.js"], |
82 | + "domain":"", |
83 | + "homepage":"http://www.test.com/" |
84 | + } |
85 | + """ |
86 | + manifest_file = "{}/{}".format(webapp_folder_name, manifest_filename) |
87 | + with open(manifest_file, "w+") as f: |
88 | + f.write(manifest_content) |
89 | + script_file = "{}/test.user.js".format(webapp_folder_name) |
90 | + with open(script_file, "w+") as f: |
91 | + f.write("") |
92 | + try: |
93 | + yield tmpdir |
94 | + finally: |
95 | + shutil.rmtree(tmpdir) |
96 | + |
97 | + |
98 | +class WebappContainerWebappNamePrecedenceTestCase( |
99 | + WebappContainerTestCaseWithLocalContentBase): |
100 | + def test_webapps_launch_default_search_path(self): |
101 | + args = ["--webapp='dGVzdA=='"] |
102 | + rule = 'MAP *.test.com:80 ' + self.get_base_url_hostname() |
103 | + with generate_temp_webapp() as webapp_install_path: |
104 | + self.launch_webcontainer_app( |
105 | + args, |
106 | + {'UBUNTU_WEBVIEW_HOST_MAPPING_RULES': rule, |
107 | + 'WEBAPP_QML_DEFAULT_WEBAPPS_INSTALL_FOLDER': |
108 | + webapp_install_path}) |
109 | + webview = self.get_oxide_webview() |
110 | + webapp_url = 'http://www.test.com/' |
111 | + self.assertThat(webview.url, Eventually(Equals(webapp_url))) |
112 | + |
113 | + result = 'test' |
114 | + self.assertThat(self.get_webcontainer_window().title, |
115 | + Eventually(Equals(result))) |
116 | + |
117 | + def test_webapps_launch_custom_search_path(self): |
118 | + args = [] |
119 | + rule = 'MAP *.test.com:80 ' + self.get_base_url_hostname() |
120 | + with generate_temp_webapp('webapp-properties.json') as install_path: |
121 | + args.append('--webappModelSearchPath={}'.format(install_path)) |
122 | + self.launch_webcontainer_app( |
123 | + args, |
124 | + {'UBUNTU_WEBVIEW_HOST_MAPPING_RULES': rule, |
125 | + 'WEBAPP_QML_DEFAULT_WEBAPPS_INSTALL_FOLDER': |
126 | + install_path}) |
127 | + webview = self.get_oxide_webview() |
128 | + webapp_url = 'http://www.test.com/' |
129 | + self.assertThat(webview.url, Eventually(Equals(webapp_url))) |
130 | + |
131 | + result = 'test' |
132 | + self.assertThat(self.get_webcontainer_window().title, |
133 | + Eventually(Equals(result))) |
FAILED: Continuous integration, rev:1091 jenkins. qa.ubuntu. com/job/ webbrowser- app-ci/ 1991/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- vivid-touch/ 3412/console jenkins. qa.ubuntu. com/job/ webbrowser- app-vivid- amd64-ci/ 745/console jenkins. qa.ubuntu. com/job/ webbrowser- app-vivid- armhf-ci/ 745/console jenkins. qa.ubuntu. com/job/ webbrowser- app-vivid- i386-ci/ 745/console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- vivid-armhf/ 3409/console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/webbrowser- app-ci/ 1991/rebuild
http://