Backed out changeset 342f897311bc (bug 1353895)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Sat, 01 Jul 2017 16:24:49 +0200
changeset 603167 804f1cf08df72c13129a91ac3a89fe1a63604405
parent 603166 281a72862b4883a67b3c0370d12100ac8396707c
child 603168 8524b10375901e81113cb0b69e2b7066c43be5a0
push id66676
push userdgottwald@mozilla.com
push dateSun, 02 Jul 2017 09:54:00 +0000
bugs1353895
milestone56.0a1
backs out342f897311bcd55819bc6dc129557793d666f0b6
Backed out changeset 342f897311bc (bug 1353895)
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/webdriver/tests/actions/mouse.py
testing/web-platform/tests/webdriver/tests/support/wait.py
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -67208,21 +67208,16 @@
      {}
     ]
    ],
    "webdriver/tests/support/merge_dictionaries.py": [
     [
      {}
     ]
    ],
-   "webdriver/tests/support/wait.py": [
-    [
-     {}
-    ]
-   ],
    "webgl/OWNERS": [
     [
      {}
     ]
    ],
    "webgl/common.js": [
     [
      {}
@@ -220608,17 +220603,17 @@
    "ebdbe326fd2fc53a3522b846505808496407b5b8",
    "support"
   ],
   "webdriver/tests/actions/key.py": [
    "69542dc107d881bf18dfff3203bfd7a9ec31b4ad",
    "wdspec"
   ],
   "webdriver/tests/actions/mouse.py": [
-   "51ba095d3d754e30154c20b2910830c6d3e3410c",
+   "fa12c8c7c4883604d221db8cd6b366a5f70ff185",
    "wdspec"
   ],
   "webdriver/tests/actions/sequence.py": [
    "6a90971de07950c74e54312fc4429074ea1bed21",
    "wdspec"
   ],
   "webdriver/tests/actions/special_keys.py": [
    "3b10143dea60567f30b4ab6c544e005d02f31fc3",
@@ -220675,20 +220670,16 @@
   "webdriver/tests/support/inline.py": [
    "bc85126e5637145e81f27d037f3a9090747130c8",
    "support"
   ],
   "webdriver/tests/support/merge_dictionaries.py": [
    "84a6d3c6f8f4afded0f21264bbaeebec38a7f827",
    "support"
   ],
-  "webdriver/tests/support/wait.py": [
-   "a4b0c9c340ea7055139d9fcab3246ee836d6a441",
-   "support"
-  ],
   "webdriver/tests/window_maximizing.py": [
    "ba6b9109f5baaf6eb300a3f89f984753e9d5adb9",
    "wdspec"
   ],
   "webgl/OWNERS": [
    "f8e0703fe2cc88edd21ef2c94fcb2e1a8889f5ae",
    "support"
   ],
--- a/testing/web-platform/tests/webdriver/tests/actions/mouse.py
+++ b/testing/web-platform/tests/webdriver/tests/actions/mouse.py
@@ -1,13 +1,12 @@
 import pytest
 
 from tests.support.inline import inline
 from tests.actions.support.refine import get_events, filter_dict
-from tests.support.wait import wait
 
 
 def link_doc(dest):
     content = "<a href=\"{}\" id=\"link\">destination</a>".format(dest)
     return inline(content)
 
 
 def get_center(rect):
@@ -67,27 +66,25 @@ def test_click_element_center(session, t
 
 def test_click_navigation(session, url):
     destination = url("/webdriver/tests/actions/support/test_actions_wdspec.html")
     start = link_doc(destination)
 
     def click(link):
         mouse_chain = session.actions.sequence(
             "pointer", "pointer_id", {"pointerType": "mouse"})
-        mouse_chain.click(element=link).perform()
+        mouse_chain.click(element=link).pause(300).perform()
 
     session.url = start
-    error_message = "Did not navigate to %s" % destination
-
     click(session.find.css("#link", all=False))
-    wait(session, lambda s: s.url == destination, error_message)
+    assert session.url == destination
     # repeat steps to check behaviour after document unload
     session.url = start
     click(session.find.css("#link", all=False))
-    wait(session, lambda s: s.url == destination, error_message)
+    assert session.url == destination
 
 
 @pytest.mark.parametrize("drag_duration", [0, 300, 800])
 @pytest.mark.parametrize("dx, dy",
     [(20, 0), (0, 15), (10, 15), (-20, 0), (10, -15), (-10, -15)])
 def test_drag_and_drop(session, test_actions_page, mouse_chain, dx, dy, drag_duration):
     drag_target = session.find.css("#dragTarget", all=False)
     initial_rect = drag_target.rect
deleted file mode 100644
--- a/testing/web-platform/tests/webdriver/tests/support/wait.py
+++ /dev/null
@@ -1,28 +0,0 @@
-import time
-
-class TimeoutException(Exception):
-    pass
-
-
-def wait(session, condition, message, interval=0.1, timeout=5):
-    """ Poll a condition until it's true or the timeout ellapses.
-
-    :param session: WebDriver session to use with `condition`
-    :param condition: function that accepts a WebDriver session and returns a boolean
-    :param message: failure description to display in case the timeout is reached
-    :param interval: seconds between each call to `condition`. Default: 0.1
-    :param timeout: seconds until we stop polling. Default: 5
-    """
-
-    start = time.time()
-    end = start + timeout
-
-    while not (time.time() >= end):
-        next_step = time.time() + interval
-        success = condition(session)
-        next_interval = max(next_step - time.time(), 0)
-        if not success:
-            time.sleep(next_interval)
-            continue
-        return success
-    raise TimeoutException("Timed out after %d seconds: %s" % (timeout, message))