mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1246695 - Fix e10s TART newtab race condition on newtab change r=mconley
MozReview-Commit-ID: KiG5KIQov1t
This commit is contained in:
parent
2aca02b375
commit
9bbb8c6cfd
@ -66,6 +66,23 @@ Tart.prototype = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
makeNewTabURLChangePromise: function(url) {
|
||||||
|
let promise = new Promise(resolve => {
|
||||||
|
Services.obs.addObserver(function observer(subject, topic, data) {
|
||||||
|
Services.obs.removeObserver(observer, topic);
|
||||||
|
if (data == url) {
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
|
}, "newtab-url-changed", false);
|
||||||
|
});
|
||||||
|
if (url === "about:newtab") {
|
||||||
|
aboutNewTabService.resetNewTabURL();
|
||||||
|
} else {
|
||||||
|
aboutNewTabService.newTabURL = url;
|
||||||
|
}
|
||||||
|
return promise;
|
||||||
|
},
|
||||||
|
|
||||||
// Same as customizeEnterDetector, but stops recording when the CSS animation ends
|
// Same as customizeEnterDetector, but stops recording when the CSS animation ends
|
||||||
// The detector then waits until customizationready
|
// The detector then waits until customizationready
|
||||||
customizeEnterCssDetector: {
|
customizeEnterCssDetector: {
|
||||||
@ -474,81 +491,78 @@ Tart.prototype = {
|
|||||||
|
|
||||||
var subtests = {
|
var subtests = {
|
||||||
init: [ // This is called before each subtest, so it's safe to assume the following prefs:
|
init: [ // This is called before each subtest, so it's safe to assume the following prefs:
|
||||||
function(){aboutNewTabService.newTabURL = "about:blank";
|
function(){
|
||||||
Services.prefs.setBoolPref("browser.newtabpage.enabled", true); // preview images if using about:newtab
|
Services.prefs.setBoolPref("browser.newtabpage.enabled", true);
|
||||||
Services.prefs.setBoolPref("browser.newtab.preload", false);
|
Services.prefs.setBoolPref("browser.newtab.preload", false);
|
||||||
//Services.prefs.setCharPref("layout.css.devPixelsPerPx", "-1");
|
self.pinTart();
|
||||||
self.pinTart();
|
self.makeNewTabURLChangePromise("about:blank").then(next);
|
||||||
//Services.prefs.setIntPref ("docshell.event_starvation_delay_hint", 1);
|
},
|
||||||
next();
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
|
|
||||||
restore: [
|
restore: [
|
||||||
// Restore prefs which were modified during the test
|
// Restore prefs which were modified during the test
|
||||||
function(){aboutNewTabService.resetNewTabURL();
|
function(){
|
||||||
Services.prefs.setBoolPref("browser.newtabpage.enabled", origNewtabEnabled);
|
Services.prefs.setBoolPref("browser.newtabpage.enabled", origNewtabEnabled);
|
||||||
Services.prefs.setBoolPref("browser.newtab.preload", origPreload);
|
Services.prefs.setBoolPref("browser.newtab.preload", origPreload);
|
||||||
Services.prefs.setCharPref("layout.css.devPixelsPerPx", origDpi);
|
Services.prefs.setCharPref("layout.css.devPixelsPerPx", origDpi);
|
||||||
if (origPinned) self.pinTart(); else self.unpinTart();
|
if (origPinned) self.pinTart(); else self.unpinTart();
|
||||||
//if (origStarveHint != -9999) Services.prefs.setIntPref("docshell.event_starvation_delay_hint", origStarveHint);
|
self.makeNewTabURLChangePromise("about:newtab").then(next);
|
||||||
next();
|
},
|
||||||
}
|
|
||||||
],
|
],
|
||||||
|
|
||||||
simple: [
|
simple: [
|
||||||
function(){Services.prefs.setCharPref("layout.css.devPixelsPerPx", "1"); next();},
|
function(){Services.prefs.setCharPref("layout.css.devPixelsPerPx", "1"); next();},
|
||||||
|
|
||||||
function(){animate(0, addTab, next);},
|
function(){animate(0, addTab, next);},
|
||||||
function(){animate(0, closeCurrentTab, next);},
|
function(){animate(0, closeCurrentTab, next);},
|
||||||
|
|
||||||
function(){animate(rest, addTab, next, true, "simple-open-DPI1", tabRefDuration);},
|
function(){animate(rest, addTab, next, true, "simple-open-DPI1", tabRefDuration);},
|
||||||
function(){animate(rest, closeCurrentTab, next, true, "simple-close-DPI1", tabRefDuration);}
|
function(){animate(rest, closeCurrentTab, next, true, "simple-close-DPI1", tabRefDuration);}
|
||||||
],
|
],
|
||||||
|
|
||||||
iconDpi1: [
|
iconDpi1: [
|
||||||
function(){Services.prefs.setCharPref("layout.css.devPixelsPerPx", "1"); next();},
|
function(){
|
||||||
function(){aboutNewTabService.newTabURL = "chrome://tart/content/blank.icon.html"; next();},
|
Services.prefs.setCharPref("layout.css.devPixelsPerPx", "1");
|
||||||
|
self.makeNewTabURLChangePromise("chrome://tart/content/blank.icon.html").then(next);
|
||||||
|
},
|
||||||
function(){animate(0, addTab, next);},
|
function(){animate(0, addTab, next);},
|
||||||
function(){animate(0, closeCurrentTab, next);},
|
function(){animate(0, closeCurrentTab, next);},
|
||||||
|
|
||||||
function(){animate(rest, addTab, next, true, "icon-open-DPI1", tabRefDuration);},
|
function(){animate(rest, addTab, next, true, "icon-open-DPI1", tabRefDuration);},
|
||||||
function(){animate(rest, closeCurrentTab, next, true, "icon-close-DPI1", tabRefDuration);}
|
function(){animate(rest, closeCurrentTab, next, true, "icon-close-DPI1", tabRefDuration);}
|
||||||
],
|
],
|
||||||
|
|
||||||
iconDpi2: [
|
iconDpi2: [
|
||||||
function(){Services.prefs.setCharPref("layout.css.devPixelsPerPx", "2"); next();},
|
function(){
|
||||||
function(){aboutNewTabService.newTabURL = "chrome://tart/content/blank.icon.html"; next();},
|
Services.prefs.setCharPref("layout.css.devPixelsPerPx", "2");
|
||||||
|
self.makeNewTabURLChangePromise("chrome://tart/content/blank.icon.html").then(next);
|
||||||
|
},
|
||||||
function(){animate(0, addTab, next);},
|
function(){animate(0, addTab, next);},
|
||||||
function(){animate(0, closeCurrentTab, next);},
|
function(){animate(0, closeCurrentTab, next);},
|
||||||
|
|
||||||
function(){animate(rest, addTab, next, true, "icon-open-DPI2", tabRefDuration);},
|
function(){animate(rest, addTab, next, true, "icon-open-DPI2", tabRefDuration);},
|
||||||
function(){animate(rest, closeCurrentTab, next, true, "icon-close-DPI2", tabRefDuration);}
|
function(){animate(rest, closeCurrentTab, next, true, "icon-close-DPI2", tabRefDuration);}
|
||||||
],
|
],
|
||||||
|
|
||||||
newtabNoPreload: [
|
newtabNoPreload: [
|
||||||
function(){aboutNewTabService.resetNewTabURL();
|
function(){
|
||||||
Services.prefs.setCharPref("layout.css.devPixelsPerPx", "-1");
|
Services.prefs.setCharPref("layout.css.devPixelsPerPx", "-1");
|
||||||
Services.prefs.setBoolPref("browser.newtab.preload", false);
|
Services.prefs.setBoolPref("browser.newtab.preload", false);
|
||||||
next();
|
self.makeNewTabURLChangePromise("about:newtab").then(next);
|
||||||
},
|
},
|
||||||
|
|
||||||
function(){animate(rest, addTab, next, true, "newtab-open-preload-no", tabRefDuration);},
|
function(){animate(rest, addTab, next, true, "newtab-open-preload-no", tabRefDuration);},
|
||||||
|
|
||||||
function(){animate(0, closeCurrentTab, next);}
|
function(){animate(0, closeCurrentTab, next);}
|
||||||
],
|
],
|
||||||
|
|
||||||
newtabYesPreload: [
|
newtabYesPreload: [
|
||||||
function(){aboutNewTabService.resetNewTabURL();
|
function(){
|
||||||
Services.prefs.setCharPref("layout.css.devPixelsPerPx", "-1");
|
Services.prefs.setCharPref("layout.css.devPixelsPerPx", "-1");
|
||||||
Services.prefs.setBoolPref("browser.newtab.preload", true);
|
Services.prefs.setBoolPref("browser.newtab.preload", true);
|
||||||
next();
|
self.makeNewTabURLChangePromise("about:newtab").then(next);
|
||||||
},
|
},
|
||||||
|
|
||||||
function(){animate(0, addTab, next);},
|
function(){animate(0, addTab, next);},
|
||||||
function(){animate(0, closeCurrentTab, next);},
|
function(){animate(0, closeCurrentTab, next);},
|
||||||
|
|
||||||
function(){animate(1000, addTab, next, true, "newtab-open-preload-yes", tabRefDuration);},
|
function(){animate(1000, addTab, next, true, "newtab-open-preload-yes", tabRefDuration);},
|
||||||
|
|
||||||
function(){animate(0, closeCurrentTab, next);}
|
function(){animate(0, closeCurrentTab, next);}
|
||||||
],
|
],
|
||||||
|
|
||||||
@ -563,8 +577,10 @@ Tart.prototype = {
|
|||||||
],
|
],
|
||||||
|
|
||||||
multi: [
|
multi: [
|
||||||
function(){Services.prefs.setCharPref("layout.css.devPixelsPerPx", "1.0"); next();},
|
function(){
|
||||||
function(){aboutNewTabService.newTabURL = "chrome://tart/content/blank.icon.html"; next();},
|
Services.prefs.setCharPref("layout.css.devPixelsPerPx", "1.0");
|
||||||
|
self.makeNewTabURLChangePromise("chrome://tart/content/blank.icon.html").then(next);
|
||||||
|
},
|
||||||
|
|
||||||
function(){animate(0, addTab, next);},
|
function(){animate(0, addTab, next);},
|
||||||
function(){animate(0, addTab, next);},
|
function(){animate(0, addTab, next);},
|
||||||
@ -593,7 +609,7 @@ Tart.prototype = {
|
|||||||
],
|
],
|
||||||
|
|
||||||
simpleFadeDpiCurrent: [
|
simpleFadeDpiCurrent: [
|
||||||
function(){aboutNewTabService.newTabURL = "about:blank"; next();},
|
function(){self.makeNewTabURLChangePromise("about:blank").then(next);},
|
||||||
|
|
||||||
function(){animate(0, addTab, next);},
|
function(){animate(0, addTab, next);},
|
||||||
function(){animate(rest, fadeout, next, true, "simpleFade-close-DPIcurrent", tabRefDuration);},
|
function(){animate(rest, fadeout, next, true, "simpleFade-close-DPIcurrent", tabRefDuration);},
|
||||||
@ -602,7 +618,7 @@ Tart.prototype = {
|
|||||||
],
|
],
|
||||||
|
|
||||||
iconFadeDpiCurrent: [
|
iconFadeDpiCurrent: [
|
||||||
function(){aboutNewTabService.newTabURL = "chrome://tart/content/blank.icon.html"; next();},
|
function(){self.makeNewTabURLChangePromise("chrome://tart/content/blank.icon.html").then(next);},
|
||||||
|
|
||||||
function(){animate(0, addTab, next);},
|
function(){animate(0, addTab, next);},
|
||||||
function(){animate(rest, fadeout, next, true, "iconFade-close-DPIcurrent", tabRefDuration);},
|
function(){animate(rest, fadeout, next, true, "iconFade-close-DPIcurrent", tabRefDuration);},
|
||||||
@ -611,9 +627,10 @@ Tart.prototype = {
|
|||||||
],
|
],
|
||||||
|
|
||||||
iconFadeDpi2: [
|
iconFadeDpi2: [
|
||||||
function(){Services.prefs.setCharPref("layout.css.devPixelsPerPx", "2"); next();},
|
function(){
|
||||||
function(){aboutNewTabService.newTabURL = "chrome://tart/content/blank.icon.html"; next();},
|
Services.prefs.setCharPref("layout.css.devPixelsPerPx", "2");
|
||||||
|
self.makeNewTabURLChangePromise("chrome://tart/content/blank.icon.html").then(next);
|
||||||
|
},
|
||||||
function(){animate(0, addTab, next);},
|
function(){animate(0, addTab, next);},
|
||||||
function(){animate(rest, fadeout, next, true, "iconFade-close-DPI2", tabRefDuration);},
|
function(){animate(rest, fadeout, next, true, "iconFade-close-DPI2", tabRefDuration);},
|
||||||
function(){animate(rest, fadein, next, true, "iconFade-open-DPI2", tabRefDuration);},
|
function(){animate(rest, fadein, next, true, "iconFade-open-DPI2", tabRefDuration);},
|
||||||
|
Loading…
Reference in New Issue
Block a user