Commit 0a505cbe authored by robertogden's avatar robertogden Committed by Commit bot

Add 404 check to BTF Litepage test

Using a local proxy instance with the associated bug, the failed
response gave a 404 status. This check differentiates between the bug
and not.

BUG=715644

Review-Url: https://codereview.chromium.org/2844403002
Cr-Commit-Position: refs/heads/master@{#468106}
parent 42f79db5
......@@ -70,18 +70,23 @@ class LitePage(IntegrationTest):
lite_page_responses = lite_page_responses + 1
self.assertEqual(1, lite_page_responses)
# Scroll to the bottom of the window and make sure there were more
# requests that were proxied.
scroll_js = 'window.scrollTo(0,Math.max(document.body.scrollHeight));'
test_driver.ExecuteJavascriptStatement(scroll_js)
# Give some time for loading after each scroll.
time.sleep(2)
test_driver.ExecuteJavascriptStatement(scroll_js)
# Scroll to the bottom of the window and ensure scrollHeight increases.
original_scroll_height = test_driver.ExecuteJavascriptStatement(
'document.body.scrollHeight')
test_driver.ExecuteJavascriptStatement(
'window.scrollTo(0,Math.max(document.body.scrollHeight));')
# Give some time for loading after scrolling.
time.sleep(2)
new_scroll_height = test_driver.ExecuteJavascriptStatement(
'document.body.scrollHeight')
self.assertGreater(new_scroll_height, original_scroll_height)
# Make sure there were more requests that were proxied.
responses = test_driver.GetHTTPResponses(override_has_logs=True)
self.assertNotEqual(0, len(responses))
for response in responses:
self.assertHasChromeProxyViaHeader(response)
self.assertIn(response.status, [200, 204])
# Checks that Lo-Fi images are used when the user is in the
# DataCompressionProxyLitePageFallback field trial and a Lite Page is not
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment