Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: tools/chrome_proxy/webdriver/lite_page.py

Issue 2844403002: Add 404 check to BTF Litepage test (Closed)
Patch Set: Add Tom's scrollHeight check Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/chrome_proxy/webdriver/lite_page.py
diff --git a/tools/chrome_proxy/webdriver/lite_page.py b/tools/chrome_proxy/webdriver/lite_page.py
index a9219e3525ff602f4a725d3405493557eb990409..b8304d1ac9c77b86c3d958351f56dc22e9052829 100644
--- a/tools/chrome_proxy/webdriver/lite_page.py
+++ b/tools/chrome_proxy/webdriver/lite_page.py
@@ -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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698