Bug 1508398 [wpt PR 14130] - Updating WebDriver scroll into view tests to support older user agents, a=testonly
authorjimevans <james.h.evans.jr@gmail.com>
Thu, 22 Nov 2018 10:34:35 +0000
changeset 504353 c3369eff0b340736674c3e7747e97443e5831c58
parent 504352 a10a77ee35afb76664e632f7847f8b295e2db241
child 504354 59c8ec95baa39ba312681c2840f00e9194c6e3b2
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1508398, 14130
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1508398 [wpt PR 14130] - Updating WebDriver scroll into view tests to support older user agents, a=testonly Automatic update from web-platform-testswebdriver: update scroll into view tests to support older user agents (#14130) Removing the use of ES6 constructs (fat-arrow and object shortcut syntax) as well as adding use of alternatives for user agents that do not support window.scrollX and window.scrollY. -- wpt-commits: fcef20974685c994c830a23eae88906449fe93f7 wpt-pr: 14130
testing/web-platform/tests/webdriver/tests/element_click/scroll_into_view.py
--- a/testing/web-platform/tests/webdriver/tests/element_click/scroll_into_view.py
+++ b/testing/web-platform/tests/webdriver/tests/element_click/scroll_into_view.py
@@ -55,19 +55,18 @@ def test_partially_visible_does_not_scro
         }}
         </style>
 
         <div></div>
 
         <script>
         window.clicks = [];
         let target = document.querySelector("div");
-        target.addEventListener("click", ({{clientX, clientY}}) => window.clicks.push([clientX, clientY]));
+        target.addEventListener("click", function(e) {{ window.clicks.push([e.clientX, e.clientY]); }});
         </script>
         """.format(offset=offset))
     target = session.find.css("div", all=False)
-    assert session.execute_script("return window.scrollY") == 0
-
+    assert session.execute_script("return window.scrollY || document.documentElement.scrollTop") == 0
     response = element_click(session, target)
     assert_success(response)
-    assert session.execute_script("return window.scrollY") == 0
+    assert session.execute_script("return window.scrollY || document.documentElement.scrollTop") == 0
     click_point = assert_one_click(session)
     assert click_point == center_point(target)