Backed out changeset d93b95e192e9 (bug 1287723) on request from whimboo
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Mon, 25 Jul 2016 11:42:10 +0200
changeset 346264 7c669d5d63efceb12696cd65cfa72c296013dafb
parent 346263 e0bc88708ffed39aaab1fbc0ac461d93561195de
child 346325 f44bb9de08ade45299223de89953c6d0f4d003d1
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1287723
milestone50.0a1
backs outd93b95e192e9be54084b62c6ef547b4e3cb5b4c2
first release with
nightly linux32
7c669d5d63ef / 50.0a1 / 20160725030248 / files
nightly linux64
7c669d5d63ef / 50.0a1 / 20160725030248 / files
nightly mac
7c669d5d63ef / 50.0a1 / 20160725030248 / files
nightly win32
7c669d5d63ef / 50.0a1 / 20160725030248 / files
nightly win64
7c669d5d63ef / 50.0a1 / 20160725030248 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset d93b95e192e9 (bug 1287723) on request from whimboo
testing/marionette/harness/marionette/tests/unit/test_screenshot.py
--- a/testing/marionette/harness/marionette/tests/unit/test_screenshot.py
+++ b/testing/marionette/harness/marionette/tests/unit/test_screenshot.py
@@ -1,16 +1,17 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # 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 base64
 import hashlib
 import imghdr
 import struct
+import time
 import urllib
 
 from unittest import skip
 
 from marionette import MarionetteTestCase
 from marionette_driver.by import By
 
 
@@ -81,31 +82,26 @@ class Chrome(ScreenCaptureTestCase):
         chrome = self.marionette.screenshot()
         self.assertNotEqual(content, chrome)
 
     # This tests that GeckoDriver#takeScreenshot uses
     # currentContext.document.documentElement instead of looking for a
     # <window> element, which does not exist for secondary windows.
     def test_secondary_windows(self):
         ss = self.marionette.screenshot()
-        self.marionette.execute_async_script("""
-            win = window.open('chrome://marionette/content/doesnotexist.xul',
+        self.marionette.execute_script("""
+            window.open('chrome://marionette/content/doesnotexist.xul',
             'foo',
             'chrome');
-
-            // Bug 1288339 - We don't wait for readyState to be complete yet
-            waitForWindow = function() {
-              if (win.document.readyState != 'complete') {
-                win.setTimeout(this, 100);
-              }
-
-              marionetteScriptFinished(true);
-            }()
             """)
         self.marionette.switch_to_window("foo")
+        # there can be a race between opening and registering the window
+        # and switching to it. Waiting a tiny amount of time is enough not to
+        # break anything.
+        time.sleep(0.002)
         ss = self.marionette.screenshot()
         size = self.get_image_dimensions(ss)
         self.assert_png(ss)
         self.assertNotEqual(self.primary_window_dimensions, size)
 
 
 class Content(ScreenCaptureTestCase):
     @property