--- a/browser/components/privatebrowsing/content/aboutPrivateBrowsing.js
+++ b/browser/components/privatebrowsing/content/aboutPrivateBrowsing.js
@@ -13,17 +13,17 @@ const FAVICON_PRIVACY = "chrome://browse
var stringBundle = Services.strings.createBundle(
"chrome://browser/locale/aboutPrivateBrowsing.properties");
var prefBranch = Services.prefs.getBranch("privacy.trackingprotection.");
var prefObserver = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
Ci.nsISupportsWeakReference]),
- observe: function () {
+ observe() {
let tpSubHeader = document.getElementById("tpSubHeader");
let tpToggle = document.getElementById("tpToggle");
let tpButton = document.getElementById("tpButton");
let title = document.getElementById("title");
let titleTracking = document.getElementById("titleTracking");
let globalTrackingEnabled = prefBranch.getBoolPref("enabled");
let trackingEnabled = globalTrackingEnabled ||
prefBranch.getBoolPref("pbmode.enabled");
@@ -37,30 +37,30 @@ var prefObserver = {
};
prefBranch.addObserver("pbmode.enabled", prefObserver, true);
prefBranch.addObserver("enabled", prefObserver, true);
function setFavIcon(url) {
document.getElementById("favicon").setAttribute("href", url);
}
-document.addEventListener("DOMContentLoaded", function () {
+document.addEventListener("DOMContentLoaded", function() {
if (!PrivateBrowsingUtils.isContentWindowPrivate(window)) {
document.documentElement.classList.remove("private");
document.documentElement.classList.add("normal");
document.title = stringBundle.GetStringFromName("title.normal");
document.getElementById("favicon")
.setAttribute("href", FAVICON_QUESTION);
document.getElementById("startPrivateBrowsing")
.addEventListener("command", openPrivateWindow);
return;
}
let tpToggle = document.getElementById("tpToggle");
- document.getElementById("tpButton").addEventListener('click', () => {
+ document.getElementById("tpButton").addEventListener("click", () => {
tpToggle.click();
});
document.title = stringBundle.GetStringFromName("title.head");
document.getElementById("favicon")
.setAttribute("href", FAVICON_PRIVACY);
tpToggle.addEventListener("change", toggleTrackingProtection);
document.getElementById("startTour")
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_DownloadLastDirWithCPS.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_DownloadLastDirWithCPS.js
@@ -52,17 +52,17 @@ async function runTest() {
let dir3 = newDirectory();
let uri1 = Services.io.newURI("http://test1.com/");
let uri2 = Services.io.newURI("http://test2.com/");
let uri3 = Services.io.newURI("http://test3.com/");
let uri4 = Services.io.newURI("http://test4.com/");
// cleanup functions registration
- registerCleanupFunction(function () {
+ registerCleanupFunction(function() {
Services.prefs.clearUserPref("browser.download.lastDir.savePerSite");
Services.prefs.clearUserPref("browser.download.lastDir");
[dir1, dir2, dir3].forEach(dir => dir.remove(true));
win.close();
pbWin.close();
});
function checkDownloadLastDir(gDownloadLastDir, aLastDir) {
@@ -168,18 +168,16 @@ async function runTest() {
"uri3 should return dir3"); // set in CPS
is((await getFile(downloadLastDir, uri4)).path, dir2.path,
"uri4 should return dir2"); // fallback
await clearHistoryAndWait();
// check clearHistory removes all data
is(downloadLastDir.file, null, "clearHistory removes all data");
- //is(Services.contentPrefs.hasPref(uri1, "browser.download.lastDir", null),
- // false, "LastDir preference should be absent");
is((await getFile(downloadLastDir, uri1)), null, "uri1 should point to null");
is((await getFile(downloadLastDir, uri2)), null, "uri2 should point to null");
is((await getFile(downloadLastDir, uri3)), null, "uri3 should point to null");
is((await getFile(downloadLastDir, uri4)), null, "uri4 should point to null");
await setFile(downloadLastDir, null, tmpDir);
// check data set outside PB mode is remembered
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_about.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_about.js
@@ -44,17 +44,17 @@ function* testLinkOpensUrl({ win, tab, e
/**
* Tests the links in "about:privatebrowsing".
*/
add_task(function* test_links() {
// Use full version and change the remote URLs to prevent network access.
Services.prefs.setCharPref("app.support.baseURL", "https://example.com/");
Services.prefs.setCharPref("privacy.trackingprotection.introURL",
"https://example.com/tour");
- registerCleanupFunction(function () {
+ registerCleanupFunction(function() {
Services.prefs.clearUserPref("privacy.trackingprotection.introURL");
Services.prefs.clearUserPref("app.support.baseURL");
});
let { win, tab } = yield openAboutPrivateBrowsing();
yield testLinkOpensTab({ win, tab,
elementId: "learnMore",
@@ -72,29 +72,29 @@ add_task(function* test_links() {
/**
* Tests the action to disable and re-enable Tracking Protection in
* "about:privatebrowsing".
*/
add_task(function* test_toggleTrackingProtection() {
// Use tour version but disable Tracking Protection.
Services.prefs.setBoolPref("privacy.trackingprotection.pbmode.enabled",
true);
- registerCleanupFunction(function () {
+ registerCleanupFunction(function() {
Services.prefs.clearUserPref("privacy.trackingprotection.pbmode.enabled");
});
let { win, tab } = yield openAboutPrivateBrowsing();
// Set up the observer for the preference change before triggering the action.
let prefBranch =
Services.prefs.getBranch("privacy.trackingprotection.pbmode.");
let waitForPrefChanged = () => new Promise(resolve => {
let prefObserver = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]),
- observe: function () {
+ observe() {
prefBranch.removeObserver("enabled", prefObserver);
resolve();
},
};
prefBranch.addObserver("enabled", prefObserver, false);
});
let promisePrefChanged = waitForPrefChanged();
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_cache.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_cache.js
@@ -80,35 +80,33 @@ function getStorageEntryCount(device, go
storage = cs.diskCacheStorage(LoadContextInfo.default, false);
break;
default:
throw "Unknown device " + device + " at getStorageEntryCount";
}
var visitor = {
entryCount: 0,
- onCacheStorageInfo: function (aEntryCount, aConsumption) {
+ onCacheStorageInfo(aEntryCount, aConsumption) {
},
- onCacheEntryInfo: function(uri)
- {
+ onCacheEntryInfo(uri) {
var urispec = uri.asciiSpec;
info(device + ":" + urispec + "\n");
if (urispec.match(/^http:\/\/example.org\//))
++this.entryCount;
},
- onCacheEntryVisitCompleted: function()
- {
+ onCacheEntryVisitCompleted() {
goon(this.entryCount);
}
};
storage.asyncVisitStorage(visitor, true);
}
-function get_cache_for_private_window () {
+function get_cache_for_private_window() {
let win = whenNewWindowLoaded({private: true}, function() {
executeSoon(function() {
ok(true, "The private window got loaded");
let tab = win.gBrowser.addTab("http://example.org");
win.gBrowser.selectedTab = tab;
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_certexceptionsui.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_certexceptionsui.js
@@ -2,19 +2,19 @@
* 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/. */
// This test makes sure that certificate exceptions UI behaves correctly
// in private browsing windows, based on whether it's opened from the prefs
// window or from the SSL error page (see bug 461627).
function test() {
- const EXCEPTIONS_DLG_URL = 'chrome://pippki/content/exceptionDialog.xul';
- const EXCEPTIONS_DLG_FEATURES = 'chrome,centerscreen';
- const INVALID_CERT_LOCATION = 'https://nocert.example.com/';
+ const EXCEPTIONS_DLG_URL = "chrome://pippki/content/exceptionDialog.xul";
+ const EXCEPTIONS_DLG_FEATURES = "chrome,centerscreen";
+ const INVALID_CERT_LOCATION = "https://nocert.example.com/";
waitForExplicitFinish();
// open a private browsing window
var pbWin = OpenBrowserWindow({private: true});
pbWin.addEventListener("load", function() {
doTest();
}, {once: true});
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_concurrent.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_concurrent.js
@@ -13,76 +13,76 @@
add_task(function* setup() {
yield SpecialPowers.pushPrefEnv({
set: [["dom.ipc.processCount", 1]]
});
});
add_task(function* test() {
- let prefix = 'http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_concurrent_page.html';
+ let prefix = "http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_concurrent_page.html";
function getElts(browser) {
- return browser.contentTitle.split('|');
+ return browser.contentTitle.split("|");
}
// Step 1
let non_private_browser = gBrowser.selectedBrowser;
- non_private_browser.loadURI(prefix + '?action=set&name=test&value=value&initial=true');
+ non_private_browser.loadURI(prefix + "?action=set&name=test&value=value&initial=true");
yield BrowserTestUtils.browserLoaded(non_private_browser);
// Step 2
let private_window = yield BrowserTestUtils.openNewBrowserWindow({ private : true });
let private_browser = private_window.getBrowser().selectedBrowser;
- private_browser.loadURI(prefix + '?action=set&name=test2&value=value2');
+ private_browser.loadURI(prefix + "?action=set&name=test2&value=value2");
yield BrowserTestUtils.browserLoaded(private_browser);
// Step 3
- non_private_browser.loadURI(prefix + '?action=get&name=test2');
+ non_private_browser.loadURI(prefix + "?action=get&name=test2");
yield BrowserTestUtils.browserLoaded(non_private_browser);
let elts = yield getElts(non_private_browser);
- isnot(elts[0], 'value2', "public window shouldn't see private storage");
- is(elts[1], '1', "public window should only see public items");
+ isnot(elts[0], "value2", "public window shouldn't see private storage");
+ is(elts[1], "1", "public window should only see public items");
// Step 4
- private_browser.loadURI(prefix + '?action=get&name=test');
+ private_browser.loadURI(prefix + "?action=get&name=test");
yield BrowserTestUtils.browserLoaded(private_browser);
elts = yield getElts(private_browser);
- isnot(elts[0], 'value', "private window shouldn't see public storage");
- is(elts[1], '1', "private window should only see private items");
+ isnot(elts[0], "value", "private window shouldn't see public storage");
+ is(elts[1], "1", "private window should only see private items");
// Reopen the private window again, without privateBrowsing, which should clear the
// the private storage.
private_window.close();
private_window = yield BrowserTestUtils.openNewBrowserWindow({ private : false });
private_browser = null;
yield new Promise(resolve => Cu.schedulePreciseGC(resolve));
private_browser = private_window.getBrowser().selectedBrowser;
- private_browser.loadURI(prefix + '?action=get&name=test2');
+ private_browser.loadURI(prefix + "?action=get&name=test2");
yield BrowserTestUtils.browserLoaded(private_browser);
elts = yield getElts(private_browser);
- isnot(elts[0], 'value2', "public window shouldn't see cleared private storage");
- is(elts[1], '1', "public window should only see public items");
+ isnot(elts[0], "value2", "public window shouldn't see cleared private storage");
+ is(elts[1], "1", "public window should only see public items");
// Making it private again should clear the storage and it shouldn't
// be able to see the old private storage as well.
private_window.close();
private_window = yield BrowserTestUtils.openNewBrowserWindow({ private : true });
private_browser = null;
yield new Promise(resolve => Cu.schedulePreciseGC(resolve));
private_browser = private_window.getBrowser().selectedBrowser;
- private_browser.loadURI(prefix + '?action=set&name=test3&value=value3');
+ private_browser.loadURI(prefix + "?action=set&name=test3&value=value3");
yield BrowserTestUtils.browserLoaded(private_browser);
elts = yield getElts(private_browser);
- is(elts[1], '1', "private window should only see new private items");
+ is(elts[1], "1", "private window should only see new private items");
// Cleanup.
- non_private_browser.loadURI(prefix + '?final=true');
+ non_private_browser.loadURI(prefix + "?final=true");
yield BrowserTestUtils.browserLoaded(non_private_browser);
private_window.close();
});
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_downloadLastDir.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_downloadLastDir.js
@@ -26,17 +26,17 @@ function test() {
let dir1 = newDirectory();
let dir2 = newDirectory();
let dir3 = newDirectory();
let file1 = newFileInDirectory(dir1);
let file2 = newFileInDirectory(dir2);
let file3 = newFileInDirectory(dir3);
// cleanup functions registration
- registerCleanupFunction(function () {
+ registerCleanupFunction(function() {
Services.prefs.clearUserPref("browser.download.lastDir");
[dir1, dir2, dir3].forEach(dir => dir.remove(true));
MockFilePicker.cleanup();
});
prefs.setComplexValue("lastDir", Ci.nsIFile, tmpDir);
function testOnWindow(aPrivate, aCallback) {
whenNewWindowLoaded({private: aPrivate}, function(win) {
@@ -53,17 +53,17 @@ function test() {
"LastDir should be the expected display dir");
// Check gDownloadLastDir value.
is(gDownloadLastDir.file.path, aDisplayDir.path,
"gDownloadLastDir should be the expected display dir");
MockFilePicker.returnFiles = [aFile];
MockFilePicker.displayDirectory = null;
- launcher.saveDestinationAvailable = function (file) {
+ launcher.saveDestinationAvailable = function(file) {
ok(!!file, "promptForSaveToFile correctly returned a file");
// File picker should start with expected display dir.
is(MockFilePicker.displayDirectory.path, aDisplayDir.path,
"File picker should start with browser.download.lastDir");
// browser.download.lastDir should be modified on not private windows
is(prefs.getComplexValue("lastDir", Ci.nsIFile).path, aLastDir.path,
"LastDir should be the expected last dir");
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_downloadLastDir_c.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_downloadLastDir_c.js
@@ -21,17 +21,17 @@ function test() {
let dir1 = newDirectory();
let dir2 = newDirectory();
let dir3 = newDirectory();
let file1 = newFileInDirectory(dir1);
let file2 = newFileInDirectory(dir2);
let file3 = newFileInDirectory(dir3);
// cleanup function registration
- registerCleanupFunction(function () {
+ registerCleanupFunction(function() {
Services.prefs.clearUserPref("browser.download.lastDir");
[dir1, dir2, dir3].forEach(dir => dir.remove(true));
MockFilePicker.cleanup();
validateFileName = validateFileNameToRestore;
});
// Overwrite validateFileName to validate everything
validateFileName = foo => foo;
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_downloadLastDir_toggle.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_downloadLastDir_toggle.js
@@ -5,17 +5,17 @@ Cu.import("resource://gre/modules/Downlo
* Tests how the browser remembers the last download folder
* from download to download, with a particular emphasis
* on how it behaves when private browsing windows open.
*/
add_task(function* test_downloads_last_dir_toggle() {
let tmpDir = FileUtils.getDir("TmpD", [], true);
let dir1 = newDirectory();
- registerCleanupFunction(function () {
+ registerCleanupFunction(function() {
Services.prefs.clearUserPref("browser.download.lastDir");
dir1.remove(true);
});
let win = yield BrowserTestUtils.openNewBrowserWindow();
let gDownloadLastDir = new DownloadLastDir(win);
is(typeof gDownloadLastDir, "object",
"gDownloadLastDir should be a valid object");
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_lastpbcontextexited.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_lastpbcontextexited.js
@@ -6,25 +6,25 @@ function test() {
// We need to open a new window for this so that its docshell would get destroyed
// when clearing the PB mode flag.
function runTest(aCloseWindow, aCallback) {
let newWin = OpenBrowserWindow({private: true});
SimpleTest.waitForFocus(function() {
let expectedExiting = true;
let expectedExited = false;
let observerExiting = {
- observe: function(aSubject, aTopic, aData) {
+ observe(aSubject, aTopic, aData) {
is(aTopic, "last-pb-context-exiting", "Correct topic should be dispatched (exiting)");
is(expectedExiting, true, "notification not expected yet (exiting)");
expectedExited = true;
Services.obs.removeObserver(observerExiting, "last-pb-context-exiting");
}
};
let observerExited = {
- observe: function(aSubject, aTopic, aData) {
+ observe(aSubject, aTopic, aData) {
is(aTopic, "last-pb-context-exited", "Correct topic should be dispatched (exited)");
is(expectedExited, true, "notification not expected yet (exited)");
Services.obs.removeObserver(observerExited, "last-pb-context-exited");
aCallback();
}
};
Services.obs.addObserver(observerExiting, "last-pb-context-exiting", false);
Services.obs.addObserver(observerExited, "last-pb-context-exited", false);
@@ -35,15 +35,15 @@ function test() {
}, newWin);
}
waitForExplicitFinish();
runTest(function(newWin) {
// Simulate pressing the window close button
newWin.document.getElementById("cmd_closeWindow").doCommand();
- }, function () {
+ }, function() {
runTest(function(newWin) {
// Simulate closing the last tab
newWin.document.getElementById("cmd_close").doCommand();
}, finish);
});
}
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_localStorage.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_localStorage.js
@@ -1,25 +1,25 @@
/* 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/. */
add_task(function* test() {
requestLongerTimeout(2);
- const page1 = 'http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/' +
- 'browser_privatebrowsing_localStorage_page1.html'
+ const page1 = "http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/" +
+ "browser_privatebrowsing_localStorage_page1.html"
let win = yield BrowserTestUtils.openNewBrowserWindow({private: true});
let tab = win.gBrowser.selectedTab = win.gBrowser.addTab(page1);
let browser = win.gBrowser.selectedBrowser;
yield BrowserTestUtils.browserLoaded(browser);
browser.loadURI(
- 'http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/' +
- 'browser_privatebrowsing_localStorage_page2.html');
+ "http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/" +
+ "browser_privatebrowsing_localStorage_page2.html");
yield BrowserTestUtils.browserLoaded(browser);
- is(browser.contentTitle, '2', "localStorage should contain 2 items");
+ is(browser.contentTitle, "2", "localStorage should contain 2 items");
// Cleanup
yield BrowserTestUtils.closeWindow(win);
});
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_localStorage_before_after.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_localStorage_before_after.js
@@ -7,30 +7,30 @@
// Step 1: Load browser_privatebrowsing_localStorage_before_after_page.html in a private tab, causing a storage
// item to exist. Close the tab.
// Step 2: Load the same page in a non-private tab, ensuring that the storage instance reports only one item
// existing.
add_task(function* test() {
let testURI = "about:blank";
- let prefix = 'http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/';
+ let prefix = "http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/";
// Step 1.
let privateWin = yield BrowserTestUtils.openNewBrowserWindow({private: true});
let privateBrowser = privateWin.gBrowser.addTab(
- prefix + 'browser_privatebrowsing_localStorage_before_after_page.html').linkedBrowser;
+ prefix + "browser_privatebrowsing_localStorage_before_after_page.html").linkedBrowser;
yield BrowserTestUtils.browserLoaded(privateBrowser);
- is(privateBrowser.contentTitle, '1', "localStorage should contain 1 item");
+ is(privateBrowser.contentTitle, "1", "localStorage should contain 1 item");
// Step 2.
let win = yield BrowserTestUtils.openNewBrowserWindow();
let browser = win.gBrowser.addTab(
- prefix + 'browser_privatebrowsing_localStorage_before_after_page2.html').linkedBrowser;
+ prefix + "browser_privatebrowsing_localStorage_before_after_page2.html").linkedBrowser;
yield BrowserTestUtils.browserLoaded(browser);
- is(browser.contentTitle, 'null|0', 'localStorage should contain 0 items');
+ is(browser.contentTitle, "null|0", "localStorage should contain 0 items");
// Cleanup
yield BrowserTestUtils.closeWindow(privateWin);
yield BrowserTestUtils.closeWindow(win);
});
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placesTitleNoUpdate.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placesTitleNoUpdate.js
@@ -13,27 +13,27 @@ add_task(function* test() {
const TEST_URL = "http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placesTitleNoUpdate.html"
const TEST_URI = Services.io.newURI(TEST_URL);
const TITLE_1 = "Title 1";
const TITLE_2 = "Title 2";
function waitForTitleChanged() {
return new Promise(resolve => {
let historyObserver = {
- onTitleChanged: function(uri, pageTitle) {
+ onTitleChanged(uri, pageTitle) {
PlacesUtils.history.removeObserver(historyObserver, false);
- resolve({uri: uri, pageTitle: pageTitle});
+ resolve({uri, pageTitle});
},
- onBeginUpdateBatch: function () {},
- onEndUpdateBatch: function () {},
- onVisit: function () {},
- onDeleteURI: function () {},
- onClearHistory: function () {},
- onPageChanged: function () {},
- onDeleteVisits: function() {},
+ onBeginUpdateBatch() {},
+ onEndUpdateBatch() {},
+ onVisit() {},
+ onDeleteURI() {},
+ onClearHistory() {},
+ onPageChanged() {},
+ onDeleteVisits() {},
QueryInterface: XPCOMUtils.generateQI([Ci.nsINavHistoryObserver])
};
PlacesUtils.history.addObserver(historyObserver, false);
});
}
yield PlacesTestUtils.clearHistory();
@@ -47,18 +47,18 @@ add_task(function* test() {
title: TITLE_2,
visits: [{
visitDate: Date.now() * 1000,
transitionType: Ci.nsINavHistoryService.TRANSITION_LINK
}]
};
PlacesUtils.asyncHistory.updatePlaces(place, {
handleError: () => ok(false, "Unexpected error in adding visit."),
- handleResult: function () { },
- handleCompletion: function () {}
+ handleResult() { },
+ handleCompletion() {}
});
yield waitForTitleChanged();
is(PlacesUtils.history.getPageTitle(TEST_URI), TITLE_2, "The title matches the updated title after updating visit");
let privateWin = yield BrowserTestUtils.openNewBrowserWindow({private:true});
yield BrowserTestUtils.browserLoaded(privateWin.gBrowser.addTab(TEST_URL).linkedBrowser);
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placestitle.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placestitle.js
@@ -20,17 +20,17 @@ add_task(function* test() {
yield cleanup();
let deferredFirst = PromiseUtils.defer();
let deferredSecond = PromiseUtils.defer();
let deferredThird = PromiseUtils.defer();
let testNumber = 0;
let historyObserver = {
- onTitleChanged: function(aURI, aPageTitle) {
+ onTitleChanged(aURI, aPageTitle) {
if (aURI.spec != TEST_URL)
return;
switch (++testNumber) {
case 1:
// The first time that the page is loaded
deferredFirst.resolve(aPageTitle);
break;
case 2:
@@ -43,23 +43,23 @@ add_task(function* test() {
break;
default:
// Checks that opening the page in a private window should not fire a
// title change.
ok(false, "Title changed. Unexpected pass: " + testNumber);
}
},
- onBeginUpdateBatch: function () {},
- onEndUpdateBatch: function () {},
- onVisit: function () {},
- onDeleteURI: function () {},
- onClearHistory: function () {},
- onPageChanged: function () {},
- onDeleteVisits: function() {},
+ onBeginUpdateBatch() {},
+ onEndUpdateBatch() {},
+ onVisit() {},
+ onDeleteURI() {},
+ onClearHistory() {},
+ onPageChanged() {},
+ onDeleteVisits() {},
QueryInterface: XPCOMUtils.generateQI([Ci.nsINavHistoryObserver])
};
PlacesUtils.history.addObserver(historyObserver, false);
let win = yield BrowserTestUtils.openNewBrowserWindow();
win.gBrowser.selectedTab = win.gBrowser.addTab(TEST_URL);
let aPageTitle = yield deferredFirst.promise;
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_sidebar.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_sidebar.js
@@ -15,55 +15,55 @@ function test() {
return win.SidebarUI.show("viewBookmarksSidebar").then(() => win);
}
let windowCache = [];
function cacheWindow(w) {
windowCache.push(w);
return w;
}
- function closeCachedWindows () {
+ function closeCachedWindows() {
windowCache.forEach(w => w.close());
}
// Part 1: NON PRIVATE WINDOW -> PRIVATE WINDOW
openWindow(window, {}, 1).
then(cacheWindow).
then(openSidebar).
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');
+ 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(() => openWindow(window)).
then(cacheWindow).
then(openSidebar).
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');
+ is(sidebarBox.hidden, false, "Opening a reg window from reg window does open the sidebar");
}).
// Part 3: PRIVATE WINDOW -> NON PRIVATE WINDOW
then(() => openWindow(window, { private: true })).
then(cacheWindow).
then(openSidebar).
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');
+ is(sidebarBox.hidden, true, "Opening a reg window from a private window does not open the sidebar");
}).
// Part 4: PRIVATE WINDOW -> PRIVATE WINDOW
then(() => openWindow(window, { private: true })).
then(cacheWindow).
then(openSidebar).
then(win => openWindow(win, { private: true })).
then(cacheWindow).
then(function({ document }) {
let sidebarBox = document.getElementById("sidebar-box");
- is(sidebarBox.hidden, false, 'Opening a private window from private window does open the sidebar');
+ is(sidebarBox.hidden, false, "Opening a private window from private window does open the sidebar");
}).
then(closeCachedWindows).
then(finish);
}
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_windowtitle.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_windowtitle.js
@@ -22,18 +22,17 @@ add_task(function* test() {
let pb_about_pb_title;
if (isOSX) {
page_with_title = test_title;
page_without_title = app_name;
about_pb_title = "Open a private window?";
pb_page_with_title = test_title + " - (Private Browsing)";
pb_page_without_title = app_name + " - (Private Browsing)";
pb_about_pb_title = "Private Browsing - (Private Browsing)";
- }
- else {
+ } else {
page_with_title = test_title + " - " + app_name;
page_without_title = app_name;
about_pb_title = "Open a private window?" + " - " + app_name;
pb_page_with_title = test_title + " - " + app_name + " (Private Browsing)";
pb_page_without_title = app_name + " (Private Browsing)";
pb_about_pb_title = "Private Browsing - " + app_name + " (Private Browsing)";
}