From d99fe3e573bca6d196ca9b7ebaf0917894950576 Mon Sep 17 00:00:00 2001 From: Julian Descottes Date: Wed, 13 Oct 2021 09:41:21 +0000 Subject: [PATCH] Bug 1735143 - Ensure various tests within devtools are https-first compliant r=bomsy The following test suites are green in https-first with this patch: devtools/client/memory/test/browser/browser.ini devtools/client/responsive/test/browser/browser.ini devtools/client/shared/test/browser.ini devtools/client/styleeditor/test/browser.ini devtools/shared/commands/resource/tests/browser.ini Differential Revision: https://phabricator.services.mozilla.com/D128082 --- .../browser_memory_allocationStackDisplay_02.js | 2 +- .../test/browser/browser_container_tab.js | 2 +- devtools/client/shared/test/browser_link.js | 2 +- .../test/browser_styleeditor_loading.js | 2 +- .../tests/browser_resources_several_resources.js | 16 ++++++++-------- .../tests/browser_resources_websocket.js | 4 ++-- .../resource/tests/websocket_frontend.html | 6 +++--- .../tests/websocket_frontend_iframe.html | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/devtools/client/memory/test/browser/browser_memory_allocationStackDisplay_02.js b/devtools/client/memory/test/browser/browser_memory_allocationStackDisplay_02.js index a33076f32846..d822b6d80952 100644 --- a/devtools/client/memory/test/browser/browser_memory_allocationStackDisplay_02.js +++ b/devtools/client/memory/test/browser/browser_memory_allocationStackDisplay_02.js @@ -16,7 +16,7 @@ const { viewState } = require("devtools/client/memory/constants"); const { changeView } = require("devtools/client/memory/actions/view"); const TEST_URL = - "http://example.com/browser/devtools/client/memory/test/browser/doc_steady_allocation.html"; + "https://example.com/browser/devtools/client/memory/test/browser/doc_steady_allocation.html"; this.test = makeMemoryTest("about:blank", async function({ tab, panel }) { const heapWorker = panel.panelWin.gHeapAnalysesClient; diff --git a/devtools/client/responsive/test/browser/browser_container_tab.js b/devtools/client/responsive/test/browser/browser_container_tab.js index 5d94c8af9566..b824c2834da2 100644 --- a/devtools/client/responsive/test/browser/browser_container_tab.js +++ b/devtools/client/responsive/test/browser/browser_container_tab.js @@ -5,7 +5,7 @@ // Verify RDM opens for a container tab. -const TEST_URL = "http://example.com/"; +const TEST_URL = "https://example.com/"; addRDMTask( null, diff --git a/devtools/client/shared/test/browser_link.js b/devtools/client/shared/test/browser_link.js index 99f6ce0ccb3c..538d64117a4f 100644 --- a/devtools/client/shared/test/browser_link.js +++ b/devtools/client/shared/test/browser_link.js @@ -6,7 +6,7 @@ // Test link helpers openDocLink, openTrustedLink. // Use any valid test page here. -const TEST_URI = TEST_URI_ROOT + "dummy.html"; +const TEST_URI = TEST_URI_ROOT_SSL + "dummy.html"; const { openDocLink, openTrustedLink } = require("devtools/client/shared/link"); diff --git a/devtools/client/styleeditor/test/browser_styleeditor_loading.js b/devtools/client/styleeditor/test/browser_styleeditor_loading.js index 2ec390f817fb..f53e99daed82 100644 --- a/devtools/client/styleeditor/test/browser_styleeditor_loading.js +++ b/devtools/client/styleeditor/test/browser_styleeditor_loading.js @@ -4,7 +4,7 @@ // Test that style editor loads correctly. -const TESTCASE_URI = TEST_BASE_HTTP + "longload.html"; +const TESTCASE_URI = TEST_BASE_HTTPS + "longload.html"; add_task(async function() { // launch Style Editor right when the tab is created (before load) diff --git a/devtools/shared/commands/resource/tests/browser_resources_several_resources.js b/devtools/shared/commands/resource/tests/browser_resources_several_resources.js index 6fa4d697aa8b..7fd9ebec9869 100644 --- a/devtools/shared/commands/resource/tests/browser_resources_several_resources.js +++ b/devtools/shared/commands/resource/tests/browser_resources_several_resources.js @@ -55,7 +55,7 @@ add_task(async function() { // Check that the resource command captures resources from new targets. info("Open a first tab on the example.com domain"); const comTab = await addTab( - "http://example.com/document-builder.sjs?html=com" + "https://example.com/document-builder.sjs?html=com" ); info("Use console.log in the example.com page"); logInTab(comTab, "test-from-example-com"); @@ -73,18 +73,18 @@ add_task(async function() { // Check that messages from new targets are still captured after calling // unwatch for another resource. - info("Open a second tab on the example.net domain"); - const netTab = await addTab( - "http://example.net/document-builder.sjs?html=net" + info("Open a second tab on the example.org domain"); + const orgTab = await addTab( + "https://example.org/document-builder.sjs?html=org" ); - info("Use console.log in the example.net page"); - logInTab(netTab, "test-from-example-net"); + info("Use console.log in the example.org page"); + logInTab(orgTab, "test-from-example-org"); info( - "Wait until onAvailable received the CONSOLE_MESSAGE resource emitted from the example.net tab" + "Wait until onAvailable received the CONSOLE_MESSAGE resource emitted from the example.org tab" ); await waitUntil(() => receivedMessages.find( - resource => resource.message.arguments[0] === "test-from-example-net" + resource => resource.message.arguments[0] === "test-from-example-org" ) ); diff --git a/devtools/shared/commands/resource/tests/browser_resources_websocket.js b/devtools/shared/commands/resource/tests/browser_resources_websocket.js index 1528b9a9ba94..f600c617dee8 100644 --- a/devtools/shared/commands/resource/tests/browser_resources_websocket.js +++ b/devtools/shared/commands/resource/tests/browser_resources_websocket.js @@ -26,7 +26,7 @@ add_task(async function() { }); async function testWebsocketResources(target) { - const tab = await addTab(URL_ROOT + "websocket_frontend.html"); + const tab = await addTab(URL_ROOT_SSL + "websocket_frontend.html"); const { client, resourceCommand, targetCommand } = await initResourceCommand( tab ); @@ -59,7 +59,7 @@ async function testWebsocketResources(target) { assertResource(availableResources[0], { wsMessageType: "webSocketOpened", effectiveURI: - "ws://mochi.test:8888/browser/devtools/shared/commands/resource/tests/websocket_backend", + "wss://example.com/browser/devtools/shared/commands/resource/tests/websocket_backend", extensions: "permessage-deflate", protocols: "", }); diff --git a/devtools/shared/commands/resource/tests/websocket_frontend.html b/devtools/shared/commands/resource/tests/websocket_frontend.html index 9037897b1dcf..7efe11f9eb21 100644 --- a/devtools/shared/commands/resource/tests/websocket_frontend.html +++ b/devtools/shared/commands/resource/tests/websocket_frontend.html @@ -16,7 +16,7 @@ function openConnection() { return new Promise(resolve => { webSocket = new WebSocket( - "ws://mochi.test:8888/browser/devtools/shared/commands/resource/tests/websocket_backend" + "wss://example.com/browser/devtools/shared/commands/resource/tests/websocket_backend" ); webSocket.onopen = () => { resolve(); @@ -38,8 +38,8 @@ } + src="https://example.com/browser/devtools/shared/commands/resource/tests/websocket_frontend_iframe.html"> + src="https://example.org/browser/devtools/shared/commands/resource/tests/websocket_frontend_iframe.html"> diff --git a/devtools/shared/commands/resource/tests/websocket_frontend_iframe.html b/devtools/shared/commands/resource/tests/websocket_frontend_iframe.html index 2f063971c54a..e18576f9115c 100644 --- a/devtools/shared/commands/resource/tests/websocket_frontend_iframe.html +++ b/devtools/shared/commands/resource/tests/websocket_frontend_iframe.html @@ -16,7 +16,7 @@ function openConnection() { return new Promise(resolve => { webSocket = new WebSocket( - "ws://mochi.test:8888/browser/devtools/shared/commands/resource/tests/websocket_backend" + "wss://example.com/browser/devtools/shared/commands/resource/tests/websocket_backend" ); webSocket.onopen = () => { resolve();