Bug 1311345 - Enable eslint of browser/components/privatebrowsing/ - Final manual fixes. r=jaws

MozReview-Commit-ID: 66ds8Adnsta

--HG--
extra : rebase_source : 0c49c6d4ac351145b857e32ff4897dc9b045c9cd
This commit is contained in:
Mark Banner 2017-02-28 13:17:42 +00:00
parent d74b9431a6
commit bb4287f8fb
14 changed files with 26 additions and 27 deletions

View File

@ -18,8 +18,8 @@ function* openAboutPrivateBrowsing() {
*/
function* testLinkOpensTab({ win, tab, elementId, expectedUrl }) {
let newTabPromise = BrowserTestUtils.waitForNewTab(win.gBrowser, expectedUrl);
yield ContentTask.spawn(tab, { elementId }, function* ({ elementId }) {
content.document.getElementById(elementId).click();
yield ContentTask.spawn(tab, elementId, function* (elemId) {
content.document.getElementById(elemId).click();
});
let newTab = yield newTabPromise;
ok(true, `Clicking ${elementId} opened ${expectedUrl} in a new tab.`);
@ -33,8 +33,8 @@ function* testLinkOpensTab({ win, tab, elementId, expectedUrl }) {
*/
function* testLinkOpensUrl({ win, tab, elementId, expectedUrl }) {
let loadedPromise = BrowserTestUtils.browserLoaded(tab);
yield ContentTask.spawn(tab, { elementId }, function* ({ elementId }) {
content.document.getElementById(elementId).click();
yield ContentTask.spawn(tab, elementId, function* (elemId) {
content.document.getElementById(elemId).click();
});
yield loadedPromise;
is(tab.currentURI.spec, expectedUrl,

View File

@ -22,7 +22,7 @@ function test() {
sanitizeCache();
let nrEntriesR1 = getStorageEntryCount("regular", function(nrEntriesR1) {
getStorageEntryCount("regular", function(nrEntriesR1) {
is(nrEntriesR1, 0, "Disk cache reports 0KB and has no entries");
get_cache_for_private_window();

View File

@ -12,18 +12,18 @@
}
}
if (oGetVars.initial == 'true') {
if (oGetVars.initial == "true") {
localStorage.clear();
}
if (oGetVars.action == 'set') {
if (oGetVars.action == "set") {
localStorage.setItem(oGetVars.name, oGetVars.value);
document.title = localStorage.getItem(oGetVars.name) + "|" + localStorage.length;
} else if (oGetVars.action == 'get') {
} else if (oGetVars.action == "get") {
document.title = localStorage.getItem(oGetVars.name) + "|" + localStorage.length;
}
if (oGetVars.final == 'true') {
if (oGetVars.final == "true") {
localStorage.clear();
}
</script>

View File

@ -30,8 +30,8 @@ function assertWindowIsPrivate(win) {
"The parent window should be using private browsing");
return ContentTask.spawn(win.gBrowser.selectedBrowser, null, function*() {
let loadContext = docShell.QueryInterface(Ci.nsILoadContext);
Assert.ok(loadContext.usePrivateBrowsing,
let contentLoadContext = docShell.QueryInterface(Ci.nsILoadContext);
Assert.ok(contentLoadContext.usePrivateBrowsing,
"Content docShell should be using private browsing");
});
}

View File

@ -81,10 +81,10 @@ function test() {
testOnWindow(false, function(win, downloadDir) {
testDownloadDir(win, downloadDir, file1, tmpDir, dir1, dir1, function() {
testOnWindow(true, function(win, downloadDir) {
testDownloadDir(win, downloadDir, file2, dir1, dir1, dir2, function() {
testOnWindow(false, function(win, downloadDir) {
testDownloadDir(win, downloadDir, file3, dir1, dir3, dir3, finish);
testOnWindow(true, function(win1, downloadDir1) {
testDownloadDir(win1, downloadDir1, file2, dir1, dir1, dir2, function() {
testOnWindow(false, function(win2, downloadDir2) {
testDownloadDir(win2, downloadDir2, file3, dir1, dir3, dir3, finish);
});
});
});

View File

@ -83,10 +83,10 @@ function test() {
testOnWindow(false, function(win, downloadDir) {
testDownloadDir(win, downloadDir, file1, tmpDir, dir1, dir1, function() {
testOnWindow(true, function(win, downloadDir) {
testDownloadDir(win, downloadDir, file2, dir1, dir1, dir2, function() {
testOnWindow(false, function(win, downloadDir) {
testDownloadDir(win, downloadDir, file3, dir1, dir3, dir3, finish);
testOnWindow(true, function(win1, downloadDir1) {
testDownloadDir(win1, downloadDir1, file2, dir1, dir1, dir2, function() {
testOnWindow(false, function(win2, downloadDir2) {
testDownloadDir(win2, downloadDir2, file3, dir1, dir3, dir3, finish);
});
});
});

View File

@ -19,7 +19,7 @@ add_task(function* test() {
// Wait until the notification is available.
while (!notification) {
yield new Promise(resolve => { executeSoon(resolve); });
let notification = aWindow.PopupNotifications.getNotification("geolocation");
notification = aWindow.PopupNotifications.getNotification("geolocation");
}
if (aPrivateMode) {

View File

@ -5,7 +5,7 @@
</head>
<body>
<script type="text/javascript">
navigator.geolocation.getCurrentPosition(function (pos) {
navigator.geolocation.getCurrentPosition(function(pos) {
// ignore
});
</script>

View File

@ -9,7 +9,7 @@
let win = yield BrowserTestUtils.openNewBrowserWindow({private: true});
let tab = win.gBrowser.selectedTab = win.gBrowser.addTab(page1);
win.gBrowser.selectedTab = win.gBrowser.addTab(page1);
let browser = win.gBrowser.selectedBrowser;
yield BrowserTestUtils.browserLoaded(browser);

View File

@ -11,7 +11,6 @@
// existing.
add_task(function* test() {
let testURI = "about:blank";
let prefix = "http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/";
// Step 1.

View File

@ -2,7 +2,7 @@
<head>
<script type="text/javascript">
localStorage.clear();
localStorage.setItem('zzztest', 'zzzvalue');
localStorage.setItem("zzztest", "zzzvalue");
document.title = localStorage.length;
</script>
</head>

View File

@ -1,7 +1,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
document.title = localStorage.getItem('zzztest', 'zzzvalue') + '|' + localStorage.length;
document.title = localStorage.getItem("zzztest", "zzzvalue") + "|" + localStorage.length;
localStorage.clear();
</script>
</head>

View File

@ -2,7 +2,7 @@
<head>
<script type="text/javascript">
localStorage.clear();
localStorage.setItem('test1', 'value1');
localStorage.setItem("test1", "value1");
</script>
</head>
<body>

View File

@ -1,7 +1,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
localStorage.setItem('test2', 'value2');
localStorage.setItem("test2", "value2");
document.title = localStorage.length;
</script>
</head>