Bug 1322862 - Wait for forward- and back commands to complete; r?maja_zf draft
authorAndreas Tolfsen <ato@mozilla.com>
Thu, 02 Feb 2017 14:08:52 +0000
changeset 479433 138145d66a93acf8a7f3afa61102cb01e50636e0
parent 479432 734c37430d6bd2b00c0ac10bdfba6af5db0f1242
child 544683 cca82955b2b819a42731154807122242efebe8f7
push id44253
push userbmo:ato@mozilla.com
push dateMon, 06 Feb 2017 16:59:28 +0000
reviewersmaja_zf
bugs1322862, 1330348
milestone54.0a1
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;"""))