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

Unified Diff: tools/telemetry/telemetry/page/actions/scroll_unittest.py

Issue 25541005: Telemetry: document.documentElement.scrollTop/Left is zero (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 2 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/telemetry/telemetry/page/actions/scroll_unittest.py
diff --git a/tools/telemetry/telemetry/page/actions/scroll_unittest.py b/tools/telemetry/telemetry/page/actions/scroll_unittest.py
index d57926e57cf3613ade9d8ebdc3e4ac7ec9b4d11f..e67463c7bf4da7315882919bd39aa55414c7c5ef 100644
--- a/tools/telemetry/telemetry/page/actions/scroll_unittest.py
+++ b/tools/telemetry/telemetry/page/actions/scroll_unittest.py
@@ -37,7 +37,8 @@ class ScrollActionTest(tab_test_case.TabTestCase):
(2 * window.innerHeight + 1) + 'px';""")
self.assertEquals(
- self._tab.EvaluateJavaScript('document.body.scrollTop'), 0)
+ self._tab.EvaluateJavaScript("""document.documentElement.scrollTop
+ || document.body.scrollTop"""), 0)
i = scroll.ScrollAction()
i.WillRunAction(page, self._tab)
@@ -56,7 +57,8 @@ class ScrollActionTest(tab_test_case.TabTestCase):
# Allow for roundoff error in scaled viewport.
scroll_position = self._tab.EvaluateJavaScript(
- 'document.body.scrollTop + window.innerHeight')
+ """(document.documentElement.scrollTop || document.body.scrollTop)
+ + window.innerHeight""")
scroll_height = self._tab.EvaluateJavaScript('document.body.scrollHeight')
difference = scroll_position - scroll_height
self.assertTrue(abs(difference) <= 1)
« 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