From 50414260c31f115d9bbdac4f5c1fed90feb4153a Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Wed, 30 Nov 2016 15:17:04 -0500 Subject: [PATCH] Backed out changeset d2c1a3a02f40 (bug 1320629) for TestExecuteContent.test_window_set_timeout_is_not_cancelled | TypeError: until() got an unexpected keyword argument 'timeout' bustage on a CLOSED TREE. --HG-- extra : amend_source : b97599064bef36a9f99dbd3040f5f1c6fd54d723 --- .../tests/unit/test_execute_script.py | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/testing/marionette/harness/marionette/tests/unit/test_execute_script.py b/testing/marionette/harness/marionette/tests/unit/test_execute_script.py index 0f4909f34459..a4b9d9966a82 100644 --- a/testing/marionette/harness/marionette/tests/unit/test_execute_script.py +++ b/testing/marionette/harness/marionette/tests/unit/test_execute_script.py @@ -6,11 +6,9 @@ import os import time import urllib +from marionette import MarionetteTestCase, WindowManagerMixin from marionette_driver import By, errors from marionette_driver.marionette import HTMLElement -from marionette_driver.wait import Wait - -from marionette import MarionetteTestCase, WindowManagerMixin def inline(doc): @@ -241,27 +239,27 @@ class TestExecuteContent(MarionetteTestCase): "return typeof arguments[0] == 'undefined'")) def test_window_set_timeout_is_not_cancelled(self): - def content_timeout_triggered(mn): - return mn.execute_script("return window.n", sandbox=None) > 0 - - # subsequent call to execute_script after this - # should not cancel the setTimeout event self.marionette.navigate(inline(""" """)) - # as debug builds are inherently slow, - # we need to assert the event did not already fire + # first execute script call should not cancel event self.assertEqual(0, self.marionette.execute_script( - "return window.n", sandbox=None), - "setTimeout already fired") + "return window.contentTimeoutTriggered", sandbox=None)) - # if event was cancelled, this will time out - Wait(self.marionette).until(content_timeout_triggered, - timeout=8, - message="Scheduled setTimeout event was cancelled by call to execute_script") + # test that event was not cancelled + time.sleep(1) + self.assertEqual(1, self.marionette.execute_script( + "return window.contentTimeoutTriggered", sandbox=None)) + + # ../../../../evaluate.js:/scriptTimeoutID/ + # sets the script timeout handler using the content frame script + # so the in-content setTimeout should always return 2 + self.assertEqual(2, self.marionette.execute_script( + "return window.contentTimeoutID", sandbox=None)) class TestExecuteChrome(WindowManagerMixin, TestExecuteContent):