Bug 1156427 - Fix test_set_location_through_execute_script by waiting for the page to be loaded. r=automatedtester
☠☠ backed out by d9a638985deb ☠ ☠
authorHenrik Skupin <mail@hskupin.info>
Thu, 08 Sep 2016 15:32:59 +0200
changeset 313840 10322a5fc3e72aef761fc5156676a591d7b53167
parent 313839 4c854d8255d29a8c0c4cc4d4fbdc86c8cce21d41
child 313841 6711f5d1f7b694dbea7b831073556beebae52d4e
push id30698
push usercbook@mozilla.com
push dateWed, 14 Sep 2016 10:07:43 +0000
treeherdermozilla-central@501e27643a52 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersautomatedtester
bugs1156427
milestone51.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 1156427 - Fix test_set_location_through_execute_script by waiting for the page to be loaded. r=automatedtester
testing/marionette/harness/marionette/tests/unit/test_navigation.py
--- a/testing/marionette/harness/marionette/tests/unit/test_navigation.py
+++ b/testing/marionette/harness/marionette/tests/unit/test_navigation.py
@@ -2,34 +2,33 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import time
 import urllib
 
 from marionette import MarionetteTestCase
 from marionette_driver.errors import MarionetteException, TimeoutException
-from marionette_driver.by import By
+from marionette_driver import By, Wait
 
 
 def inline(doc):
     return "data:text/html;charset=utf-8,%s" % urllib.quote(doc)
 
 
 class TestNavigate(MarionetteTestCase):
     def setUp(self):
         MarionetteTestCase.setUp(self)
-        self.marionette.execute_script("window.location.href = 'about:blank'")
-        self.assertEqual("about:blank", self.location_href)
+        self.marionette.navigate("about:")
         self.test_doc = self.marionette.absolute_url("test.html")
         self.iframe_doc = self.marionette.absolute_url("test_iframe.html")
 
     def test_set_location_through_execute_script(self):
         self.marionette.execute_script("window.location.href = '%s'" % self.test_doc)
-        self.assertEqual(self.test_doc, self.location_href)
+        Wait(self.marionette).until(lambda _: self.test_doc == self.location_href)
         self.assertEqual("Marionette Test", self.marionette.title)
 
     def test_navigate(self):
         self.marionette.navigate(self.test_doc)
         self.assertNotEqual("about:blank", self.location_href)
         self.assertEqual("Marionette Test", self.marionette.title)
 
     def test_navigate_chrome_error(self):