Bug 1311345 - Enable eslint of browser/components/privatebrowsing/ - Initial changes; r=standard8

MozReview-Commit-ID: AD112cmtsk3

--HG--
extra : rebase_source : 77b76cb8183cd20d624eaa0188599722d1e01541
This commit is contained in:
jordan9769 2017-02-28 12:21:00 +00:00
parent df691cbbcd
commit 3aa7e13c6a
9 changed files with 18 additions and 19 deletions

View file

@ -62,7 +62,6 @@ browser/base/content/test/general/file_csp_block_all_mixedcontent.html
browser/base/content/test/urlbar/file_blank_but_not_blank.html
browser/base/content/newtab/**
browser/components/downloads/**
browser/components/privatebrowsing/**
browser/components/sessionstore/**
browser/components/tabview/**
# generated files in cld2

View file

@ -22,7 +22,7 @@ add_task(function* test() {
function getElts(browser) {
return browser.contentTitle.split('|');
};
}
// Step 1
let non_private_browser = gBrowser.selectedBrowser;

View file

@ -1,15 +1,15 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
var oGetVars = {};
if (window.location.search.length > 1) {
var oGetVars = {};
if (window.location.search.length > 1) {
for (var aItKey, nKeyId = 0, aCouples = window.location.search.substr(1).split("&");
nKeyId < aCouples.length;
nKeyId++) {
aItKey = aCouples[nKeyId].split("=");
oGetVars[unescape(aItKey[0])] = aItKey.length > 1 ? unescape(aItKey[1]) : "";
}
nKeyId++) {
aItKey = aCouples[nKeyId].split("=");
oGetVars[unescape(aItKey[0])] = aItKey.length > 1 ? unescape(aItKey[1]) : "";
}
}
if (oGetVars.initial == 'true') {

View file

@ -2,7 +2,7 @@
* 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 the Clear Recent History menu item and command
// This test makes sure that the Clear Recent History menu item and command
// is disabled inside the private browsing mode.
add_task(function* test() {
@ -14,7 +14,7 @@ add_task(function* test() {
"PrivateBrowsingUtils should report the correct per-window private browsing status");
is(crhCommand.hasAttribute("disabled"), aPrivateMode,
"Clear Recent History command should be disabled according to the private browsing mode");
};
}
let testURI = "http://mochi.test:8888/";

View file

@ -162,7 +162,7 @@ function waitOnFaviconLoaded(aFaviconURL) {
});
}
function* assignCookies(aBrowser, aURL, aCookieValue){
function* assignCookies(aBrowser, aURL, aCookieValue) {
let tabInfo = yield openTab(aBrowser, aURL);
yield ContentTask.spawn(tabInfo.browser, aCookieValue, function* (value) {

View file

@ -17,7 +17,7 @@ add_task(function* test() {
let notification = aWindow.PopupNotifications.getNotification("geolocation");
// Wait until the notification is available.
while (!notification){
while (!notification) {
yield new Promise(resolve => { executeSoon(resolve); });
let notification = aWindow.PopupNotifications.getNotification("geolocation");
}
@ -32,7 +32,7 @@ add_task(function* test() {
aWindow.gBrowser.removeCurrentTab();
});
};
}
let win = yield BrowserTestUtils.openNewBrowserWindow();
let browser = win.gBrowser.selectedBrowser;

View file

@ -81,7 +81,7 @@ function test() {
ok(!privateWindow.gLastOpenDirectory.path,
"No original path should exist inside the private browsing mode");
privateWindow.gLastOpenDirectory.path = dir1;
is(privateWindow.gLastOpenDirectory.path.path, dir1.path,
is(privateWindow.gLastOpenDirectory.path.path, dir1.path,
"The path should be successfully set inside the private browsing mode");
// test the non-private window
ok(!nonPrivateWindow.gLastOpenDirectory.path,

View file

@ -34,7 +34,7 @@ add_task(function* test() {
PlacesUtils.history.addObserver(historyObserver, false);
});
};
}
yield PlacesTestUtils.clearHistory();

View file

@ -33,7 +33,7 @@ function test() {
}, {capture: true, once: true});
aWindow.gBrowser.selectedBrowser.loadURI(testURI);
};
}
function openPrivateBrowsingModeByUI(aWindow, aCallback) {
Services.obs.addObserver(function observer(aSubject, aTopic, aData) {
@ -47,7 +47,7 @@ function test() {
cmd = aWindow.document.getElementById("Tools:PrivateBrowsing");
var func = new Function("", cmd.getAttribute("oncommand"));
func.call(cmd);
};
}
function testOnWindow(aOptions, aCallback) {
whenNewWindowLoaded(aOptions, function(aWin) {
@ -57,7 +57,7 @@ function test() {
// call whenNewWindowLoaded() instead of testOnWindow() on your test.
executeSoon(() => aCallback(aWin));
});
};
}
// this function is called after calling finish() on the test.
registerCleanupFunction(function() {