Bug 1526913 - In Mn test_cookies.py allow for some clock difference between host and device; r=whimboo
authorGeoff Brown <gbrown@mozilla.com>
Tue, 12 Feb 2019 09:24:16 -0700
changeset 458713 78b4a9446213
parent 458712 cb96244f54b1
child 458714 b1e2b327f134
push id35546
push userrmaries@mozilla.com
push dateWed, 13 Feb 2019 04:27:59 +0000
treeherdermozilla-central@636d2c00234d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswhimboo
bugs1526913
milestone67.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 1526913 - In Mn test_cookies.py allow for some clock difference between host and device; r=whimboo
testing/marionette/harness/marionette_harness/tests/unit/test_cookies.py
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_cookies.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_cookies.py
@@ -29,17 +29,19 @@ class CookieTest(MarionetteTestCase):
 
     def test_add_cookie(self):
         self.marionette.add_cookie(self.COOKIE_A)
         cookie_returned = str(self.marionette.execute_script("return document.cookie"))
         self.assertTrue(self.COOKIE_A["name"] in cookie_returned)
 
     def test_adding_a_cookie_that_expired_in_the_past(self):
         cookie = self.COOKIE_A.copy()
-        cookie["expiry"] = calendar.timegm(time.gmtime()) - 1
+        # for android, the browser is running on a remote system; allow for
+        # differences between local and remote clocks
+        cookie["expiry"] = calendar.timegm(time.gmtime()) - 60
         self.marionette.add_cookie(cookie)
         cookies = self.marionette.get_cookies()
         self.assertEquals(0, len(cookies))
 
     def test_chrome_error(self):
         with self.marionette.using_context("chrome"):
             self.assertRaises(UnsupportedOperationException,
                               self.marionette.add_cookie, self.COOKIE_A)