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 : 3f999026456315f6e61e4717a8c58ef32f8f53ab
This commit is contained in:
Andreas Tolfsen 2017-01-03 18:45:35 +00:00
parent 3d6b2cd7e2
commit 6e0bec5415

View File

@ -36,7 +36,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(