Bug 1322862 - Compare unicode strings in Python test; r=whimboo

It has been known to happen that Python occassionally trips up string
comparison on Windows and that this is causing intermittent issues.
This patch uses unicode strings consistently so that this should not
occur.

MozReview-Commit-ID: BAdHfiLZzuQ

--HG--
extra : rebase_source : f1ccb11a7deea1ccd7d2f84c33f5eb591a48cb2a
This commit is contained in:
Andreas Tolfsen 2017-01-03 18:45:35 +00:00
parent e2b29ab24a
commit 02dda12d80

View File

@ -35,7 +35,14 @@ class TestNavigate(WindowManagerMixin, MarionetteTestCase):
@property
def location_href(self):
return self.marionette.execute_script("return window.location.href")
# Windows 8 has recently seen a proliferation of intermittent
# test failures to do with failing to compare "about:blank" ==
# u"about:blank". For the sake of consistenty, we encode the
# returned URL as Unicode here to ensure that the values are
# absolutely of the same type.
#
# (https://bugzilla.mozilla.org/show_bug.cgi?id=1322862)
return self.marionette.execute_script("return window.location.href").encode("utf-8")
def test_set_location_through_execute_script(self):
self.marionette.execute_script(