From 415ae552bb124f23c72c0df7ba26d76fe68dd15f Mon Sep 17 00:00:00 2001
From: Toby Ward
Date: Tue, 6 Nov 2018 14:48:43 +0000
Subject: [PATCH] Bug 1496082: Enable ESLint for docshell/test/navigation and
docshell/test/unit (automatic fixes only). r=bzbarsky
Enabled ESLint for:
* docshell/test/navigation/**
* docshell/test/unit/**
* docshell/test/unit_ipc/**
Changed .eslintignore to allow for this and ran ./mach eslint --fix on the above directories and checked automatic fixes
Differential Revision: https://phabricator.services.mozilla.com/D9430
--HG--
extra : moz-landing-system : lando
---
.eslintignore | 6 +-
docshell/test/navigation/NavigationUtils.js | 40 ++---
.../test/navigation/bluebox_bug430723.html | 2 +-
.../browser_test-content-chromeflags.js | 4 +-
docshell/test/navigation/file_bug1300461.html | 28 ++--
.../test/navigation/file_bug1300461_back.html | 12 +-
docshell/test/navigation/file_bug1326251.html | 148 +++++++++---------
docshell/test/navigation/file_bug1375833.html | 2 +-
.../test/navigation/file_bug1379762-1.html | 2 +-
.../file_bug386782_contenteditable.html | 2 +-
.../navigation/file_bug386782_designmode.html | 2 +-
.../test/navigation/file_bug462076_1.html | 2 +-
.../test/navigation/file_bug462076_2.html | 2 +-
.../test/navigation/file_bug462076_3.html | 2 +-
.../test/navigation/file_bug508537_1.html | 2 +-
docshell/test/navigation/file_bug534178.html | 2 +-
.../navigation/file_scrollRestoration.html | 12 +-
.../file_shiftReload_and_pushState.html | 2 +-
.../file_triggeringprincipal_frame_1.html | 10 +-
.../file_triggeringprincipal_subframe.html | 4 +-
...file_triggeringprincipal_subframe_nav.html | 2 +-
docshell/test/navigation/navigate.html | 2 +-
.../test/navigation/redbox_bug430723.html | 2 +-
docshell/test/navigation/test_bug270414.html | 2 +-
docshell/test/navigation/test_bug278916.html | 10 +-
docshell/test/navigation/test_bug279495.html | 10 +-
docshell/test/navigation/test_bug344861.html | 4 +-
docshell/test/navigation/test_bug386782.html | 24 +--
docshell/test/navigation/test_bug430624.html | 2 +-
docshell/test/navigation/test_bug430723.html | 50 +++---
docshell/test/navigation/test_child.html | 2 +-
.../test_contentpolicy_block_window.html | 13 +-
docshell/test/navigation/test_grandchild.html | 4 +-
docshell/test/navigation/test_not-opener.html | 10 +-
docshell/test/navigation/test_opener.html | 4 +-
docshell/test/navigation/test_reserved.html | 4 +-
.../test/navigation/test_sessionhistory.html | 4 +-
.../test_sibling-matching-parent.html | 6 +-
.../navigation/test_sibling-off-domain.html | 6 +-
...ngprincipal_iframe_iframe_window_open.html | 20 +--
...ngprincipal_parent_iframe_window_open.html | 18 +--
.../test_triggeringprincipal_window_open.html | 4 +-
docshell/test/unit/test_nsDefaultURIFixup.js | 46 +++---
.../test/unit/test_nsDefaultURIFixup_info.js | 32 ++--
.../unit/test_nsDefaultURIFixup_search.js | 58 ++++---
docshell/test/unit/test_pb_notification.js | 6 +-
docshell/test/unit/test_privacy_transition.js | 18 +--
.../test/unit_ipc/test_pb_notification_ipc.js | 8 +-
48 files changed, 324 insertions(+), 333 deletions(-)
diff --git a/.eslintignore b/.eslintignore
index bdb10c6ae230..467562a1d8b5 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -14,7 +14,11 @@ obj*/**
# We ignore all these directories by default, until we get them enabled.
# If you are enabling a directory, please add directory specific exclusions
# below.
-docshell/**
+docshell/resources/**
+docshell/test/browser/**
+docshell/test/chrome/**
+docshell/test/iframesandbox/**
+docshell/test/mochitest/**
extensions/cookie/**
extensions/spellcheck/**
extensions/universalchardet/**
diff --git a/docshell/test/navigation/NavigationUtils.js b/docshell/test/navigation/NavigationUtils.js
index 219c5cbabf39..136fd31703af 100644
--- a/docshell/test/navigation/NavigationUtils.js
+++ b/docshell/test/navigation/NavigationUtils.js
@@ -2,26 +2,26 @@
* 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/. */
-///////////////////////////////////////////////////////////////////////////
+// /////////////////////////////////////////////////////////////////////////
//
// Utilities for navigation tests
-//
-///////////////////////////////////////////////////////////////////////////
+//
+// /////////////////////////////////////////////////////////////////////////
var body = "This frame was navigated.";
-var target_url = "navigation_target_url.html"
+var target_url = "navigation_target_url.html";
var popup_body = "This is a popup";
var target_popup_url = "navigation_target_popup_url.html";
-///////////////////////////////////////////////////////////////////////////
+// /////////////////////////////////////////////////////////////////////////
// Functions that navigate frames
-///////////////////////////////////////////////////////////////////////////
+// /////////////////////////////////////////////////////////////////////////
function navigateByLocation(wnd) {
try {
wnd.location = target_url;
- } catch(ex) {
+ } catch (ex) {
// We need to keep our finished frames count consistent.
// Oddly, this ends up simulating the behavior of IE7.
window.open(target_url, "_blank", "width=10,height=10");
@@ -48,18 +48,18 @@ function navigateByHyperlink(name) {
link.target = name;
link.id = "navigation_hyperlink_" + hyperlink_count++;
document.body.appendChild(link);
- sendMouseEvent({type:"click"}, link.id);
+ sendMouseEvent({type: "click"}, link.id);
}
-///////////////////////////////////////////////////////////////////////////
+// /////////////////////////////////////////////////////////////////////////
// Functions that call into Mochitest framework
-///////////////////////////////////////////////////////////////////////////
+// /////////////////////////////////////////////////////////////////////////
function isNavigated(wnd, message) {
var result = null;
try {
result = SpecialPowers.wrap(wnd).document.body.innerHTML.trim();
- } catch(ex) {
+ } catch (ex) {
result = ex;
}
is(result, body, message);
@@ -69,7 +69,7 @@ function isBlank(wnd, message) {
var result = null;
try {
result = wnd.document.body.innerHTML.trim();
- } catch(ex) {
+ } catch (ex) {
result = ex;
}
is(result, "This is a blank document.", message);
@@ -79,7 +79,7 @@ function isAccessible(wnd, message) {
try {
wnd.document.body.innerHTML;
ok(true, message);
- } catch(ex) {
+ } catch (ex) {
ok(false, message);
}
}
@@ -88,14 +88,14 @@ function isInaccessible(wnd, message) {
try {
wnd.document.body.innerHTML;
ok(false, message);
- } catch(ex) {
+ } catch (ex) {
ok(true, message);
}
}
-///////////////////////////////////////////////////////////////////////////
+// /////////////////////////////////////////////////////////////////////////
// Functions that require UniversalXPConnect privilege
-///////////////////////////////////////////////////////////////////////////
+// /////////////////////////////////////////////////////////////////////////
function xpcEnumerateContentWindows(callback) {
@@ -178,10 +178,10 @@ function xpcWaitForFinishedFrames(callback, numFrames) {
function searchForFinishedFrames(win) {
if ((win.location.href.endsWith(target_url) ||
win.location.href.endsWith(target_popup_url)) &&
- win.document &&
- win.document.body &&
+ win.document &&
+ win.document.body &&
(win.document.body.textContent.trim() == body ||
- win.document.body.textContent.trim() == popup_body) &&
+ win.document.body.textContent.trim() == popup_body) &&
win.document.readyState == "complete") {
var windowId = win.windowUtils.outerWindowID;
@@ -199,7 +199,7 @@ function xpcWaitForFinishedFrames(callback, numFrames) {
// This only gives us UniversalXPConnect for the current stack frame
// We're using setInterval, so the main page's privileges are still normal
xpcEnumerateContentWindows(searchForFinishedFrames);
- } catch(ex) {
+ } catch (ex) {
// We might be accessing windows before they are fully constructed,
// which can throw. We'll find those frames on our next poll().
}
diff --git a/docshell/test/navigation/bluebox_bug430723.html b/docshell/test/navigation/bluebox_bug430723.html
index 0569ddcfa460..5dcc53356282 100644
--- a/docshell/test/navigation/bluebox_bug430723.html
+++ b/docshell/test/navigation/bluebox_bug430723.html
@@ -1,5 +1,5 @@
-
+
This is a very tall blue box.
diff --git a/docshell/test/navigation/browser_test-content-chromeflags.js b/docshell/test/navigation/browser_test-content-chromeflags.js
index 17c8e2473df2..be8d748bc629 100644
--- a/docshell/test/navigation/browser_test-content-chromeflags.js
+++ b/docshell/test/navigation/browser_test-content-chromeflags.js
@@ -13,13 +13,13 @@ add_task(async function() {
SpecialPowers.pushPrefEnv({
"set": [
["browser.link.open_newwindow", 2],
- ]
+ ],
}, resolve);
});
await BrowserTestUtils.withNewTab({
gBrowser,
- url: TEST_PAGE
+ url: TEST_PAGE,
}, async function(browser) {
let openedPromise = BrowserTestUtils.waitForNewWindow();
BrowserTestUtils.synthesizeMouse("a", 0, 0, {}, browser);
diff --git a/docshell/test/navigation/file_bug1300461.html b/docshell/test/navigation/file_bug1300461.html
index bb7e827d98e2..eb77f74184e0 100644
--- a/docshell/test/navigation/file_bug1300461.html
+++ b/docshell/test/navigation/file_bug1300461.html
@@ -30,31 +30,31 @@
let shistory = webNav.sessionHistory;
let testSteps = [
function() {
- opener.is(shistory.count, 1, 'check history length');
- opener.is(shistory.index, 0, 'check history index');
- opener.ok(!webNav.canGoForward, 'check canGoForward');
- setTimeout(() => window.location = 'file_bug1300461_back.html', 0);
+ opener.is(shistory.count, 1, "check history length");
+ opener.is(shistory.index, 0, "check history index");
+ opener.ok(!webNav.canGoForward, "check canGoForward");
+ setTimeout(() => window.location = "file_bug1300461_back.html", 0);
},
function() {
- opener.is(shistory.count, 2, 'check history length');
- opener.is(shistory.index, 0, 'check history index');
- opener.ok(webNav.canGoForward, 'check canGoForward');
+ opener.is(shistory.count, 2, "check history length");
+ opener.is(shistory.index, 0, "check history index");
+ opener.ok(webNav.canGoForward, "check canGoForward");
window.history.forward();
- opener.is(shistory.legacySHistory.requestedIndex, 1, 'check requestedIndex');
+ opener.is(shistory.legacySHistory.requestedIndex, 1, "check requestedIndex");
},
function() {
- opener.is(shistory.count, 2, 'check history length');
- opener.is(shistory.index, 0, 'check history index');
- opener.ok(webNav.canGoForward, 'check canGoForward');
- opener.info('file_bug1300461.html tests finished');
+ opener.is(shistory.count, 2, "check history length");
+ opener.is(shistory.index, 0, "check history index");
+ opener.ok(webNav.canGoForward, "check canGoForward");
+ opener.info("file_bug1300461.html tests finished");
opener.nextTest();
window.close();
- }
+ },
];
function test() {
if (opener) {
- opener.info('file_bug1300461.html test ' + opener.testCount);
+ opener.info("file_bug1300461.html test " + opener.testCount);
testSteps[opener.testCount++]();
}
}
diff --git a/docshell/test/navigation/file_bug1300461_back.html b/docshell/test/navigation/file_bug1300461_back.html
index 7f2488e27a81..5803d174c7c9 100644
--- a/docshell/test/navigation/file_bug1300461_back.html
+++ b/docshell/test/navigation/file_bug1300461_back.html
@@ -15,13 +15,13 @@
function test() {
if (opener) {
opener.info("file_bug1300461_back.html");
- opener.is(shistory.count, 2, 'check history length');
- opener.is(shistory.index, 1, 'check history index');
- opener.is(shistory.legacySHistory.requestedIndex, -1, 'check requestedIndex');
- opener.ok(webNav.canGoBack, 'check canGoBack');
+ opener.is(shistory.count, 2, "check history length");
+ opener.is(shistory.index, 1, "check history index");
+ opener.is(shistory.legacySHistory.requestedIndex, -1, "check requestedIndex");
+ opener.ok(webNav.canGoBack, "check canGoBack");
if (opener.testCount == 1) {
- opener.info('replaceState to redirect.html');
- window.history.replaceState({}, '', 'file_bug1300461_redirect.html');
+ opener.info("replaceState to redirect.html");
+ window.history.replaceState({}, "", "file_bug1300461_redirect.html");
}
window.history.back();
}
diff --git a/docshell/test/navigation/file_bug1326251.html b/docshell/test/navigation/file_bug1326251.html
index 168100329388..c8052dc1793c 100644
--- a/docshell/test/navigation/file_bug1326251.html
+++ b/docshell/test/navigation/file_bug1326251.html
@@ -4,7 +4,7 @@
Bug 1326251
diff --git a/docshell/test/navigation/file_bug1379762-1.html b/docshell/test/navigation/file_bug1379762-1.html
index e8cd8b30b49f..d060a4d1e951 100644
--- a/docshell/test/navigation/file_bug1379762-1.html
+++ b/docshell/test/navigation/file_bug1379762-1.html
@@ -27,6 +27,6 @@
onload = function() {
++loadCount;
opener.is(loadCount, 1, "Should only get one onload");
- }
+ };
diff --git a/docshell/test/navigation/file_bug386782_contenteditable.html b/docshell/test/navigation/file_bug386782_contenteditable.html
index b4a2329df286..4515d015d9c1 100644
--- a/docshell/test/navigation/file_bug386782_contenteditable.html
+++ b/docshell/test/navigation/file_bug386782_contenteditable.html
@@ -1 +1 @@
-
contentEditable
\ No newline at end of file
+
contentEditable
\ No newline at end of file
diff --git a/docshell/test/navigation/file_bug386782_designmode.html b/docshell/test/navigation/file_bug386782_designmode.html
index 592b5259232c..faa063cbaec9 100644
--- a/docshell/test/navigation/file_bug386782_designmode.html
+++ b/docshell/test/navigation/file_bug386782_designmode.html
@@ -1 +1 @@
-
designModeDocument
\ No newline at end of file
+
designModeDocument
\ No newline at end of file
diff --git a/docshell/test/navigation/file_bug462076_1.html b/docshell/test/navigation/file_bug462076_1.html
index 0aafa9bda1a8..3a71243d5717 100644
--- a/docshell/test/navigation/file_bug462076_1.html
+++ b/docshell/test/navigation/file_bug462076_1.html
@@ -29,7 +29,7 @@
function checkFrame(evt) {
var ifr = evt.target;
opener.ok(new String(ifr.contentWindow.location).includes(ifr.src),
- "Wrong document loaded (" + ifr.src + ", " +
+ "Wrong document loaded (" + ifr.src + ", " +
ifr.contentWindow.location + ")!");
if (++checkCount == 4) {
diff --git a/docshell/test/navigation/file_bug462076_2.html b/docshell/test/navigation/file_bug462076_2.html
index 936099e5773a..50f0d340cd42 100644
--- a/docshell/test/navigation/file_bug462076_2.html
+++ b/docshell/test/navigation/file_bug462076_2.html
@@ -29,7 +29,7 @@
function checkFrame(evt) {
var ifr = evt.target;
opener.ok(new String(ifr.contentWindow.location).includes(ifr.src),
- "Wrong document loaded (" + ifr.src + ", " +
+ "Wrong document loaded (" + ifr.src + ", " +
ifr.contentWindow.location + ")!");
if (++checkCount == 4) {
diff --git a/docshell/test/navigation/file_bug462076_3.html b/docshell/test/navigation/file_bug462076_3.html
index 05713df44af9..7bedc11b23c9 100644
--- a/docshell/test/navigation/file_bug462076_3.html
+++ b/docshell/test/navigation/file_bug462076_3.html
@@ -29,7 +29,7 @@
function checkFrame(evt) {
var ifr = evt.target;
opener.ok(new String(ifr.contentWindow.location).includes(ifr.src),
- "Wrong document loaded (" + ifr.src + ", " +
+ "Wrong document loaded (" + ifr.src + ", " +
ifr.contentWindow.location + ")!");
if (++checkCount == 4) {
diff --git a/docshell/test/navigation/file_bug508537_1.html b/docshell/test/navigation/file_bug508537_1.html
index 0531cbea7de5..414f3bc7bbbe 100644
--- a/docshell/test/navigation/file_bug508537_1.html
+++ b/docshell/test/navigation/file_bug508537_1.html
@@ -16,7 +16,7 @@
}
window.addEventListener("load",
- function () {
+ function() {
var container = document.getElementById("t1");
container.addEventListener("load", dynFrameLoad, true);
container.appendChild(container.appendChild(document.getElementById("i1")));
diff --git a/docshell/test/navigation/file_bug534178.html b/docshell/test/navigation/file_bug534178.html
index 56647e17071e..5cf4764e8077 100644
--- a/docshell/test/navigation/file_bug534178.html
+++ b/docshell/test/navigation/file_bug534178.html
@@ -7,7 +7,7 @@
var isOK = false;
try {
isOK = history.previous != location;
- } catch(ex) {
+ } catch (ex) {
// history.previous should throw if this is the first page in shistory.
isOK = true;
}
diff --git a/docshell/test/navigation/file_scrollRestoration.html b/docshell/test/navigation/file_scrollRestoration.html
index 9a938003c746..4dcc4961a141 100644
--- a/docshell/test/navigation/file_scrollRestoration.html
+++ b/docshell/test/navigation/file_scrollRestoration.html
@@ -29,7 +29,7 @@
opener.isnot(Math.round(window.scrollY), 0, "Should have restored scrolling.");
opener.is(history.scrollRestoration, "auto", "Should have the same scrollRestoration as before reload.");
history.scrollRestoration = "manual";
- window.onunload = function() {} // Disable bfcache.
+ window.onunload = function() {}; // Disable bfcache.
window.location.reload(false);
break;
}
@@ -40,7 +40,7 @@
document.getElementById("bottom").scrollIntoView();
window.onunload = null; // Should get bfcache behavior.
opener.setTimeout("SpecialPowers.wrap(testWindow).history.back();", 250);
- window.location.href = 'about:blank';
+ window.location.href = "about:blank";
break;
}
case 4: {
@@ -55,9 +55,9 @@
case 5: {
opener.isnot(Math.round(window.scrollY), 0, "Should have scrolled to #hash.");
opener.is(history.scrollRestoration, "manual", "Should have the same scrollRestoration mode as before fragment navigation.");
- window.onunload = function() {} // Disable bfcache.
+ window.onunload = function() {}; // Disable bfcache.
opener.setTimeout("is(SpecialPowers.wrap(testWindow).history.scrollRestoration, 'auto'); SpecialPowers.wrap(testWindow).history.back();", 250);
- window.location.href = 'about:blank';
+ window.location.href = "about:blank";
break;
}
case 6: {
@@ -106,13 +106,13 @@
try {
var sr = oldHistoryObject.scrollRestoration;
opener.ok(false, "Should have thrown an exception.");
- } catch(ex) {
+ } catch (ex) {
opener.isnot(ex, null, "Did get an exception");
}
try {
oldHistoryObject.scrollRestoration = "auto";
opener.ok(false, "Should have thrown an exception.");
- } catch(ex) {
+ } catch (ex) {
opener.isnot(ex, null, "Did get an exception");
}
opener.nextTest();
diff --git a/docshell/test/navigation/file_shiftReload_and_pushState.html b/docshell/test/navigation/file_shiftReload_and_pushState.html
index 5a777894b672..4e2bd03dbeb4 100644
--- a/docshell/test/navigation/file_shiftReload_and_pushState.html
+++ b/docshell/test/navigation/file_shiftReload_and_pushState.html
@@ -4,7 +4,7 @@
function test() {
try {
frames[0].history.pushState({}, "state", "?pushed");
- } catch(ex) {
+ } catch (ex) {
opener.ok(false, "history.pushState shouldn't throw");
}
diff --git a/docshell/test/navigation/file_triggeringprincipal_frame_1.html b/docshell/test/navigation/file_triggeringprincipal_frame_1.html
index 855d4b9df1d0..528437f892a9 100644
--- a/docshell/test/navigation/file_triggeringprincipal_frame_1.html
+++ b/docshell/test/navigation/file_triggeringprincipal_frame_1.html
@@ -8,18 +8,18 @@
diff --git a/docshell/test/navigation/file_triggeringprincipal_subframe.html b/docshell/test/navigation/file_triggeringprincipal_subframe.html
index 0db1349f2f95..ba6b6dc09a1c 100644
--- a/docshell/test/navigation/file_triggeringprincipal_subframe.html
+++ b/docshell/test/navigation/file_triggeringprincipal_subframe.html
@@ -6,9 +6,9 @@
This is a very tall red box.
diff --git a/docshell/test/navigation/test_bug270414.html b/docshell/test/navigation/test_bug270414.html
index 98dcf42f8df1..1c250ebd22fe 100644
--- a/docshell/test/navigation/test_bug270414.html
+++ b/docshell/test/navigation/test_bug270414.html
@@ -10,7 +10,7 @@
diff --git a/docshell/test/navigation/test_bug279495.html b/docshell/test/navigation/test_bug279495.html
index 79a169567774..0cbc9dec75ef 100644
--- a/docshell/test/navigation/test_bug279495.html
+++ b/docshell/test/navigation/test_bug279495.html
@@ -6,12 +6,12 @@
diff --git a/docshell/test/navigation/test_bug344861.html b/docshell/test/navigation/test_bug344861.html
index f9759751c966..4cc2eed1a3eb 100644
--- a/docshell/test/navigation/test_bug344861.html
+++ b/docshell/test/navigation/test_bug344861.html
@@ -21,12 +21,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=344861
SimpleTest.waitForExplicitFinish();
var newwindow = window.open("/", "testwindow", "width=200,height=200");
-newwindow.onload = function() {
+newwindow.onload = function() {
is(newwindow.innerHeight, 200, "window.open has correct height dimensions");
is(newwindow.innerWidth, 200, "window.open has correct width dimensions");
SimpleTest.finish();
newwindow.close();
-}
+};
diff --git a/docshell/test/navigation/test_bug386782.html b/docshell/test/navigation/test_bug386782.html
index 64dfc0dd0733..1f11a93821c4 100644
--- a/docshell/test/navigation/test_bug386782.html
+++ b/docshell/test/navigation/test_bug386782.html
@@ -21,20 +21,20 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=386782
{
//
designModeDocument
url: "file_bug386782_designmode.html",
- name: 'designModeNavigate',
+ name: "designModeNavigate",
onload(doc) { doc.designMode = "on"; },
- expectedBodyBeforeEdit: '
designModeDocument
',
- expectedBodyAfterEdit: '
EDITED designModeDocument
',
- expectedBodyAfterSecondEdit: '
EDITED TWICE designModeDocument
',
+ expectedBodyBeforeEdit: "
designModeDocument
",
+ expectedBodyAfterEdit: "
EDITED designModeDocument
",
+ expectedBodyAfterSecondEdit: "
EDITED TWICE designModeDocument
",
},
{
//
contentEditable
url: "file_bug386782_contenteditable.html",
- name: 'contentEditableNavigate',
- expectedBodyBeforeEdit: '
contentEditable
',
- expectedBodyAfterEdit: 'EDITED
contentEditable
',
- expectedBodyAfterSecondEdit: 'EDITED TWICE
contentEditable
',
- }
+ name: "contentEditableNavigate",
+ expectedBodyBeforeEdit: "
contentEditable
",
+ expectedBodyAfterEdit: "EDITED
contentEditable
",
+ expectedBodyAfterSecondEdit: "EDITED TWICE
contentEditable
",
+ },
];
var gTestNum = -1;
@@ -66,10 +66,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=386782
// WARNING: If the following test fails, give the setTimeout() in the onload()
// a bit longer; the doc hasn't had enough time to setup its editor.
is(gTest.window.document.body.innerHTML, gTest.expectedBodyBeforeEdit, "Is doc setup yet");
- sendString('EDITED ', gTest.window);
+ sendString("EDITED ", gTest.window);
is(gTest.window.document.body.innerHTML, gTest.expectedBodyAfterEdit, "Editing failed.");
- gTest.window.location = 'about:blank';
+ gTest.window.location = "about:blank";
SimpleTest.waitForFocus(goBack, gTest.window);
}
@@ -101,7 +101,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=386782
// Check that we can still edit the page.
gTest.window.document.body.focus();
- sendString('TWICE ', gTest.window);
+ sendString("TWICE ", gTest.window);
is(gTest.window.document.body.innerHTML, gTest.expectedBodyAfterSecondEdit, "Can we still edit?");
gTest.window.close();
diff --git a/docshell/test/navigation/test_bug430624.html b/docshell/test/navigation/test_bug430624.html
index 884025a8aea1..edb2f35a2bf5 100644
--- a/docshell/test/navigation/test_bug430624.html
+++ b/docshell/test/navigation/test_bug430624.html
@@ -37,7 +37,7 @@ function onReload() {
function doTest() {
var bodyElement = window.frames[0].frameElement.contentDocument.body;
bodyElement.focus();
- sendString('Still ', window.frames[0].frameElement.contentWindow);
+ sendString("Still ", window.frames[0].frameElement.contentWindow);
is(bodyElement.innerHTML, "Still contentEditable", "Check we're contentEditable after reload");
diff --git a/docshell/test/navigation/test_bug430723.html b/docshell/test/navigation/test_bug430723.html
index d9802c54a5ee..37c1d2b57389 100644
--- a/docshell/test/navigation/test_bug430723.html
+++ b/docshell/test/navigation/test_bug430723.html
@@ -17,7 +17,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=430723
diff --git a/docshell/test/navigation/test_contentpolicy_block_window.html b/docshell/test/navigation/test_contentpolicy_block_window.html
index c597a4529044..a4486b46ee5e 100644
--- a/docshell/test/navigation/test_contentpolicy_block_window.html
+++ b/docshell/test/navigation/test_contentpolicy_block_window.html
@@ -36,6 +36,7 @@ var policyID = SpecialPowers.wrap(SpecialPowers.Components).ID("{b80e19d0-878f-d
var policyName = "@mozilla.org/testpolicy;1";
var policy = {
// nsISupports implementation
+ // eslint-disable-next-line mozilla/use-chromeutils-generatedqi.js
QueryInterface: function(iid) {
iid = SpecialPowers.wrap(iid);
if (iid.equals(Ci.nsISupports) ||
@@ -46,12 +47,12 @@ var policy = {
},
// nsIFactory implementation
- createInstance: function(outer, iid) {
+ createInstance(outer, iid) {
return this.QueryInterface(iid);
},
// nsIContentPolicy implementation
- shouldLoad: function(contentLocation, loadInfo, mimeTypeGuess) {
+ shouldLoad(contentLocation, loadInfo, mimeTypeGuess) {
let contentType = loadInfo.externalContentPolicyType;
let context = loadInfo.loadingContext;
@@ -79,10 +80,10 @@ var policy = {
return Ci.nsIContentPolicy.REJECT_REQUEST;
},
- shouldProcess: function(contentLocation, loadInfo, mimeTypeGuess) {
+ shouldProcess(contentLocation, loadInfo, mimeTypeGuess) {
return Ci.nsIContentPolicy.ACCEPT;
- }
-}
+ },
+};
policy = SpecialPowers.wrapCallbackObject(policy);
componentManager.registerFactory(policyID, "Test content policy", policyName, policy);
@@ -91,7 +92,7 @@ categoryManager.addCategoryEntry("content-policy", policyName, policyName, false
SimpleTest.waitForExplicitFinish();
// now everything is set up, let's start the test
-document.getElementById("testlink").click()
+document.getElementById("testlink").click();
diff --git a/docshell/test/navigation/test_not-opener.html b/docshell/test/navigation/test_not-opener.html
index d778f71d9c93..83ca8f36599b 100644
--- a/docshell/test/navigation/test_not-opener.html
+++ b/docshell/test/navigation/test_not-opener.html
@@ -13,8 +13,8 @@ if (!navigator.platform.startsWith("Win")) {
SimpleTest.expectAssertions(0, 1);
}
-window.onload = function () {
- //navigateByLocation(window0); // Don't have a handle to the window.
+window.onload = function() {
+ // navigateByLocation(window0); // Don't have a handle to the window.
navigateByOpen("window1");
navigateByForm("window2");
navigateByHyperlink("window3");
@@ -24,7 +24,7 @@ window.onload = function () {
is(xpcGetFramesByName("window2").length, 2, "Should not be able to navigate popup's popup by submitting form.");
is(xpcGetFramesByName("window3").length, 2, "Should not be able to navigate popup's popup by targeted hyperlink.");
- //opener0.close();
+ // opener0.close();
opener1.close();
opener2.close();
opener3.close();
@@ -32,9 +32,9 @@ window.onload = function () {
xpcCleanupWindows();
SimpleTest.finish();
}, 6);
-}
+};
-//opener0 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/open.html#window0", "_blank", "width=10,height=10");
+// opener0 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/open.html#window0", "_blank", "width=10,height=10");
opener1 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/open.html#window1", "_blank", "width=10,height=10");
opener2 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/open.html#window2", "_blank", "width=10,height=10");
opener3 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/open.html#window3", "_blank", "width=10,height=10");
diff --git a/docshell/test/navigation/test_opener.html b/docshell/test/navigation/test_opener.html
index bfb1dde9f773..0a7e9288f449 100644
--- a/docshell/test/navigation/test_opener.html
+++ b/docshell/test/navigation/test_opener.html
@@ -13,7 +13,7 @@ if (navigator.platform.startsWith("Linux")) {
SimpleTest.expectAssertions(0, 1);
}
-window.onload = function () {
+window.onload = function() {
navigateByLocation(window0);
navigateByOpen("window1");
navigateByForm("window2");
@@ -33,7 +33,7 @@ window.onload = function () {
xpcCleanupWindows();
SimpleTest.finish();
}, 4);
-}
+};
var window0 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/blank.html", "window0", "width=10,height=10");
var window1 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/blank.html", "window1", "width=10,height=10");
diff --git a/docshell/test/navigation/test_reserved.html b/docshell/test/navigation/test_reserved.html
index b2389078c746..260033a430a5 100644
--- a/docshell/test/navigation/test_reserved.html
+++ b/docshell/test/navigation/test_reserved.html
@@ -22,7 +22,7 @@ function testTop() {
xpcCleanupWindows();
window1 = window.open("iframe.html#http://test1.example.org:80/tests/docshell/test/navigation/navigate.html#_top,open", "_blank", "width=10,height=10");
-
+
xpcWaitForFinishedFrames(function() {
isInaccessible(window1, "Should be able to navigate off-domain top by calling window.open.");
window1.close();
@@ -84,7 +84,7 @@ function testParent() {
window.onload = function() {
testTop();
-}
+};
diff --git a/docshell/test/navigation/test_sessionhistory.html b/docshell/test/navigation/test_sessionhistory.html
index fb4cfc08512c..c2c24f5e5dc1 100644
--- a/docshell/test/navigation/test_sessionhistory.html
+++ b/docshell/test/navigation/test_sessionhistory.html
@@ -25,7 +25,7 @@ var testFiles =
"file_bug462076_3.html", // Dynamic frames after onload
"file_bug508537_1.html", // Dynamic frames and forward-back
"file_document_write_1.html", // Session history + document.write
- //"file_static_and_dynamic_1.html",// Static and dynamic frames and forward-back
+ // "file_static_and_dynamic_1.html",// Static and dynamic frames and forward-back
"file_bug534178.html", // Session history entry clean-up.
"file_fragment_handling_during_load.html",
"file_nested_frames.html",
@@ -48,7 +48,7 @@ function nextTest_() {
let nextFile = testFiles.shift();
info("Running " + nextFile);
testWindow = window.open(nextFile, "", "width=360,height=480");
- testWindow.onunload = function () { } // to prevent bfcache
+ testWindow.onunload = function() { }; // to prevent bfcache
} else {
SimpleTest.finish();
}
diff --git a/docshell/test/navigation/test_sibling-matching-parent.html b/docshell/test/navigation/test_sibling-matching-parent.html
index dc8ec2f905e4..c4881b2442bc 100644
--- a/docshell/test/navigation/test_sibling-matching-parent.html
+++ b/docshell/test/navigation/test_sibling-matching-parent.html
@@ -9,8 +9,8 @@
iframe { width: 90%; height: 50px; }
diff --git a/docshell/test/navigation/test_sibling-off-domain.html b/docshell/test/navigation/test_sibling-off-domain.html
index ba7942798ee6..a02958c9a1b5 100644
--- a/docshell/test/navigation/test_sibling-off-domain.html
+++ b/docshell/test/navigation/test_sibling-off-domain.html
@@ -9,8 +9,8 @@
iframe { width: 90%; height: 50px; }
diff --git a/docshell/test/navigation/test_triggeringprincipal_iframe_iframe_window_open.html b/docshell/test/navigation/test_triggeringprincipal_iframe_iframe_window_open.html
index 0662a01a3332..a1267a4697c2 100644
--- a/docshell/test/navigation/test_triggeringprincipal_iframe_iframe_window_open.html
+++ b/docshell/test/navigation/test_triggeringprincipal_iframe_iframe_window_open.html
@@ -18,16 +18,16 @@
* TriggeringPrincipal and LoadingPrincipal of the navigated iframe (Frame A).
*
* +---------------------------------------+
- * | Parent |
- * | |
+ * | Parent |
+ * | |
* | +----------------------------+ |
- * | | Frame A | |
+ * | | Frame A | |
* | | | |
* | | | |
* | +----------------------------+ |
- * | |
+ * | |
* | +----------------------------+ |
- * | | Frame B | |
+ * | | Frame B | |
* | | | |
* | | win.open("http://", "A") | |
* | +----------------------------+ |
@@ -49,7 +49,7 @@ const LOADING_PRINCIPAL_URI =
var frameA = document.getElementById("framea");
function checkResults() {
- frameA.removeEventListener('load', checkResults);
+ frameA.removeEventListener("load", checkResults);
var channel = SpecialPowers.wrap(frameA.contentWindow).docShell.currentDocumentChannel;
var triggeringPrincipal = channel.loadInfo.triggeringPrincipal.URI.asciiSpec;
@@ -63,13 +63,13 @@ function checkResults() {
is(loadingPrincipal, LOADING_PRINCIPAL_URI,
"LoadingPrincipal for targeted window.open() should be the containing document");
-
+
SimpleTest.finish();
}
function performNavigation() {
- frameA.removeEventListener('load', performNavigation);
- frameA.addEventListener('load', checkResults);
+ frameA.removeEventListener("load", performNavigation);
+ frameA.addEventListener("load", checkResults);
// load Frame B which then navigates Frame A
var frameB = document.getElementById("frameb");
@@ -79,7 +79,7 @@ function performNavigation() {
// start the test
SimpleTest.waitForExplicitFinish();
-frameA.addEventListener('load', performNavigation);
+frameA.addEventListener("load", performNavigation);
diff --git a/docshell/test/navigation/test_triggeringprincipal_parent_iframe_window_open.html b/docshell/test/navigation/test_triggeringprincipal_parent_iframe_window_open.html
index 4c0897ac7b28..ff0269afd8e4 100644
--- a/docshell/test/navigation/test_triggeringprincipal_parent_iframe_window_open.html
+++ b/docshell/test/navigation/test_triggeringprincipal_parent_iframe_window_open.html
@@ -17,13 +17,13 @@
* TriggeringPrincipal and LoadingPrincipal of the navigated iframe.
*
* +------------------------------------------+
- * | |
+ * | |
* | +------------------+ |
- * | | testframe | |
+ * | | testframe | |
* | +------------------+ |
- * | |
+ * | |
* | window.open("http://", "testframe"); |
- * | |
+ * | |
* +------------------------------------------+
*/
@@ -35,7 +35,7 @@ const LOADING_PRINCIPAL_URI = TRIGGERING_PRINCIPAL_URI;
var testframe = document.getElementById("testframe");
function checkResults() {
- testframe.removeEventListener('load', checkResults);
+ testframe.removeEventListener("load", checkResults);
var channel = SpecialPowers.wrap(testframe.contentWindow).docShell.currentDocumentChannel;
var triggeringPrincipal = channel.loadInfo.triggeringPrincipal.URI.asciiSpec;
@@ -49,20 +49,20 @@ function checkResults() {
is(loadingPrincipal, LOADING_PRINCIPAL_URI,
"LoadingPrincipal for targeted window.open() should be the
diff --git a/docshell/test/navigation/file_triggeringprincipal_subframe_nav.html b/docshell/test/navigation/file_triggeringprincipal_subframe_nav.html
index e5abc1ea1951..c829c0c61f56 100644
--- a/docshell/test/navigation/file_triggeringprincipal_subframe_nav.html
+++ b/docshell/test/navigation/file_triggeringprincipal_subframe_nav.html
@@ -14,7 +14,7 @@
var referrerURI = document.referrer;
window.parent.parent.postMessage({triggeringPrincipalURI,
loadingPrincipalURI,
- referrerURI}, '*');
+ referrerURI}, "*");
}
diff --git a/docshell/test/navigation/navigate.html b/docshell/test/navigation/navigate.html
index e686da4236c0..d89f59f7a23b 100644
--- a/docshell/test/navigation/navigate.html
+++ b/docshell/test/navigation/navigate.html
@@ -8,7 +8,7 @@
var target = arguments[0];
var mechanism = arguments[1];
- switch(mechanism) {
+ switch (mechanism) {
case "location":
navigateByLocation(eval(target));
break;
diff --git a/docshell/test/navigation/redbox_bug430723.html b/docshell/test/navigation/redbox_bug430723.html
index db025c31f7ca..c2d1f980923e 100644
--- a/docshell/test/navigation/redbox_bug430723.html
+++ b/docshell/test/navigation/redbox_bug430723.html
@@ -1,5 +1,5 @@
diff --git a/docshell/test/navigation/test_child.html b/docshell/test/navigation/test_child.html
index c43e1a6cf0ba..a2c8eb5d8fe2 100644
--- a/docshell/test/navigation/test_child.html
+++ b/docshell/test/navigation/test_child.html
@@ -28,7 +28,7 @@ window.onload = function() {
xpcCleanupWindows();
SimpleTest.finish();
}, 4);
-}
+};
diff --git a/docshell/test/navigation/test_grandchild.html b/docshell/test/navigation/test_grandchild.html
index 439145b3edb6..795f18b0c1cd 100644
--- a/docshell/test/navigation/test_grandchild.html
+++ b/docshell/test/navigation/test_grandchild.html
@@ -13,7 +13,7 @@ if (!navigator.platform.startsWith("Win")) {
SimpleTest.expectAssertions(0, 1);
}
-window.onload = function () {
+window.onload = function() {
navigateByLocation(frames[0].frames[0]);
navigateByOpen("child1_child0");
navigateByForm("child2_child0");
@@ -28,7 +28,7 @@ window.onload = function () {
xpcCleanupWindows();
SimpleTest.finish();
}, 4);
-}
+};