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) |