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): ...@@ -70,18 +70,23 @@ class LitePage(IntegrationTest):
lite_page_responses = lite_page_responses + 1 lite_page_responses = lite_page_responses + 1
self.assertEqual(1, lite_page_responses) self.assertEqual(1, lite_page_responses)
# Scroll to the bottom of the window and make sure there were more # Scroll to the bottom of the window and ensure scrollHeight increases.
# requests that were proxied. original_scroll_height = test_driver.ExecuteJavascriptStatement(
scroll_js = 'window.scrollTo(0,Math.max(document.body.scrollHeight));' 'document.body.scrollHeight')
test_driver.ExecuteJavascriptStatement(scroll_js) test_driver.ExecuteJavascriptStatement(
# Give some time for loading after each scroll. 'window.scrollTo(0,Math.max(document.body.scrollHeight));')
time.sleep(2) # Give some time for loading after scrolling.
test_driver.ExecuteJavascriptStatement(scroll_js)
time.sleep(2) 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) responses = test_driver.GetHTTPResponses(override_has_logs=True)
self.assertNotEqual(0, len(responses)) self.assertNotEqual(0, len(responses))
for response in responses: for response in responses:
self.assertHasChromeProxyViaHeader(response) self.assertHasChromeProxyViaHeader(response)
self.assertIn(response.status, [200, 204])
# Checks that Lo-Fi images are used when the user is in the # Checks that Lo-Fi images are used when the user is in the
# DataCompressionProxyLitePageFallback field trial and a Lite Page is not # 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