From bcf7d1dd2756fe99def6abccd77e31531aca3c56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Qu=C3=A8ze?= Date: Fri, 22 Sep 2017 00:50:54 +0200 Subject: [PATCH] Bug 1400528 - make test_bug574663.html wait until the 'blank' attribute has actually been removed, r=mconley. --- dom/events/test/test_bug574663.html | 16 ++++++++++++---- dom/events/test/window_wheel_default_action.html | 16 ++++++++++++---- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/dom/events/test/test_bug574663.html b/dom/events/test/test_bug574663.html index b3351288cb37..2b1b01eabf6f 100644 --- a/dom/events/test/test_bug574663.html +++ b/dom/events/test/test_bug574663.html @@ -105,12 +105,20 @@ function runTest() { // browser to 0 using the 'blank' attribute. // Until the blank attribute is removed, we can't send scroll events. SimpleTest.waitForFocus(function() { - SpecialPowers.loadChromeScript(_ => { + let chromeScript = SpecialPowers.loadChromeScript(_ => { Components.utils.import("resource://gre/modules/Services.jsm"); - Services.wm.getMostRecentWindow("navigator:browser") - .gBrowser.selectedBrowser.removeAttribute("blank"); + let win = Services.wm.getMostRecentWindow("navigator:browser"); + win.requestAnimationFrame(() => { + win.gBrowser.selectedBrowser.removeAttribute("blank"); + win.requestAnimationFrame(() => { + sendAsyncMessage("blank-attribute-removed"); + }); + }); + }); + chromeScript.promiseOneMessage("blank-attribute-removed").then(() => { + chromeScript.destroy(); + waitForPaint(win, winUtils, callback); }); - waitForPaint(win, winUtils, callback); }, win); }; diff --git a/dom/events/test/window_wheel_default_action.html b/dom/events/test/window_wheel_default_action.html index 53f3ddb27a10..84ad330ad9b9 100644 --- a/dom/events/test/window_wheel_default_action.html +++ b/dom/events/test/window_wheel_default_action.html @@ -52,12 +52,20 @@ // browser to 0 using the 'blank' attribute. // Until the blank attribute is removed, we can't send scroll events. SimpleTest.waitForFocus(function() { - SpecialPowers.loadChromeScript(_ => { + let chromeScript = SpecialPowers.loadChromeScript(_ => { Components.utils.import("resource://gre/modules/Services.jsm"); - Services.wm.getMostRecentWindow("navigator:browser") - .gBrowser.selectedBrowser.removeAttribute("blank"); + let win = Services.wm.getMostRecentWindow("navigator:browser"); + win.requestAnimationFrame(() => { + win.gBrowser.selectedBrowser.removeAttribute("blank"); + win.requestAnimationFrame(() => { + sendAsyncMessage("blank-attribute-removed"); + }); + }); + }); + chromeScript.promiseOneMessage("blank-attribute-removed").then(() => { + chromeScript.destroy(); + runTests(); }); - runTests(); }, window); SimpleTest.requestFlakyTimeout("untriaged");