Add a test for the error page workaround
This commit is contained in:
parent
a32d74e983
commit
4c147b77c1
@ -735,6 +735,7 @@ class WebEngineTab(browsertab.AbstractTab):
|
|||||||
|
|
||||||
def _show_error_page(self, url, error):
|
def _show_error_page(self, url, error):
|
||||||
"""Show an error page in the tab."""
|
"""Show an error page in the tab."""
|
||||||
|
log.misc.debug("Showing error page for {}".format(error))
|
||||||
url_string = url.toDisplayString()
|
url_string = url.toDisplayString()
|
||||||
error_page = jinja.render(
|
error_page = jinja.render(
|
||||||
'error.html',
|
'error.html',
|
||||||
|
@ -167,3 +167,9 @@ Feature: Javascript stuff
|
|||||||
And I wait for "[*] JavaScript is enabled" in the log
|
And I wait for "[*] JavaScript is enabled" in the log
|
||||||
And I open data/javascript/enabled.html
|
And I open data/javascript/enabled.html
|
||||||
Then the page should contain the plaintext "JavaScript is disabled"
|
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
|
||||||
|
@ -79,6 +79,7 @@ class Request(testprocess.Line):
|
|||||||
'/cookies/set': [http.client.FOUND],
|
'/cookies/set': [http.client.FOUND],
|
||||||
|
|
||||||
'/500-inline': [http.client.INTERNAL_SERVER_ERROR],
|
'/500-inline': [http.client.INTERNAL_SERVER_ERROR],
|
||||||
|
'/500': [http.client.INTERNAL_SERVER_ERROR],
|
||||||
}
|
}
|
||||||
for i in range(15):
|
for i in range(15):
|
||||||
path_to_statuses['/redirect/{}'.format(i)] = [http.client.FOUND]
|
path_to_statuses['/redirect/{}'.format(i)] = [http.client.FOUND]
|
||||||
|
@ -179,6 +179,14 @@ def internal_error_attachment():
|
|||||||
return response
|
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')
|
@app.route('/cookies')
|
||||||
def view_cookies():
|
def view_cookies():
|
||||||
"""Show cookies."""
|
"""Show cookies."""
|
||||||
|
Loading…
Reference in New Issue
Block a user