mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 23:05:42 +00:00
Bug 1207491 - Part 14: Remove use of expression closure from browser/components/privatebrowsing/. r=Gijs
--HG-- extra : commitid : 5vG9dpkyLY1 extra : rebase_source : d2e07ee332119981226c0b117c39fc262783f6c4
This commit is contained in:
parent
235d99efee
commit
939c0392aa
@ -44,7 +44,7 @@ function setFile(downloadLastDir, aURI, aValue) {
|
||||
|
||||
function clearHistoryAndWait() {
|
||||
clearHistory();
|
||||
executeSoon(function() executeSoon(moveAlong));
|
||||
executeSoon(() => executeSoon(moveAlong));
|
||||
}
|
||||
|
||||
/*
|
||||
@ -73,7 +73,7 @@ function runTest() {
|
||||
registerCleanupFunction(function () {
|
||||
Services.prefs.clearUserPref("browser.download.lastDir.savePerSite");
|
||||
Services.prefs.clearUserPref("browser.download.lastDir");
|
||||
[dir1, dir2, dir3].forEach(function(dir) dir.remove(true));
|
||||
[dir1, dir2, dir3].forEach(dir => dir.remove(true));
|
||||
win.close();
|
||||
pbWin.close();
|
||||
});
|
||||
|
@ -33,7 +33,7 @@ function test() {
|
||||
// cleanup functions registration
|
||||
registerCleanupFunction(function () {
|
||||
Services.prefs.clearUserPref("browser.download.lastDir");
|
||||
[dir1, dir2, dir3].forEach(function(dir) dir.remove(true));
|
||||
[dir1, dir2, dir3].forEach(dir => dir.remove(true));
|
||||
MockFilePicker.cleanup();
|
||||
});
|
||||
prefs.setComplexValue("lastDir", Ci.nsIFile, tmpDir);
|
||||
|
@ -28,13 +28,13 @@ function test() {
|
||||
// cleanup function registration
|
||||
registerCleanupFunction(function () {
|
||||
Services.prefs.clearUserPref("browser.download.lastDir");
|
||||
[dir1, dir2, dir3].forEach(function(dir) dir.remove(true));
|
||||
[dir1, dir2, dir3].forEach(dir => dir.remove(true));
|
||||
MockFilePicker.cleanup();
|
||||
validateFileName = validateFileNameToRestore;
|
||||
});
|
||||
|
||||
// Overwrite validateFileName to validate everything
|
||||
validateFileName = function(foo) foo;
|
||||
validateFileName = foo => foo;
|
||||
|
||||
let params = {
|
||||
fileInfo: new FileInfo("test.txt", "test.txt", "test", "txt", "http://mozilla.org/test.txt"),
|
||||
|
@ -51,7 +51,7 @@ add_task(function* test() {
|
||||
}]
|
||||
};
|
||||
PlacesUtils.asyncHistory.updatePlaces(place, {
|
||||
handleError: function () ok(false, "Unexpected error in adding visit."),
|
||||
handleError: () => ok(false, "Unexpected error in adding visit."),
|
||||
handleResult: function () { },
|
||||
handleCompletion: function () {}
|
||||
});
|
||||
|
@ -44,44 +44,44 @@ function test() {
|
||||
return w;
|
||||
}
|
||||
function closeCachedWindows () {
|
||||
windowCache.forEach(function(w) w.close());
|
||||
windowCache.forEach(w => w.close());
|
||||
}
|
||||
|
||||
// Part 1: NON PRIVATE WINDOW -> PRIVATE WINDOW
|
||||
openWindow(window, {}, 1).
|
||||
then(cacheWindow).
|
||||
then(openSidebar).
|
||||
then(function(win) openWindow(win, { private: true })).
|
||||
then(win => openWindow(win, { private: true })).
|
||||
then(cacheWindow).
|
||||
then(function({ document }) {
|
||||
let sidebarBox = document.getElementById("sidebar-box");
|
||||
is(sidebarBox.hidden, true, 'Opening a private window from reg window does not open the sidebar');
|
||||
}).
|
||||
// Part 2: NON PRIVATE WINDOW -> NON PRIVATE WINDOW
|
||||
then(function() openWindow(window)).
|
||||
then(() => openWindow(window)).
|
||||
then(cacheWindow).
|
||||
then(openSidebar).
|
||||
then(function(win) openWindow(win)).
|
||||
then(win => openWindow(win)).
|
||||
then(cacheWindow).
|
||||
then(function({ document }) {
|
||||
let sidebarBox = document.getElementById("sidebar-box");
|
||||
is(sidebarBox.hidden, false, 'Opening a reg window from reg window does open the sidebar');
|
||||
}).
|
||||
// Part 3: PRIVATE WINDOW -> NON PRIVATE WINDOW
|
||||
then(function() openWindow(window, { private: true })).
|
||||
then(() => openWindow(window, { private: true })).
|
||||
then(cacheWindow).
|
||||
then(openSidebar).
|
||||
then(function(win) openWindow(win)).
|
||||
then(win => openWindow(win)).
|
||||
then(cacheWindow).
|
||||
then(function({ document }) {
|
||||
let sidebarBox = document.getElementById("sidebar-box");
|
||||
is(sidebarBox.hidden, true, 'Opening a reg window from a private window does not open the sidebar');
|
||||
}).
|
||||
// Part 4: PRIVATE WINDOW -> PRIVATE WINDOW
|
||||
then(function() openWindow(window, { private: true })).
|
||||
then(() => openWindow(window, { private: true })).
|
||||
then(cacheWindow).
|
||||
then(openSidebar).
|
||||
then(function(win) openWindow(win, { private: true })).
|
||||
then(win => openWindow(win, { private: true })).
|
||||
then(cacheWindow).
|
||||
then(function({ document }) {
|
||||
let sidebarBox = document.getElementById("sidebar-box");
|
||||
|
@ -11,7 +11,7 @@ function testOnWindow(options, callback) {
|
||||
win.addEventListener("load", function onLoad() {
|
||||
win.removeEventListener("load", onLoad, false);
|
||||
windowsToClose.push(win);
|
||||
executeSoon(function() callback(win));
|
||||
executeSoon(() => callback(win));
|
||||
}, false);
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ function test() {
|
||||
// execute should only be called when need, like when you are opening
|
||||
// web pages on the test. If calling executeSoon() is not necesary, then
|
||||
// call whenNewWindowLoaded() instead of testOnWindow() on your test.
|
||||
executeSoon(function() aCallback(aWin));
|
||||
executeSoon(() => aCallback(aWin));
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -57,7 +57,7 @@ function clearHistory() {
|
||||
function _initTest() {
|
||||
// Don't use about:home as the homepage for new windows
|
||||
Services.prefs.setIntPref("browser.startup.page", 0);
|
||||
registerCleanupFunction(function() Services.prefs.clearUserPref("browser.startup.page"));
|
||||
registerCleanupFunction(() => Services.prefs.clearUserPref("browser.startup.page"));
|
||||
}
|
||||
|
||||
_initTest();
|
||||
|
Loading…
Reference in New Issue
Block a user