Merge lp:~abreu-alexandre/webbrowser-app/handle-webapp-renderer-crash into lp:webbrowser-app
- handle-webapp-renderer-crash
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Olivier Tilloy |
Approved revision: | 1215 |
Merged at revision: | 1217 |
Proposed branch: | lp:~abreu-alexandre/webbrowser-app/handle-webapp-renderer-crash |
Merge into: | lp:webbrowser-app |
Diff against target: |
434 lines (+291/-22) 6 files modified
src/app/webcontainer/CMakeLists.txt (+4/-0) src/app/webcontainer/PopupWindowOverlay.qml (+17/-1) src/app/webcontainer/SadPage.qml (+56/-0) src/app/webcontainer/WebApp.qml (+41/-21) tests/autopilot/webapp_container/tests/__init__.py (+11/-0) tests/autopilot/webapp_container/tests/test_sad_tab.py (+162/-0) |
To merge this branch: | bzr merge lp:~abreu-alexandre/webbrowser-app/handle-webapp-renderer-crash |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Needs Fixing | |
Olivier Tilloy | Approve | ||
Review via email: mp+271865@code.launchpad.net |
Commit message
Handle webapp webview renderer crashes
Description of the change
Handle webapp webview renderer crashes
PS Jenkins bot (ps-jenkins) wrote : | # |
Olivier Tilloy (osomon) wrote : | # |
Has this been signed off by the design team? I mentioned to them last week that you were going to implement something similar to what exists in the browser for the webapp container, and they agreed that the wording might require some tweaking. The mention of "tabs" in the default sad tab message that is used for the browser might be misleading in the context of the webapp container, especially if no overlay is currently being displayed.
One tiny remark: the SadTab autopilot proxy object should be defined in test_sad_tab.py, since it’s not used anywhere else.
Other than that, this looks good to me and seems to work well.
Alexandre Abreu (abreu-alexandre) wrote : | # |
> One tiny remark: the SadTab autopilot proxy object should be defined in
> test_sad_tab.py, since it’s not used anywhere else.
updated
> Other than that, this looks good to me and seems to work well.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1189
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 1199. By CI Train Bot Account
-
Resync trunk.
- 1200. By Olivier Tilloy
-
Update translation template.
Alexandre Abreu (abreu-alexandre) wrote : | # |
I updated the UI (and obviously the rest) to simplify it and remove the user message so that it can land in OTA-7. Once it lands I'll create a ubuntu-ux task to verify and tweak that behavior (with a more meaningful message),
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1190
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 1201. By Launchpad Translations on behalf of phablet-team
-
Launchpad automatic translations update.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1191
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1192
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 1202. By Launchpad Translations on behalf of phablet-team
-
Launchpad automatic translations update.
- 1203. By Launchpad Translations on behalf of phablet-team
-
Launchpad automatic translations update.
- 1204. By Launchpad Translations on behalf of phablet-team
-
Launchpad automatic translations update.
- 1205. By Launchpad Translations on behalf of phablet-team
-
Launchpad automatic translations update.
- 1206. By Michael Sheldon
-
Add support for alternative mimetype header for vcards Fixes: #1498992
Approved by: Olivier Tilloy - 1207. By Ugo Riboni
-
Add a context menu to each tab in the tab bar, allowing to insert a new tab just after, close or reload the current tab.
Approved by: Riccardo Padovani - 1208. By Olivier Tilloy
-
Fix a couple of autopilot test failures on desktop. Fixes: #1495297, #1499411
- 1209. By CI Train Bot Account
-
Releasing 0.23+15.
10.20150928- 0ubuntu1 - 1210. By CI Train Bot Account
-
Resync trunk.
Olivier Tilloy (osomon) wrote : | # |
Let’s discuss this proposed implementation at our weekly catchup with design later today.
A side note: "SadWebview.qml" is a confusing name, given that it’s not a webview.
- 1211. By Ugo Riboni
-
Extend the clickable area to close a tab on mobile, as taps are less precise and often end up missing it. Fixes: #1500339
Approved by: Olivier Tilloy - 1212. By Olivier Tilloy
-
Use the UA override for www.youtube.com on mobile too. Fixes: #1499394
Approved by: Alexandre Abreu, David Barth - 1213. By CI Train Bot Account
-
Releasing 0.23+15.
10.20150929- 0ubuntu1
Alexandre Abreu (abreu-alexandre) wrote : | # |
Updated according to design's comment; also changed the SadWebview qml name
- 1214. By Alexandre Abreu
-
Handle renderer crash in webapp container
- 1215. By Alexandre Abreu
-
remove uneeded signal
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1193
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === modified file 'src/app/webcontainer/CMakeLists.txt' | |||
2 | --- src/app/webcontainer/CMakeLists.txt 2015-07-20 14:20:37 +0000 | |||
3 | +++ src/app/webcontainer/CMakeLists.txt 2015-09-29 20:15:01 +0000 | |||
4 | @@ -44,3 +44,7 @@ | |||
5 | 44 | install(FILES ${QML_FILES} DESTINATION ${CMAKE_INSTALL_DATADIR}/webbrowser-app/webcontainer) | 44 | install(FILES ${QML_FILES} DESTINATION ${CMAKE_INSTALL_DATADIR}/webbrowser-app/webcontainer) |
6 | 45 | install(DIRECTORY actions DESTINATION ${CMAKE_INSTALL_DATADIR}/webbrowser-app/webcontainer | 45 | install(DIRECTORY actions DESTINATION ${CMAKE_INSTALL_DATADIR}/webbrowser-app/webcontainer |
7 | 46 | FILES_MATCHING PATTERN *.qml) | 46 | FILES_MATCHING PATTERN *.qml) |
8 | 47 | |||
9 | 48 | install(DIRECTORY assets | ||
10 | 49 | DESTINATION ${CMAKE_INSTALL_DATADIR}/webbrowser-app/webcontainer | ||
11 | 50 | FILES_MATCHING PATTERN *.png) | ||
12 | 47 | 51 | ||
13 | === modified file 'src/app/webcontainer/PopupWindowOverlay.qml' | |||
14 | --- src/app/webcontainer/PopupWindowOverlay.qml 2015-08-10 15:33:43 +0000 | |||
15 | +++ src/app/webcontainer/PopupWindowOverlay.qml 2015-09-29 20:15:01 +0000 | |||
16 | @@ -27,6 +27,7 @@ | |||
17 | 27 | 27 | ||
18 | 28 | property var popupWindowController | 28 | property var popupWindowController |
19 | 29 | property var webContext | 29 | property var webContext |
20 | 30 | property alias currentWebview: popupWebview | ||
21 | 30 | property alias request: popupWebview.request | 31 | property alias request: popupWebview.request |
22 | 31 | property alias url: popupWebview.url | 32 | property alias url: popupWebview.url |
23 | 32 | 33 | ||
24 | @@ -194,6 +195,21 @@ | |||
25 | 194 | popupWindowController.handleViewRemoved(popup) | 195 | popupWindowController.handleViewRemoved(popup) |
26 | 195 | } | 196 | } |
27 | 196 | } | 197 | } |
28 | 198 | |||
29 | 199 | Loader { | ||
30 | 200 | anchors { | ||
31 | 201 | fill: popupWebview | ||
32 | 202 | } | ||
33 | 203 | active: webProcessMonitor.crashed || (webProcessMonitor.killed && !popupWebview.currentWebview.loading) | ||
34 | 204 | sourceComponent: SadPage { | ||
35 | 205 | webview: popupWebview | ||
36 | 206 | objectName: "overlaySadPage" | ||
37 | 207 | } | ||
38 | 208 | WebProcessMonitor { | ||
39 | 209 | id: webProcessMonitor | ||
40 | 210 | webview: popupWebview | ||
41 | 211 | } | ||
42 | 212 | asynchronous: true | ||
43 | 213 | } | ||
44 | 197 | } | 214 | } |
45 | 198 | |||
46 | 199 | } | 215 | } |
47 | 200 | 216 | ||
48 | === added file 'src/app/webcontainer/SadPage.qml' | |||
49 | --- src/app/webcontainer/SadPage.qml 1970-01-01 00:00:00 +0000 | |||
50 | +++ src/app/webcontainer/SadPage.qml 2015-09-29 20:15:01 +0000 | |||
51 | @@ -0,0 +1,56 @@ | |||
52 | 1 | /* | ||
53 | 2 | * Copyright 2015 Canonical Ltd. | ||
54 | 3 | * | ||
55 | 4 | * This file is part of webbrowser-app. | ||
56 | 5 | * | ||
57 | 6 | * webbrowser-app is free software; you can redistribute it and/or modify | ||
58 | 7 | * it under the terms of the GNU General Public License as published by | ||
59 | 8 | * the Free Software Foundation; version 3. | ||
60 | 9 | * | ||
61 | 10 | * webbrowser-app is distributed in the hope that it will be useful, | ||
62 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
63 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
64 | 13 | * GNU General Public License for more details. | ||
65 | 14 | * | ||
66 | 15 | * You should have received a copy of the GNU General Public License | ||
67 | 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
68 | 17 | */ | ||
69 | 18 | |||
70 | 19 | import QtQuick 2.4 | ||
71 | 20 | import Ubuntu.Components 1.3 | ||
72 | 21 | |||
73 | 22 | Rectangle { | ||
74 | 23 | property var webview | ||
75 | 24 | |||
76 | 25 | Column { | ||
77 | 26 | anchors { | ||
78 | 27 | fill: parent | ||
79 | 28 | margins: units.gu(4) | ||
80 | 29 | } | ||
81 | 30 | spacing: units.gu(4) | ||
82 | 31 | |||
83 | 32 | Image { | ||
84 | 33 | anchors.horizontalCenter: parent.horizontalCenter | ||
85 | 34 | source: "assets/tab-error.png" | ||
86 | 35 | } | ||
87 | 36 | |||
88 | 37 | Label { | ||
89 | 38 | anchors { | ||
90 | 39 | left: parent.left | ||
91 | 40 | right: parent.right | ||
92 | 41 | } | ||
93 | 42 | |||
94 | 43 | wrapMode: Text.Wrap | ||
95 | 44 | horizontalAlignment: Text.AlignHCenter | ||
96 | 45 | text: webview ? i18n.tr("Oops, something went wrong.") : "" | ||
97 | 46 | } | ||
98 | 47 | |||
99 | 48 | Button { | ||
100 | 49 | anchors.horizontalCenter: parent.horizontalCenter | ||
101 | 50 | objectName: "reloadButton" | ||
102 | 51 | text: i18n.tr("Reload") | ||
103 | 52 | color: UbuntuColors.green | ||
104 | 53 | onClicked: webview.reload() | ||
105 | 54 | } | ||
106 | 55 | } | ||
107 | 56 | } | ||
108 | 0 | 57 | ||
109 | === modified file 'src/app/webcontainer/WebApp.qml' | |||
110 | --- src/app/webcontainer/WebApp.qml 2015-08-18 14:18:37 +0000 | |||
111 | +++ src/app/webcontainer/WebApp.qml 2015-09-29 20:15:01 +0000 | |||
112 | @@ -29,21 +29,21 @@ | |||
113 | 29 | id: webapp | 29 | id: webapp |
114 | 30 | objectName: "webappBrowserView" | 30 | objectName: "webappBrowserView" |
115 | 31 | 31 | ||
117 | 32 | currentWebview: webview.currentWebview | 32 | currentWebview: containerWebView.currentWebview |
118 | 33 | 33 | ||
120 | 34 | property alias url: webview.url | 34 | property alias url: containerWebView.url |
121 | 35 | 35 | ||
122 | 36 | property bool accountSwitcher | 36 | property bool accountSwitcher |
123 | 37 | 37 | ||
124 | 38 | property string webappModelSearchPath: "" | 38 | property string webappModelSearchPath: "" |
125 | 39 | 39 | ||
126 | 40 | property var webappUrlPatterns | 40 | property var webappUrlPatterns |
133 | 41 | property alias popupRedirectionUrlPrefixPattern: webview.popupRedirectionUrlPrefixPattern | 41 | property alias popupRedirectionUrlPrefixPattern: containerWebView.popupRedirectionUrlPrefixPattern |
134 | 42 | property alias webviewOverrideFile: webview.webviewOverrideFile | 42 | property alias webviewOverrideFile: containerWebView.webviewOverrideFile |
135 | 43 | property alias blockOpenExternalUrls: webview.blockOpenExternalUrls | 43 | property alias blockOpenExternalUrls: containerWebView.blockOpenExternalUrls |
136 | 44 | property alias localUserAgentOverride: webview.localUserAgentOverride | 44 | property alias localUserAgentOverride: containerWebView.localUserAgentOverride |
137 | 45 | property alias dataPath: webview.dataPath | 45 | property alias dataPath: containerWebView.dataPath |
138 | 46 | property alias runningLocalApplication: webview.runningLocalApplication | 46 | property alias runningLocalApplication: containerWebView.runningLocalApplication |
139 | 47 | 47 | ||
140 | 48 | property string webappName: "" | 48 | property string webappName: "" |
141 | 49 | 49 | ||
142 | @@ -60,15 +60,15 @@ | |||
143 | 60 | 60 | ||
144 | 61 | actions: [ | 61 | actions: [ |
145 | 62 | Actions.Back { | 62 | Actions.Back { |
148 | 63 | enabled: webapp.backForwardButtonsVisible && webview.currentWebview && webview.currentWebview.canGoBack | 63 | enabled: webapp.backForwardButtonsVisible && containerWebView.currentWebview && containerWebView.currentWebview.canGoBack |
149 | 64 | onTriggered: webview.currentWebview.goBack() | 64 | onTriggered: containerWebView.currentWebview.goBack() |
150 | 65 | }, | 65 | }, |
151 | 66 | Actions.Forward { | 66 | Actions.Forward { |
154 | 67 | enabled: webapp.backForwardButtonsVisible && webview.currentWebview && webview.currentWebview.canGoForward | 67 | enabled: webapp.backForwardButtonsVisible && containerWebView.currentWebview && containerWebView.currentWebview.canGoForward |
155 | 68 | onTriggered: webview.currentWebview.goForward() | 68 | onTriggered: containerWebView.currentWebview.goForward() |
156 | 69 | }, | 69 | }, |
157 | 70 | Actions.Reload { | 70 | Actions.Reload { |
159 | 71 | onTriggered: webview.currentWebview.reload() | 71 | onTriggered: containerWebView.currentWebview.reload() |
160 | 72 | } | 72 | } |
161 | 73 | ] | 73 | ] |
162 | 74 | 74 | ||
163 | @@ -121,7 +121,7 @@ | |||
164 | 121 | anchors.fill: parent | 121 | anchors.fill: parent |
165 | 122 | 122 | ||
166 | 123 | WebappContainerWebview { | 123 | WebappContainerWebview { |
168 | 124 | id: webview | 124 | id: containerWebView |
169 | 125 | objectName: "webview" | 125 | objectName: "webview" |
170 | 126 | 126 | ||
171 | 127 | anchors { | 127 | anchors { |
172 | @@ -144,19 +144,39 @@ | |||
173 | 144 | * being explictly defined here. | 144 | * being explictly defined here. |
174 | 145 | */ | 145 | */ |
175 | 146 | webappName: webapp.webappName === "" ? unityWebapps.name : webapp.webappName | 146 | webappName: webapp.webappName === "" ? unityWebapps.name : webapp.webappName |
176 | 147 | |||
177 | 148 | Loader { | ||
178 | 149 | anchors { | ||
179 | 150 | fill: containerWebView | ||
180 | 151 | topMargin: (!webapp.chromeless && chromeLoader.item.state == "shown") | ||
181 | 152 | ? chromeLoader.item.height | ||
182 | 153 | : 0 | ||
183 | 154 | } | ||
184 | 155 | active: containerWebView.currentWebview && | ||
185 | 156 | (webProcessMonitor.crashed || (webProcessMonitor.killed && !containerWebView.currentWebview.loading)) | ||
186 | 157 | sourceComponent: SadPage { | ||
187 | 158 | webview: containerWebView.currentWebview | ||
188 | 159 | objectName: "mainWebviewSadPage" | ||
189 | 160 | } | ||
190 | 161 | WebProcessMonitor { | ||
191 | 162 | id: webProcessMonitor | ||
192 | 163 | webview: containerWebView.currentWebview | ||
193 | 164 | } | ||
194 | 165 | asynchronous: true | ||
195 | 166 | } | ||
196 | 147 | } | 167 | } |
197 | 148 | 168 | ||
198 | 149 | Loader { | 169 | Loader { |
199 | 150 | anchors { | 170 | anchors { |
201 | 151 | fill: webview | 171 | fill: containerWebView |
202 | 152 | topMargin: (!webapp.chromeless && chromeLoader.item.state == "shown") ? chromeLoader.item.height : 0 | 172 | topMargin: (!webapp.chromeless && chromeLoader.item.state == "shown") ? chromeLoader.item.height : 0 |
203 | 153 | } | 173 | } |
204 | 154 | sourceComponent: ErrorSheet { | 174 | sourceComponent: ErrorSheet { |
207 | 155 | visible: webview.currentWebview && webview.currentWebview.lastLoadFailed | 175 | visible: containerWebView.currentWebview && containerWebView.currentWebview.lastLoadFailed |
208 | 156 | url: webview.currentWebview ? webview.currentWebview.url : "" | 176 | url: containerWebView.currentWebview ? containerWebView.currentWebview.url : "" |
209 | 157 | onRefreshClicked: { | 177 | onRefreshClicked: { |
212 | 158 | if (webview.currentWebview) | 178 | if (containerWebView.currentWebview) |
213 | 159 | webview.currentWebview.reload() | 179 | containerWebView.currentWebview.reload() |
214 | 160 | } | 180 | } |
215 | 161 | } | 181 | } |
216 | 162 | asynchronous: true | 182 | asynchronous: true |
217 | @@ -186,7 +206,7 @@ | |||
218 | 186 | right: parent.right | 206 | right: parent.right |
219 | 187 | } | 207 | } |
220 | 188 | height: units.gu(6) | 208 | height: units.gu(6) |
222 | 189 | y: webapp.currentWebview ? webview.currentWebview.locationBarController.offset : 0 | 209 | y: webapp.currentWebview ? containerWebView.currentWebview.locationBarController.offset : 0 |
223 | 190 | 210 | ||
224 | 191 | onChooseAccount: webapp.chooseAccount() | 211 | onChooseAccount: webapp.chooseAccount() |
225 | 192 | } | 212 | } |
226 | @@ -225,7 +245,7 @@ | |||
227 | 225 | UnityWebApps.UnityWebApps { | 245 | UnityWebApps.UnityWebApps { |
228 | 226 | id: unityWebapps | 246 | id: unityWebapps |
229 | 227 | name: webappName | 247 | name: webappName |
231 | 228 | bindee: webview.currentWebview | 248 | bindee: containerWebView.currentWebview |
232 | 229 | actionsContext: actionManager.globalContext | 249 | actionsContext: actionManager.globalContext |
233 | 230 | model: UnityWebApps.UnityWebappsAppModel { searchPath: webappModelSearchPath } | 250 | model: UnityWebApps.UnityWebappsAppModel { searchPath: webappModelSearchPath } |
234 | 231 | injectExtraUbuntuApis: runningLocalApplication | 251 | injectExtraUbuntuApis: runningLocalApplication |
235 | 232 | 252 | ||
236 | === added directory 'src/app/webcontainer/assets' | |||
237 | === added file 'src/app/webcontainer/assets/tab-error@27.png' | |||
238 | 233 | Binary files src/app/webcontainer/assets/tab-error@27.png 1970-01-01 00:00:00 +0000 and src/app/webcontainer/assets/tab-error@27.png 2015-09-29 20:15:01 +0000 differ | 253 | Binary files src/app/webcontainer/assets/tab-error@27.png 1970-01-01 00:00:00 +0000 and src/app/webcontainer/assets/tab-error@27.png 2015-09-29 20:15:01 +0000 differ |
239 | === modified file 'tests/autopilot/webapp_container/tests/__init__.py' | |||
240 | --- tests/autopilot/webapp_container/tests/__init__.py 2015-07-28 19:29:58 +0000 | |||
241 | +++ tests/autopilot/webapp_container/tests/__init__.py 2015-09-29 20:15:01 +0000 | |||
242 | @@ -16,7 +16,9 @@ | |||
243 | 16 | """ Autopilot tests for the webapp_container package """ | 16 | """ Autopilot tests for the webapp_container package """ |
244 | 17 | 17 | ||
245 | 18 | import os | 18 | import os |
246 | 19 | import signal | ||
247 | 19 | import subprocess | 20 | import subprocess |
248 | 21 | import psutil | ||
249 | 20 | 22 | ||
250 | 21 | import fixtures | 23 | import fixtures |
251 | 22 | from autopilot.testcase import AutopilotTestCase | 24 | from autopilot.testcase import AutopilotTestCase |
252 | @@ -120,6 +122,15 @@ | |||
253 | 120 | webview.url = url | 122 | webview.url = url |
254 | 121 | self.assert_page_eventually_loaded(url) | 123 | self.assert_page_eventually_loaded(url) |
255 | 122 | 124 | ||
256 | 125 | def kill_web_processes(self, signal=signal.SIGKILL): | ||
257 | 126 | children = psutil.Process(self.app.pid).children(True) | ||
258 | 127 | for child in children: | ||
259 | 128 | if child.name() == 'oxide-renderer': | ||
260 | 129 | for arg in child.cmdline(): | ||
261 | 130 | if '--type=renderer' in arg: | ||
262 | 131 | os.kill(child.pid, signal) | ||
263 | 132 | break | ||
264 | 133 | |||
265 | 123 | 134 | ||
266 | 124 | class WebappContainerTestCaseWithLocalContentBase(WebappContainerTestCaseBase): | 135 | class WebappContainerTestCaseWithLocalContentBase(WebappContainerTestCaseBase): |
267 | 125 | BASE_URL_SCHEME = 'http://' | 136 | BASE_URL_SCHEME = 'http://' |
268 | 126 | 137 | ||
269 | === added file 'tests/autopilot/webapp_container/tests/test_sad_tab.py' | |||
270 | --- tests/autopilot/webapp_container/tests/test_sad_tab.py 1970-01-01 00:00:00 +0000 | |||
271 | +++ tests/autopilot/webapp_container/tests/test_sad_tab.py 2015-09-29 20:15:01 +0000 | |||
272 | @@ -0,0 +1,162 @@ | |||
273 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | ||
274 | 2 | # Copyright 2015 Canonical | ||
275 | 3 | # | ||
276 | 4 | # This program is free software: you can redistribute it and/or modify it | ||
277 | 5 | # under the terms of the GNU General Public License version 3, as published | ||
278 | 6 | # by the Free Software Foundation. | ||
279 | 7 | # | ||
280 | 8 | # This program is distributed in the hope that it will be useful, | ||
281 | 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
282 | 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
283 | 11 | # GNU General Public License for more details. | ||
284 | 12 | # | ||
285 | 13 | # You should have received a copy of the GNU General Public License | ||
286 | 14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
287 | 15 | |||
288 | 16 | import signal | ||
289 | 17 | import time | ||
290 | 18 | |||
291 | 19 | from webapp_container.tests import WebappContainerTestCaseWithLocalContentBase | ||
292 | 20 | |||
293 | 21 | from testtools.matchers import Equals, Contains, GreaterThan | ||
294 | 22 | from autopilot.matchers import Eventually | ||
295 | 23 | |||
296 | 24 | import ubuntuuitoolkit as uitk | ||
297 | 25 | |||
298 | 26 | |||
299 | 27 | class SadPage(uitk.UbuntuUIToolkitCustomProxyObjectBase): | ||
300 | 28 | def click_reload_button(self): | ||
301 | 29 | button = self.select_single("Button", objectName="reloadButton") | ||
302 | 30 | self.pointing_device.click_object(button) | ||
303 | 31 | |||
304 | 32 | |||
305 | 33 | class TestSadTab(WebappContainerTestCaseWithLocalContentBase): | ||
306 | 34 | def _kill_web_process(self): | ||
307 | 35 | self.kill_web_processes() | ||
308 | 36 | time.sleep(1) | ||
309 | 37 | self.assert_page_eventually_loaded(self.url) | ||
310 | 38 | |||
311 | 39 | self.kill_web_processes() | ||
312 | 40 | |||
313 | 41 | def _click_href_target_blank(self): | ||
314 | 42 | webview = self.get_oxide_webview() | ||
315 | 43 | self.assertThat(webview.url, Contains('/open-close-content')) | ||
316 | 44 | gr = webview.globalRect | ||
317 | 45 | self.pointing_device.move( | ||
318 | 46 | gr.x + gr.width/4, | ||
319 | 47 | gr.y + gr.height/4) | ||
320 | 48 | self.pointing_device.click() | ||
321 | 49 | |||
322 | 50 | def _click_overlay(self): | ||
323 | 51 | popup_controller = self.get_popup_controller() | ||
324 | 52 | new_view_watcher = popup_controller.watch_signal( | ||
325 | 53 | 'newViewCreated(QString)') | ||
326 | 54 | animation_watcher = popup_controller.watch_signal( | ||
327 | 55 | 'windowOverlayOpenAnimationDone()') | ||
328 | 56 | animation_signal_emission = animation_watcher.num_emissions | ||
329 | 57 | |||
330 | 58 | views = self.get_popup_overlay_views() | ||
331 | 59 | self.assertThat(len(views), Equals(0)) | ||
332 | 60 | |||
333 | 61 | self._click_href_target_blank() | ||
334 | 62 | |||
335 | 63 | self.assertThat( | ||
336 | 64 | lambda: new_view_watcher.was_emitted, | ||
337 | 65 | Eventually(Equals(True))) | ||
338 | 66 | self.assertThat( | ||
339 | 67 | lambda: len(self.get_popup_overlay_views()), | ||
340 | 68 | Eventually(Equals(1))) | ||
341 | 69 | views = self.get_popup_overlay_views() | ||
342 | 70 | overlay = views[0] | ||
343 | 71 | self.assertThat( | ||
344 | 72 | overlay.select_single(objectName="overlayWebview").url, | ||
345 | 73 | Contains('/open-close-content')) | ||
346 | 74 | |||
347 | 75 | self.assertThat( | ||
348 | 76 | lambda: animation_watcher.num_emissions, | ||
349 | 77 | Eventually(GreaterThan(animation_signal_emission))) | ||
350 | 78 | |||
351 | 79 | def test_reload_main_webview_killed(self): | ||
352 | 80 | self.launch_webcontainer_app_with_local_http_server([]) | ||
353 | 81 | self.get_webcontainer_window().visible.wait_for(True) | ||
354 | 82 | |||
355 | 83 | self._kill_web_process() | ||
356 | 84 | |||
357 | 85 | sad_webview = self.app.wait_select_single( | ||
358 | 86 | SadPage, | ||
359 | 87 | objectName="mainWebviewSadPage") | ||
360 | 88 | sad_webview.click_reload_button() | ||
361 | 89 | sad_webview.wait_until_destroyed() | ||
362 | 90 | |||
363 | 91 | self.assert_page_eventually_loaded(self.url) | ||
364 | 92 | |||
365 | 93 | def test_reload_overlay_killed(self): | ||
366 | 94 | args = [] | ||
367 | 95 | self.launch_webcontainer_app_with_local_http_server( | ||
368 | 96 | args, | ||
369 | 97 | '/open-close-content') | ||
370 | 98 | self.get_webcontainer_window().visible.wait_for(True) | ||
371 | 99 | |||
372 | 100 | self._click_overlay() | ||
373 | 101 | |||
374 | 102 | self._kill_web_process() | ||
375 | 103 | |||
376 | 104 | sad_webview = self.app.wait_select_single( | ||
377 | 105 | SadPage, | ||
378 | 106 | objectName="overlaySadPage") | ||
379 | 107 | |||
380 | 108 | sad_webview.click_reload_button() | ||
381 | 109 | sad_webview.wait_until_destroyed() | ||
382 | 110 | |||
383 | 111 | views = self.get_popup_overlay_views() | ||
384 | 112 | overlay = views[0] | ||
385 | 113 | self.assertThat( | ||
386 | 114 | lambda: overlay.wait_select_single( | ||
387 | 115 | objectName="overlayWebview").url, | ||
388 | 116 | Eventually(Contains('/open-close-content'))) | ||
389 | 117 | |||
390 | 118 | def _crash_web_process(self): | ||
391 | 119 | self.kill_web_processes(signal.SIGABRT) | ||
392 | 120 | |||
393 | 121 | def test_reload_main_webview_crashed(self): | ||
394 | 122 | self.launch_webcontainer_app_with_local_http_server([]) | ||
395 | 123 | self.get_webcontainer_window().visible.wait_for(True) | ||
396 | 124 | |||
397 | 125 | self._crash_web_process() | ||
398 | 126 | |||
399 | 127 | sad_webview = self.app.wait_select_single( | ||
400 | 128 | SadPage, | ||
401 | 129 | objectName="mainWebviewSadPage") | ||
402 | 130 | |||
403 | 131 | sad_webview.click_reload_button() | ||
404 | 132 | sad_webview.wait_until_destroyed() | ||
405 | 133 | |||
406 | 134 | self.assert_page_eventually_loaded(self.url) | ||
407 | 135 | |||
408 | 136 | def test_reload_overlay_crashed(self): | ||
409 | 137 | args = [] | ||
410 | 138 | self.launch_webcontainer_app_with_local_http_server( | ||
411 | 139 | args, | ||
412 | 140 | '/open-close-content') | ||
413 | 141 | self.get_webcontainer_window().visible.wait_for(True) | ||
414 | 142 | |||
415 | 143 | self._click_overlay() | ||
416 | 144 | self.assertThat( | ||
417 | 145 | lambda: len(self.get_popup_overlay_views()), | ||
418 | 146 | Eventually(Equals(1))) | ||
419 | 147 | |||
420 | 148 | self._crash_web_process() | ||
421 | 149 | |||
422 | 150 | sad_webview = self.app.wait_select_single( | ||
423 | 151 | SadPage, | ||
424 | 152 | objectName="overlaySadPage") | ||
425 | 153 | |||
426 | 154 | sad_webview.click_reload_button() | ||
427 | 155 | sad_webview.wait_until_destroyed() | ||
428 | 156 | |||
429 | 157 | views = self.get_popup_overlay_views() | ||
430 | 158 | overlay = views[0] | ||
431 | 159 | self.assertThat( | ||
432 | 160 | lambda: overlay.wait_select_single( | ||
433 | 161 | objectName="overlayWebview").url, | ||
434 | 162 | Eventually(Contains('/open-close-content'))) |
FAILED: Continuous integration, rev:1188 jenkins. qa.ubuntu. com/job/ webbrowser- app-ci/ 2268/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- vivid-touch/ 4309 jenkins. qa.ubuntu. com/job/ webbrowser- app-vivid- amd64-ci/ 1022/console jenkins. qa.ubuntu. com/job/ webbrowser- app-vivid- armhf-ci/ 1022 jenkins. qa.ubuntu. com/job/ webbrowser- app-vivid- armhf-ci/ 1022/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ webbrowser- app-vivid- i386-ci/ 1022/console jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- runner- vivid-mako/ 3511 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- vivid-armhf/ 4306 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- vivid-armhf/ 4306/artifact/ work/output/ *zip*/output. zip s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 23572
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/webbrowser- app-ci/ 2268/rebuild
http://