Bug 1322862 - Wait for forward- and back commands to complete. r=maja_zf, a=test-only
authorAndreas Tolfsen <ato@mozilla.com>
Thu, 02 Feb 2017 14:08:52 +0000
changeset 378252 cac26dfbeb350f1d9c3f874935e5afb696a0691e
parent 378251 9a9085f9b120052f4ec102583e35d4b536c45748
child 378253 61fac7c3d3468e13ebc53a5494b94d9328938fb7
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmaja_zf, test-only
bugs1322862, 1330348
milestone53.0a2
Bug 1322862 - Wait for forward- and back commands to complete. r=maja_zf, a=test-only 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;"""))