Bug 1400528 - make test_bug574663.html wait until the 'blank' attribute has actually been removed, r=mconley.

This commit is contained in:
Florian Quèze 2017-09-22 00:50:54 +02:00
Родитель 1aef116268
Коммит bcf7d1dd27
2 изменённых файлов: 24 добавлений и 8 удалений

Просмотреть файл

@ -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);
};

Просмотреть файл

@ -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");