Add a test for the error page workaround

This commit is contained in:
Florian Bruhin 2018-02-25 16:35:02 +01:00
parent a32d74e983
commit 4c147b77c1
4 changed files with 16 additions and 0 deletions

View File

@ -735,6 +735,7 @@ class WebEngineTab(browsertab.AbstractTab):
def _show_error_page(self, url, error):
"""Show an error page in the tab."""
log.misc.debug("Showing error page for {}".format(error))
url_string = url.toDisplayString()
error_page = jinja.render(
'error.html',

View File

@ -167,3 +167,9 @@ Feature: Javascript stuff
And I wait for "[*] JavaScript is enabled" in the log
And I open data/javascript/enabled.html
Then the page should contain the plaintext "JavaScript is disabled"
@qtwebkit_skip
Scenario: Error pages without JS enabled
When I set content.javascript.enabled to false
And I open 500
Then "Showing error page for* 500" should be logged

View File

@ -79,6 +79,7 @@ class Request(testprocess.Line):
'/cookies/set': [http.client.FOUND],
'/500-inline': [http.client.INTERNAL_SERVER_ERROR],
'/500': [http.client.INTERNAL_SERVER_ERROR],
}
for i in range(15):
path_to_statuses['/redirect/{}'.format(i)] = [http.client.FOUND]

View File

@ -179,6 +179,14 @@ def internal_error_attachment():
return response
@app.route('/500')
def internal_error():
"""A normal 500 error."""
r = flask.make_response()
r.status_code = 500
return r
@app.route('/cookies')
def view_cookies():
"""Show cookies."""