diff options
Diffstat (limited to 'dom/security/test/https-only')
7 files changed, 18 insertions, 14 deletions
diff --git a/dom/security/test/https-only/browser_hsts_host.js b/dom/security/test/https-only/browser_hsts_host.js index 858c19865c..c612606f72 100644 --- a/dom/security/test/https-only/browser_hsts_host.js +++ b/dom/security/test/https-only/browser_hsts_host.js @@ -146,7 +146,7 @@ add_task(async function () { Services.obs.removeObserver(observer, "http-on-examine-response"); }); -function observer(subject, topic, state) { +function observer(subject, topic) { info("observer called with " + topic); if (topic == "http-on-examine-response") { onExamineResponse(subject); diff --git a/dom/security/test/https-only/browser_save_as.js b/dom/security/test/https-only/browser_save_as.js index 309dd69c79..fbfdf276a8 100644 --- a/dom/security/test/https-only/browser_save_as.js +++ b/dom/security/test/https-only/browser_save_as.js @@ -14,7 +14,7 @@ const TEST_PATH = "http://example.com/browser/dom/security/test/https-only/file_save_as.html"; let MockFilePicker = SpecialPowers.MockFilePicker; -MockFilePicker.init(window); +MockFilePicker.init(window.browsingContext); const tempDir = createTemporarySaveDirectory(); MockFilePicker.displayDirectory = tempDir; @@ -78,7 +78,7 @@ function createPromiseForTransferComplete() { } function createPromiseForConsoleError(message) { - return new Promise((resolve, reject) => { + return new Promise(resolve => { function listener(msgObj) { let text = msgObj.message; if (text.includes(message)) { @@ -155,7 +155,11 @@ async function setHttpsFirstAndOnlyPrefs(httpsFirst, httpsOnly) { add_task(async function testBaseline() { // Run with HTTPS-First and HTTPS-Only disabled await setHttpsFirstAndOnlyPrefs(false, false); - await runTest("#insecure-link", HTTP_LINK, undefined); + await runTest( + "#insecure-link", + HTTP_LINK, + "We blocked a download that’s not secure: “http://example.org/”." + ); await runTest("#secure-link", HTTPS_LINK, undefined); }); @@ -169,7 +173,7 @@ add_task(async function testHttpsFirst() { await runTest( "#insecure-link", HTTP_LINK, - "Blocked downloading insecure content “http://example.org/”." + "We blocked a download that’s not secure: “http://example.org/”." ); await runTest("#secure-link", HTTPS_LINK, undefined); }); @@ -181,7 +185,7 @@ add_task(async function testHttpsOnly() { await runTest( "#insecure-link", HTTP_LINK, - "Blocked downloading insecure content “http://example.org/”." + "We blocked a download that’s not secure: “http://example.org/”." ); await runTest("#secure-link", HTTPS_LINK, undefined); }); diff --git a/dom/security/test/https-only/browser_user_gesture.js b/dom/security/test/https-only/browser_user_gesture.js index e7d6a20318..9eec10bd88 100644 --- a/dom/security/test/https-only/browser_user_gesture.js +++ b/dom/security/test/https-only/browser_user_gesture.js @@ -23,7 +23,7 @@ add_task(async function () { // 1. Upgrade a page to https:// BrowserTestUtils.startLoadingURIString(browser, kTestURI); await loaded; - await ContentTask.spawn(browser, {}, async args => { + await ContentTask.spawn(browser, {}, async () => { ok( content.document.location.href.startsWith("https://"), "Should be https" diff --git a/dom/security/test/https-only/file_upgrade_insecure.html b/dom/security/test/https-only/file_upgrade_insecure.html index 346cfbeb9c..b2d3b89e3d 100644 --- a/dom/security/test/https-only/file_upgrade_insecure.html +++ b/dom/security/test/https-only/file_upgrade_insecure.html @@ -55,7 +55,7 @@ ); if (AppConstants.platform !== "android") { var mySocket = new WebSocket("ws://example.com/tests/dom/security/test/https-only/file_upgrade_insecure"); - mySocket.onopen = function(e) { + mySocket.onopen = function() { if (mySocket.url.includes("wss://")) { window.parent.postMessage({result: "websocket-ok"}, "*"); } diff --git a/dom/security/test/https-only/file_websocket_exceptions_iframe.html b/dom/security/test/https-only/file_websocket_exceptions_iframe.html index 23c6af2d45..d8d0046119 100644 --- a/dom/security/test/https-only/file_websocket_exceptions_iframe.html +++ b/dom/security/test/https-only/file_websocket_exceptions_iframe.html @@ -5,17 +5,17 @@ <script> window.addEventListener("message", receiveMessage); -function receiveMessage(event) { +function receiveMessage() { window.removeEventListener("message", receiveMessage); var mySocket = new WebSocket("ws://example.com/tests/dom/security/test/https-only/file_upgrade_insecure"); - mySocket.onopen = function(e) { + mySocket.onopen = function() { parent.dispatchEvent(new CustomEvent("WebSocketEnded", { detail: { url: mySocket.url, state: "onopen" } })); mySocket.close(); }; - mySocket.onerror = function(e) { + mySocket.onerror = function() { parent.dispatchEvent(new CustomEvent("WebSocketEnded", { detail: { url: mySocket.url, state: "onerror" } })); diff --git a/dom/security/test/https-only/test_redirect_upgrade.html b/dom/security/test/https-only/test_redirect_upgrade.html index 59f02f96d0..6cf96bd494 100644 --- a/dom/security/test/https-only/test_redirect_upgrade.html +++ b/dom/security/test/https-only/test_redirect_upgrade.html @@ -28,12 +28,12 @@ Test that 302 redirect requests get upgraded to https:// with HTTPS-Only Mode en // Make a request to a site (eg. https://file_redirect.sjs?301), which will redirect to http://file_redirect.sjs?check. // The response will either be secure-ok, if the request has been upgraded to https:// or secure-error if it didn't. myXHR.open("GET", `https://example.com/tests/dom/security/test/https-only/file_redirect.sjs?${currentCode}`); - myXHR.onload = (e) => { + myXHR.onload = () => { is(myXHR.responseText, "secure-ok", `a ${currentCode} redirect when posting violation report should be blocked`) testDone(); } // This should not happen - myXHR.onerror = (e) => { + myXHR.onerror = () => { ok(false, `Could not query results from server for ${currentCode}-redirect test (" + e.message + ")`); testDone(); } diff --git a/dom/security/test/https-only/test_resource_upgrade.html b/dom/security/test/https-only/test_resource_upgrade.html index 6584bad020..1be7fcc3dd 100644 --- a/dom/security/test/https-only/test_resource_upgrade.html +++ b/dom/security/test/https-only/test_resource_upgrade.html @@ -54,7 +54,7 @@ // returns after the server has received all the expected requests. var myXHR = new XMLHttpRequest(); myXHR.open("GET", "file_upgrade_insecure_server.sjs?queryresult"); - myXHR.onload = function (e) { + myXHR.onload = function () { var results = myXHR.responseText.split(","); for (var index in results) { checkResult(results[index]); |