forked from mirrors/gecko-dev
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:
parent
df691cbbcd
commit
3aa7e13c6a
9 changed files with 18 additions and 19 deletions
|
|
@ -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/test/urlbar/file_blank_but_not_blank.html
|
||||||
browser/base/content/newtab/**
|
browser/base/content/newtab/**
|
||||||
browser/components/downloads/**
|
browser/components/downloads/**
|
||||||
browser/components/privatebrowsing/**
|
|
||||||
browser/components/sessionstore/**
|
browser/components/sessionstore/**
|
||||||
browser/components/tabview/**
|
browser/components/tabview/**
|
||||||
# generated files in cld2
|
# generated files in cld2
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ add_task(function* test() {
|
||||||
|
|
||||||
function getElts(browser) {
|
function getElts(browser) {
|
||||||
return browser.contentTitle.split('|');
|
return browser.contentTitle.split('|');
|
||||||
};
|
}
|
||||||
|
|
||||||
// Step 1
|
// Step 1
|
||||||
let non_private_browser = gBrowser.selectedBrowser;
|
let non_private_browser = gBrowser.selectedBrowser;
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,15 @@
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var oGetVars = {};
|
var oGetVars = {};
|
||||||
|
|
||||||
if (window.location.search.length > 1) {
|
if (window.location.search.length > 1) {
|
||||||
for (var aItKey, nKeyId = 0, aCouples = window.location.search.substr(1).split("&");
|
for (var aItKey, nKeyId = 0, aCouples = window.location.search.substr(1).split("&");
|
||||||
nKeyId < aCouples.length;
|
nKeyId < aCouples.length;
|
||||||
nKeyId++) {
|
nKeyId++) {
|
||||||
aItKey = aCouples[nKeyId].split("=");
|
aItKey = aCouples[nKeyId].split("=");
|
||||||
oGetVars[unescape(aItKey[0])] = aItKey.length > 1 ? unescape(aItKey[1]) : "";
|
oGetVars[unescape(aItKey[0])] = aItKey.length > 1 ? unescape(aItKey[1]) : "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (oGetVars.initial == 'true') {
|
if (oGetVars.initial == 'true') {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* 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.
|
// is disabled inside the private browsing mode.
|
||||||
|
|
||||||
add_task(function* test() {
|
add_task(function* test() {
|
||||||
|
|
@ -14,7 +14,7 @@ add_task(function* test() {
|
||||||
"PrivateBrowsingUtils should report the correct per-window private browsing status");
|
"PrivateBrowsingUtils should report the correct per-window private browsing status");
|
||||||
is(crhCommand.hasAttribute("disabled"), aPrivateMode,
|
is(crhCommand.hasAttribute("disabled"), aPrivateMode,
|
||||||
"Clear Recent History command should be disabled according to the private browsing mode");
|
"Clear Recent History command should be disabled according to the private browsing mode");
|
||||||
};
|
}
|
||||||
|
|
||||||
let testURI = "http://mochi.test:8888/";
|
let testURI = "http://mochi.test:8888/";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ function waitOnFaviconLoaded(aFaviconURL) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function* assignCookies(aBrowser, aURL, aCookieValue){
|
function* assignCookies(aBrowser, aURL, aCookieValue) {
|
||||||
let tabInfo = yield openTab(aBrowser, aURL);
|
let tabInfo = yield openTab(aBrowser, aURL);
|
||||||
|
|
||||||
yield ContentTask.spawn(tabInfo.browser, aCookieValue, function* (value) {
|
yield ContentTask.spawn(tabInfo.browser, aCookieValue, function* (value) {
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ add_task(function* test() {
|
||||||
let notification = aWindow.PopupNotifications.getNotification("geolocation");
|
let notification = aWindow.PopupNotifications.getNotification("geolocation");
|
||||||
|
|
||||||
// Wait until the notification is available.
|
// Wait until the notification is available.
|
||||||
while (!notification){
|
while (!notification) {
|
||||||
yield new Promise(resolve => { executeSoon(resolve); });
|
yield new Promise(resolve => { executeSoon(resolve); });
|
||||||
let notification = aWindow.PopupNotifications.getNotification("geolocation");
|
let notification = aWindow.PopupNotifications.getNotification("geolocation");
|
||||||
}
|
}
|
||||||
|
|
@ -32,7 +32,7 @@ add_task(function* test() {
|
||||||
|
|
||||||
aWindow.gBrowser.removeCurrentTab();
|
aWindow.gBrowser.removeCurrentTab();
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
let win = yield BrowserTestUtils.openNewBrowserWindow();
|
let win = yield BrowserTestUtils.openNewBrowserWindow();
|
||||||
let browser = win.gBrowser.selectedBrowser;
|
let browser = win.gBrowser.selectedBrowser;
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ function test() {
|
||||||
ok(!privateWindow.gLastOpenDirectory.path,
|
ok(!privateWindow.gLastOpenDirectory.path,
|
||||||
"No original path should exist inside the private browsing mode");
|
"No original path should exist inside the private browsing mode");
|
||||||
privateWindow.gLastOpenDirectory.path = dir1;
|
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");
|
"The path should be successfully set inside the private browsing mode");
|
||||||
// test the non-private window
|
// test the non-private window
|
||||||
ok(!nonPrivateWindow.gLastOpenDirectory.path,
|
ok(!nonPrivateWindow.gLastOpenDirectory.path,
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ add_task(function* test() {
|
||||||
|
|
||||||
PlacesUtils.history.addObserver(historyObserver, false);
|
PlacesUtils.history.addObserver(historyObserver, false);
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
yield PlacesTestUtils.clearHistory();
|
yield PlacesTestUtils.clearHistory();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ function test() {
|
||||||
}, {capture: true, once: true});
|
}, {capture: true, once: true});
|
||||||
|
|
||||||
aWindow.gBrowser.selectedBrowser.loadURI(testURI);
|
aWindow.gBrowser.selectedBrowser.loadURI(testURI);
|
||||||
};
|
}
|
||||||
|
|
||||||
function openPrivateBrowsingModeByUI(aWindow, aCallback) {
|
function openPrivateBrowsingModeByUI(aWindow, aCallback) {
|
||||||
Services.obs.addObserver(function observer(aSubject, aTopic, aData) {
|
Services.obs.addObserver(function observer(aSubject, aTopic, aData) {
|
||||||
|
|
@ -47,7 +47,7 @@ function test() {
|
||||||
cmd = aWindow.document.getElementById("Tools:PrivateBrowsing");
|
cmd = aWindow.document.getElementById("Tools:PrivateBrowsing");
|
||||||
var func = new Function("", cmd.getAttribute("oncommand"));
|
var func = new Function("", cmd.getAttribute("oncommand"));
|
||||||
func.call(cmd);
|
func.call(cmd);
|
||||||
};
|
}
|
||||||
|
|
||||||
function testOnWindow(aOptions, aCallback) {
|
function testOnWindow(aOptions, aCallback) {
|
||||||
whenNewWindowLoaded(aOptions, function(aWin) {
|
whenNewWindowLoaded(aOptions, function(aWin) {
|
||||||
|
|
@ -57,7 +57,7 @@ function test() {
|
||||||
// call whenNewWindowLoaded() instead of testOnWindow() on your test.
|
// call whenNewWindowLoaded() instead of testOnWindow() on your test.
|
||||||
executeSoon(() => aCallback(aWin));
|
executeSoon(() => aCallback(aWin));
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
// this function is called after calling finish() on the test.
|
// this function is called after calling finish() on the test.
|
||||||
registerCleanupFunction(function() {
|
registerCleanupFunction(function() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue