Merge lp:~abreu-alexandre/webbrowser-app/theme-color-meta-detection into lp:webbrowser-app
- theme-color-meta-detection
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Alberto Mardegan | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 1320 | ||||
Proposed branch: | lp:~abreu-alexandre/webbrowser-app/theme-color-meta-detection | ||||
Merge into: | lp:webbrowser-app | ||||
Diff against target: |
322 lines (+211/-2) 8 files modified
src/app/ChromeBase.qml (+2/-0) src/app/webcontainer/CMakeLists.txt (+1/-1) src/app/webcontainer/WebApp.qml (+5/-0) src/app/webcontainer/WebViewImplOxide.qml (+43/-1) src/app/webcontainer/WebappContainerWebview.qml (+8/-0) src/app/webcontainer/webapp-specific-page-metadata-collector.js (+56/-0) tests/autopilot/webapp_container/tests/fake_servers.py (+47/-0) tests/autopilot/webapp_container/tests/test_page_meta_collector.py (+49/-0) |
||||
To merge this branch: | bzr merge lp:~abreu-alexandre/webbrowser-app/theme-color-meta-detection | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alberto Mardegan (community) | Approve | ||
PS Jenkins bot | continuous-integration | Needs Fixing | |
Review via email: mp+279120@code.launchpad.net |
Commit message
Handle theme_color page metainformation.
Description of the change
Handle theme_color page meta information as described here:
Test Case
---------
1. Go to a website that supports the theme_color meta info, e.g.
http://
2. MAke sure that the background color of the navigation ui is updated,
PS Jenkins bot (ps-jenkins) wrote : | # |
Alberto Mardegan (mardy) wrote : | # |
Since the tests are there, the description needs an update.
The code is good, I just wonder if we should implement some tricks on the text colour, to ensure that it's always visible against the background.
- 1295. By CI Train Bot Account
-
Resync trunk.
- 1296. By Launchpad Translations on behalf of phablet-team
-
Launchpad automatic translations update.
- 1297. By Launchpad Translations on behalf of phablet-team
-
Launchpad automatic translations update.
- 1298. By Zsombor Egri
-
Fix local Toolbar collision with UITK 1.3 Toolbar.
Approved by: Olivier Tilloy, Zoltan Balogh - 1299. By Olivier Tilloy
-
Work around what appears to be a regression in the UITK by specifying a non-null delay when swiping a list item to delete it in unit tests. Fixes: #1526940
Approved by: Michael Sheldon - 1300. By CI Train Bot Account
-
Releasing 0.23+16.
04.20151218- 0ubuntu1 - 1301. By Michael Sheldon
-
Add support for handling downloads internally within the browser. Fixes: #1354391
Approved by: Olivier Tilloy - 1302. By CI Train Bot Account
-
Releasing 0.23+16.
04.20151221- 0ubuntu1 - 1303. By Olivier Tilloy
-
Update translation template.
- 1304. By Olivier Tilloy
-
Recognize openoffice and MS-office file formats as documents, now that the document viewer app knows how to render them. Fixes: #1523452
Approved by: Michael Sheldon, PS Jenkins bot - 1305. By Olivier Tilloy
-
Do not allow interacting with tabs and the chrome while the settings page is shown. Fixes: #1524353
Approved by: PS Jenkins bot, Ugo Riboni - 1306. By Olivier Tilloy
-
Use the screen size (diagonal in millimeters) to determine which default UA string and which UA overrides to use.
An empirical threshold of 19cm is being used, it is subject to further adjustments. Fixes: #1504084
Approved by: PS Jenkins bot - 1307. By Olivier Tilloy
-
Add keyboard shorcuts for 'next' (Ctrl+G) and 'previous' (Ctrl+Shift+G) while in find-in-page mode. Fixes: #1522152
Approved by: PS Jenkins bot, Ugo Riboni - 1308. By Olivier Tilloy
-
Fix the tab preview sometimes covering the tab chrome, in the tabs view.
Offset tab previews by 1px to cover the semi-transparent horizontal line at the bottom of the tab chrome asset. Fixes: #1520624
Approved by: PS Jenkins bot, Ugo Riboni - 1309. By Olivier Tilloy
-
Fix some obvious issues in PreviewManager. Fixes: #1519019
Approved by: PS Jenkins bot, Ugo Riboni - 1310. By Olivier Tilloy
-
Fix a crash when clearing the navigation history while the new tab view is open. Fixes: #1525937
Approved by: Ugo Riboni - 1311. By Olivier Tilloy
-
Fix deleting multiple domains from the history view.
Add unit tests for the HistoryView component. Fixes: #1527144 - 1312. By CI Train Bot Account
-
Releasing 0.23+16.
04.20151222. 1-0ubuntu1 - 1313. By CI Train Bot Account
-
Resync trunk.
- 1314. By Launchpad Translations on behalf of phablet-team
-
Launchpad automatic translations update.
- 1315. By Alexandre Abreu
-
Make the webapp-container click hook more flexible. Instead of being able to delete cache & resource folders as the click is being uninstalled, one can also act on them as the click is being upgraded & installed. Fixes: #1522562
Approved by: PS Jenkins bot, Alberto Mardegan - 1316. By Alexandre Abreu
-
Handle empty url pattern in configuration file and invalid url pattern being specified. Fixes: #1522585
Approved by: PS Jenkins bot, Alberto Mardegan - 1317. By Alexandre Abreu
-
Handle application crashes or OOM interventions & save opened overlays Fixes: #1508969
Approved by: PS Jenkins bot, Alberto Mardegan - 1318. By Alexandre Abreu
-
Limited handling of custom context menu for the container
Approved by: Alberto Mardegan - 1319. By CI Train Bot Account
-
Releasing 0.23+16.
04.20160106. 4-0ubuntu1 - 1320. By Alexandre Abreu
-
Handle theme-color metadata
- 1321. By Alexandre Abreu
-
Add forgottten js file install
Preview Diff
1 | === modified file 'src/app/ChromeBase.qml' | |||
2 | --- src/app/ChromeBase.qml 2015-08-10 15:22:00 +0000 | |||
3 | +++ src/app/ChromeBase.qml 2016-01-08 19:32:31 +0000 | |||
4 | @@ -23,6 +23,8 @@ | |||
5 | 23 | StyledItem { | 23 | StyledItem { |
6 | 24 | id: chrome | 24 | id: chrome |
7 | 25 | 25 | ||
8 | 26 | objectName: "chromeBase" | ||
9 | 27 | |||
10 | 26 | property var webview | 28 | property var webview |
11 | 27 | property alias backgroundColor: backgroundRect.color | 29 | property alias backgroundColor: backgroundRect.color |
12 | 28 | 30 | ||
13 | 29 | 31 | ||
14 | === modified file 'src/app/webcontainer/CMakeLists.txt' | |||
15 | --- src/app/webcontainer/CMakeLists.txt 2015-09-29 19:31:47 +0000 | |||
16 | +++ src/app/webcontainer/CMakeLists.txt 2016-01-08 19:32:31 +0000 | |||
17 | @@ -40,7 +40,7 @@ | |||
18 | 40 | install(TARGETS ${WEBAPP_CONTAINER} | 40 | install(TARGETS ${WEBAPP_CONTAINER} |
19 | 41 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) | 41 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) |
20 | 42 | 42 | ||
22 | 43 | file(GLOB QML_FILES *.qml) | 43 | file(GLOB QML_FILES *.qml *.js) |
23 | 44 | install(FILES ${QML_FILES} DESTINATION ${CMAKE_INSTALL_DATADIR}/webbrowser-app/webcontainer) | 44 | install(FILES ${QML_FILES} DESTINATION ${CMAKE_INSTALL_DATADIR}/webbrowser-app/webcontainer) |
24 | 45 | install(DIRECTORY actions DESTINATION ${CMAKE_INSTALL_DATADIR}/webbrowser-app/webcontainer | 45 | install(DIRECTORY actions DESTINATION ${CMAKE_INSTALL_DATADIR}/webbrowser-app/webcontainer |
25 | 46 | FILES_MATCHING PATTERN *.qml) | 46 | FILES_MATCHING PATTERN *.qml) |
26 | 47 | 47 | ||
27 | === modified file 'src/app/webcontainer/WebApp.qml' | |||
28 | --- src/app/webcontainer/WebApp.qml 2016-01-06 19:43:23 +0000 | |||
29 | +++ src/app/webcontainer/WebApp.qml 2016-01-08 19:32:31 +0000 | |||
30 | @@ -140,6 +140,11 @@ | |||
31 | 140 | height: parent.height - osk.height | 140 | height: parent.height - osk.height |
32 | 141 | developerExtrasEnabled: webapp.developerExtrasEnabled | 141 | developerExtrasEnabled: webapp.developerExtrasEnabled |
33 | 142 | 142 | ||
34 | 143 | onThemeColorMetaInformationDetected: { | ||
35 | 144 | if (!webapp.chromeless && chromeLoader.item) { | ||
36 | 145 | chromeLoader.item.backgroundColor = theme_color | ||
37 | 146 | } | ||
38 | 147 | } | ||
39 | 143 | onSamlRequestUrlPatternReceived: { | 148 | onSamlRequestUrlPatternReceived: { |
40 | 144 | addGeneratedUrlPattern(urlPattern) | 149 | addGeneratedUrlPattern(urlPattern) |
41 | 145 | } | 150 | } |
42 | 146 | 151 | ||
43 | === modified file 'src/app/webcontainer/WebViewImplOxide.qml' | |||
44 | --- src/app/webcontainer/WebViewImplOxide.qml 2016-01-06 19:43:23 +0000 | |||
45 | +++ src/app/webcontainer/WebViewImplOxide.qml 2016-01-08 19:32:31 +0000 | |||
46 | @@ -46,6 +46,7 @@ | |||
47 | 46 | property bool blockOpenExternalUrls: false | 46 | property bool blockOpenExternalUrls: false |
48 | 47 | 47 | ||
49 | 48 | signal samlRequestUrlPatternReceived(string urlPattern) | 48 | signal samlRequestUrlPatternReceived(string urlPattern) |
50 | 49 | signal themeColorMetaInformationDetected(string theme_color) | ||
51 | 49 | 50 | ||
52 | 50 | // Those signals are used for testing purposes to externally | 51 | // Those signals are used for testing purposes to externally |
53 | 51 | // track down the various internal logic & steps of a popup lifecycle. | 52 | // track down the various internal logic & steps of a popup lifecycle. |
54 | @@ -69,7 +70,25 @@ | |||
55 | 69 | context: WebContext { | 70 | context: WebContext { |
56 | 70 | dataPath: webview.dataPath | 71 | dataPath: webview.dataPath |
57 | 71 | userAgent: localUserAgentOverride ? localUserAgentOverride : defaultUserAgent | 72 | userAgent: localUserAgentOverride ? localUserAgentOverride : defaultUserAgent |
58 | 73 | |||
59 | 74 | userScripts: [ | ||
60 | 75 | Oxide.UserScript { | ||
61 | 76 | context: "oxide://webapp-specific-page-metadata-collector/" | ||
62 | 77 | url: Qt.resolvedUrl("webapp-specific-page-metadata-collector.js") | ||
63 | 78 | incognitoEnabled: false | ||
64 | 79 | matchAllFrames: false | ||
65 | 80 | } | ||
66 | 81 | ] | ||
67 | 72 | } | 82 | } |
68 | 83 | messageHandlers: [ | ||
69 | 84 | Oxide.ScriptMessageHandler { | ||
70 | 85 | msgId: "webapp-specific-page-metadata-detected" | ||
71 | 86 | contexts: ["oxide://webapp-specific-page-metadata-collector/"] | ||
72 | 87 | callback: function(msg, frame) { | ||
73 | 88 | handlePageMetadata(msg.args) | ||
74 | 89 | } | ||
75 | 90 | } | ||
76 | 91 | ] | ||
77 | 73 | 92 | ||
78 | 74 | preferences.allowFileAccessFromFileUrls: runningLocalApplication | 93 | preferences.allowFileAccessFromFileUrls: runningLocalApplication |
79 | 75 | preferences.allowUniversalAccessFromFileUrls: runningLocalApplication | 94 | preferences.allowUniversalAccessFromFileUrls: runningLocalApplication |
80 | @@ -319,6 +338,30 @@ | |||
81 | 319 | } | 338 | } |
82 | 320 | } | 339 | } |
83 | 321 | 340 | ||
84 | 341 | function handlePageMetadata(metadata) { | ||
85 | 342 | if (metadata.type === 'manifest') { | ||
86 | 343 | var request = new XMLHttpRequest(); | ||
87 | 344 | request.onreadystatechange = function() { | ||
88 | 345 | if (request.readyState === XMLHttpRequest.DONE) { | ||
89 | 346 | try { | ||
90 | 347 | var manifest = JSON.parse(request.responseText); | ||
91 | 348 | if (manifest['theme_color'] | ||
92 | 349 | && manifest['theme_color'].length !== 0) { | ||
93 | 350 | themeColorMetaInformationDetected(manifest['theme_color']) | ||
94 | 351 | } | ||
95 | 352 | } catch(e) {} | ||
96 | 353 | } | ||
97 | 354 | } | ||
98 | 355 | request.open("GET", metadata.manifest); | ||
99 | 356 | request.send(); | ||
100 | 357 | } else if (metadata.type === 'theme-color') { | ||
101 | 358 | if (metadata['theme_color'] | ||
102 | 359 | && metadata['theme_color'].length !== 0) { | ||
103 | 360 | themeColorMetaInformationDetected(metadata['theme_color']) | ||
104 | 361 | } | ||
105 | 362 | } | ||
106 | 363 | } | ||
107 | 364 | |||
108 | 322 | onShowDownloadDialog: { | 365 | onShowDownloadDialog: { |
109 | 323 | if (downloadDialogLoader.status === Loader.Ready) { | 366 | if (downloadDialogLoader.status === Loader.Ready) { |
110 | 324 | var downloadDialog = PopupUtils.open(downloadDialogLoader.item, webview, {"contentType" : contentType, | 367 | var downloadDialog = PopupUtils.open(downloadDialogLoader.item, webview, {"contentType" : contentType, |
111 | @@ -341,5 +384,4 @@ | |||
112 | 341 | source: "ContentPickerDialog.qml" | 384 | source: "ContentPickerDialog.qml" |
113 | 342 | asynchronous: true | 385 | asynchronous: true |
114 | 343 | } | 386 | } |
115 | 344 | |||
116 | 345 | } | 387 | } |
117 | 346 | 388 | ||
118 | === modified file 'src/app/webcontainer/WebappContainerWebview.qml' | |||
119 | --- src/app/webcontainer/WebappContainerWebview.qml 2016-01-06 19:43:23 +0000 | |||
120 | +++ src/app/webcontainer/WebappContainerWebview.qml 2016-01-08 19:32:31 +0000 | |||
121 | @@ -42,6 +42,7 @@ | |||
122 | 42 | property bool wide: false | 42 | property bool wide: false |
123 | 43 | 43 | ||
124 | 44 | signal samlRequestUrlPatternReceived(string urlPattern) | 44 | signal samlRequestUrlPatternReceived(string urlPattern) |
125 | 45 | signal themeColorMetaInformationDetected(string theme_color) | ||
126 | 45 | 46 | ||
127 | 46 | onWideChanged: if (webappContainerWebViewLoader.item) webappContainerWebViewLoader.item.wide = wide | 47 | onWideChanged: if (webappContainerWebViewLoader.item) webappContainerWebViewLoader.item.wide = wide |
128 | 47 | 48 | ||
129 | @@ -70,6 +71,13 @@ | |||
130 | 70 | } | 71 | } |
131 | 71 | } | 72 | } |
132 | 72 | 73 | ||
133 | 74 | Connections { | ||
134 | 75 | target: webappContainerWebViewLoader.item | ||
135 | 76 | onThemeColorMetaInformationDetected: { | ||
136 | 77 | themeColorMetaInformationDetected(theme_color) | ||
137 | 78 | } | ||
138 | 79 | } | ||
139 | 80 | |||
140 | 73 | Loader { | 81 | Loader { |
141 | 74 | id: webappContainerWebViewLoader | 82 | id: webappContainerWebViewLoader |
142 | 75 | objectName: "containerWebviewLoader" | 83 | objectName: "containerWebviewLoader" |
143 | 76 | 84 | ||
144 | === added file 'src/app/webcontainer/webapp-specific-page-metadata-collector.js' | |||
145 | --- src/app/webcontainer/webapp-specific-page-metadata-collector.js 1970-01-01 00:00:00 +0000 | |||
146 | +++ src/app/webcontainer/webapp-specific-page-metadata-collector.js 2016-01-08 19:32:31 +0000 | |||
147 | @@ -0,0 +1,56 @@ | |||
148 | 1 | /* | ||
149 | 2 | * Copyright 2015 Canonical Ltd. | ||
150 | 3 | * | ||
151 | 4 | * This file is part of webbrowser-app. | ||
152 | 5 | * | ||
153 | 6 | * webbrowser-app is free software; you can redistribute it and/or modify | ||
154 | 7 | * it under the terms of the GNU General Public License as published by | ||
155 | 8 | * the Free Software Foundation; version 3. | ||
156 | 9 | * | ||
157 | 10 | * webbrowser-app is distributed in the hope that it will be useful, | ||
158 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
159 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
160 | 13 | * GNU General Public License for more details. | ||
161 | 14 | * | ||
162 | 15 | * You should have received a copy of the GNU General Public License | ||
163 | 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
164 | 17 | */ | ||
165 | 18 | |||
166 | 19 | (function() { | ||
167 | 20 | function detectThemeColorMetaInformation() { | ||
168 | 21 | var theme_color_meta = | ||
169 | 22 | document.head.querySelector('meta[name="theme-color"]'); | ||
170 | 23 | if (theme_color_meta) { | ||
171 | 24 | oxide.sendMessage( | ||
172 | 25 | 'webapp-specific-page-metadata-detected', { | ||
173 | 26 | type: 'theme-color', | ||
174 | 27 | baseurl: document.location.href, | ||
175 | 28 | theme_color: theme_color_meta.getAttribute('content') | ||
176 | 29 | }); | ||
177 | 30 | return true; | ||
178 | 31 | } | ||
179 | 32 | return false; | ||
180 | 33 | } | ||
181 | 34 | function detectManifestMetaInformation() { | ||
182 | 35 | var manifest = document.head.querySelector('link[rel="manifest"]'); | ||
183 | 36 | |||
184 | 37 | if (manifest && manifest.getAttribute('href')) { | ||
185 | 38 | oxide.sendMessage( | ||
186 | 39 | 'webapp-specific-page-metadata-detected', { | ||
187 | 40 | type: 'manifest', | ||
188 | 41 | baseurl: document.location.href, | ||
189 | 42 | manifest: manifest.href | ||
190 | 43 | }); | ||
191 | 44 | return true; | ||
192 | 45 | } | ||
193 | 46 | |||
194 | 47 | return false; | ||
195 | 48 | } | ||
196 | 49 | |||
197 | 50 | var detectors = [detectThemeColorMetaInformation, detectManifestMetaInformation] | ||
198 | 51 | for (var i in detectors) { | ||
199 | 52 | if (detectors[i]()) { | ||
200 | 53 | break; | ||
201 | 54 | } | ||
202 | 55 | } | ||
203 | 56 | })(); | ||
204 | 0 | 57 | ||
205 | === modified file 'tests/autopilot/webapp_container/tests/fake_servers.py' | |||
206 | --- tests/autopilot/webapp_container/tests/fake_servers.py 2015-12-17 13:56:54 +0000 | |||
207 | +++ tests/autopilot/webapp_container/tests/fake_servers.py 2016-01-08 19:32:31 +0000 | |||
208 | @@ -117,6 +117,39 @@ | |||
209 | 117 | </html> | 117 | </html> |
210 | 118 | """.format(loopcount) | 118 | """.format(loopcount) |
211 | 119 | 119 | ||
212 | 120 | def manifest_json_content(self): | ||
213 | 121 | return """ | ||
214 | 122 | { | ||
215 | 123 | "name": "Theme Color", | ||
216 | 124 | "short_name": "Theme Color", | ||
217 | 125 | "icons": [], | ||
218 | 126 | "theme_color": "#FF0000" | ||
219 | 127 | } """ | ||
220 | 128 | |||
221 | 129 | def theme_color_content(self, color, with_manifest=False): | ||
222 | 130 | color_content = '' | ||
223 | 131 | if color: | ||
224 | 132 | color_content = """ | ||
225 | 133 | <meta name=\"theme-color\" content=\"{}\"></meta> | ||
226 | 134 | """.format(color) | ||
227 | 135 | manifest_content = '' | ||
228 | 136 | if with_manifest: | ||
229 | 137 | manifest_content = "<link rel=\"manifest\" href=\"manifest.json\">" | ||
230 | 138 | |||
231 | 139 | return """ | ||
232 | 140 | <html> | ||
233 | 141 | <head> | ||
234 | 142 | {} | ||
235 | 143 | {} | ||
236 | 144 | <title>theme-color</title> | ||
237 | 145 | <script> | ||
238 | 146 | </script> | ||
239 | 147 | </head> | ||
240 | 148 | <body> | ||
241 | 149 | </body> | ||
242 | 150 | </html> | ||
243 | 151 | """.format(color_content, manifest_content) | ||
244 | 152 | |||
245 | 120 | def open_close_content(self): | 153 | def open_close_content(self): |
246 | 121 | return """ | 154 | return """ |
247 | 122 | <html> | 155 | <html> |
248 | @@ -187,6 +220,20 @@ | |||
249 | 187 | elif self.path == '/open-close-content': | 220 | elif self.path == '/open-close-content': |
250 | 188 | self.send_response(200) | 221 | self.send_response(200) |
251 | 189 | self.serve_content(self.open_close_content()) | 222 | self.serve_content(self.open_close_content()) |
252 | 223 | elif self.path == '/theme-color/manifest.json': | ||
253 | 224 | self.send_response(200) | ||
254 | 225 | self.serve_content(self.manifest_json_content()) | ||
255 | 226 | elif self.path.startswith('/theme-color/'): | ||
256 | 227 | args = self.path[len('/theme-color/'):] | ||
257 | 228 | self.send_response(200) | ||
258 | 229 | color = '' | ||
259 | 230 | if args.startswith('?color='): | ||
260 | 231 | color = args[len('?color='):] | ||
261 | 232 | with_manifest = False | ||
262 | 233 | if args.startswith('?manifest='): | ||
263 | 234 | with_manifest = True | ||
264 | 235 | self.send_response(200) | ||
265 | 236 | self.serve_content(self.theme_color_content(color, with_manifest)) | ||
266 | 190 | elif self.path.startswith('/saml/'): | 237 | elif self.path.startswith('/saml/'): |
267 | 191 | args = self.path[len('/saml/'):] | 238 | args = self.path[len('/saml/'):] |
268 | 192 | loopCount = 0 | 239 | loopCount = 0 |
269 | 193 | 240 | ||
270 | === added file 'tests/autopilot/webapp_container/tests/test_page_meta_collector.py' | |||
271 | --- tests/autopilot/webapp_container/tests/test_page_meta_collector.py 1970-01-01 00:00:00 +0000 | |||
272 | +++ tests/autopilot/webapp_container/tests/test_page_meta_collector.py 2016-01-08 19:32:31 +0000 | |||
273 | @@ -0,0 +1,49 @@ | |||
274 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | ||
275 | 2 | # Copyright 2015 Canonical | ||
276 | 3 | # | ||
277 | 4 | # This program is free software: you can redistribute it and/or modify it | ||
278 | 5 | # under the terms of the GNU General Public License version 3, as published | ||
279 | 6 | # by the Free Software Foundation. | ||
280 | 7 | # | ||
281 | 8 | # This program is distributed in the hope that it will be useful, | ||
282 | 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
283 | 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
284 | 11 | # GNU General Public License for more details. | ||
285 | 12 | # | ||
286 | 13 | # You should have received a copy of the GNU General Public License | ||
287 | 14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
288 | 15 | |||
289 | 16 | from webapp_container.tests import WebappContainerTestCaseWithLocalContentBase | ||
290 | 17 | |||
291 | 18 | from testtools.matchers import Equals | ||
292 | 19 | from autopilot.matchers import Eventually | ||
293 | 20 | |||
294 | 21 | |||
295 | 22 | class TestPageMetaCollector(WebappContainerTestCaseWithLocalContentBase): | ||
296 | 23 | def test_update_theme_color(self): | ||
297 | 24 | args = ['--enable-addressbar'] | ||
298 | 25 | self.launch_webcontainer_app_with_local_http_server( | ||
299 | 26 | args, | ||
300 | 27 | '/theme-color/?color=red') | ||
301 | 28 | self.get_webcontainer_window().visible.wait_for(True) | ||
302 | 29 | |||
303 | 30 | chrome_base = self.app.wait_select_single( | ||
304 | 31 | objectName="chromeBase") | ||
305 | 32 | |||
306 | 33 | self.assertThat( | ||
307 | 34 | lambda: str(chrome_base.backgroundColor), | ||
308 | 35 | Eventually(Equals("Color(255, 0, 0, 255)"))) | ||
309 | 36 | |||
310 | 37 | def test_update_theme_color_with_manifest(self): | ||
311 | 38 | args = ['--enable-addressbar'] | ||
312 | 39 | self.launch_webcontainer_app_with_local_http_server( | ||
313 | 40 | args, | ||
314 | 41 | '/theme-color/?manifest=true') | ||
315 | 42 | self.get_webcontainer_window().visible.wait_for(True) | ||
316 | 43 | |||
317 | 44 | chrome_base = self.app.wait_select_single( | ||
318 | 45 | objectName="chromeBase") | ||
319 | 46 | |||
320 | 47 | self.assertThat( | ||
321 | 48 | lambda: str(chrome_base.backgroundColor), | ||
322 | 49 | Eventually(Equals("Color(255, 0, 0, 255)"))) |
FAILED: Continuous integration, rev:1295 jenkins. qa.ubuntu. com/job/ webbrowser- app-ci/ 2499/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- vivid-touch/ 5557 jenkins. qa.ubuntu. com/job/ webbrowser- app-vivid- amd64-ci/ 1253 jenkins. qa.ubuntu. com/job/ webbrowser- app-vivid- armhf-ci/ 1253 jenkins. qa.ubuntu. com/job/ webbrowser- app-vivid- armhf-ci/ 1253/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ webbrowser- app-vivid- i386-ci/ 1253 jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- runner- vivid-touch/ 4352 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- vivid-armhf/ 5571 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- vivid-armhf/ 5571/artifact/ work/output/ *zip*/output. zip s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 25732
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: s-jenkins. ubuntu- ci:8080/ job/webbrowser- app-ci/ 2499/rebuild
http://