Bug 1322862 - Wait for forward- and back commands to complete; r=maja_zf
authorAndreas Tolfsen <ato@mozilla.com>
Thu, 02 Feb 2017 14:08:52 +0000
changeset 341032 93b5ddfa8698431ba6a229e66782150bc681d5ba
parent 341031 18fcec7442456c0a5951e951b197d436bd8c35f4
child 341033 9a087f3a376703d2b5d0eb7dd22dcdf748fe49f5
push id86615
push userkwierso@gmail.com
push dateTue, 07 Feb 2017 01:52:08 +0000
treeherdermozilla-inbound@f0453084d86e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmaja_zf
bugs1322862, 1330348
milestone54.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 1322862 - Wait for forward- and back commands to complete; r=maja_zf The Back and Forward commands are meant to be synchronous and this works around the problem of intermittents on slow try machines until bug 1330348 is fixed. For some reason, the preceding patches make script evaluation quicker and makes navigating back and forward less racy. MozReview-Commit-ID: GRcgMp1Rc6N
testing/marionette/harness/marionette_harness/tests/unit/test_navigation.py
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_navigation.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_navigation.py
@@ -73,36 +73,41 @@ class TestNavigate(WindowManagerMixin, M
         self.assertEqual(self.iframe_doc, self.marionette.get_url())
 
     def test_get_current_url(self):
         self.marionette.navigate(self.test_doc)
         self.assertEqual(self.test_doc, self.marionette.get_url())
         self.marionette.navigate("about:blank")
         self.assertEqual("about:blank", self.marionette.get_url())
 
+    # TODO(ato): Remove wait conditions when fixing bug 1330348
     def test_go_back(self):
         self.marionette.navigate(self.test_doc)
         self.assertNotEqual("about:blank", self.location_href)
         self.assertEqual("Marionette Test", self.marionette.title)
         self.marionette.navigate("about:blank")
         self.assertEqual("about:blank", self.location_href)
         self.marionette.go_back()
+        Wait(self.marionette).until(lambda m: self.location_href == self.test_doc)
         self.assertNotEqual("about:blank", self.location_href)
         self.assertEqual("Marionette Test", self.marionette.title)
 
+    # TODO(ato): Remove wait conditions when fixing bug 1330348
     def test_go_forward(self):
         self.marionette.navigate(self.test_doc)
         self.assertNotEqual("about:blank", self.location_href)
         self.assertEqual("Marionette Test", self.marionette.title)
         self.marionette.navigate("about:blank")
         self.assertEqual("about:blank", self.location_href)
         self.marionette.go_back()
+        Wait(self.marionette).until(lambda m: self.location_href == self.test_doc)
         self.assertEqual(self.test_doc, self.location_href)
         self.assertEqual("Marionette Test", self.marionette.title)
         self.marionette.go_forward()
+        Wait(self.marionette).until(lambda m: self.location_href == "about:blank")
         self.assertEqual("about:blank", self.location_href)
 
     def test_refresh(self):
         self.marionette.navigate(self.test_doc)
         self.assertEqual("Marionette Test", self.marionette.title)
         self.assertTrue(self.marionette.execute_script(
             """var elem = window.document.createElement('div'); elem.id = 'someDiv';
             window.document.body.appendChild(elem); return true;"""))