From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../test/browser_toolbox_remoteness_change.js | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 devtools/client/framework/test/browser_toolbox_remoteness_change.js (limited to 'devtools/client/framework/test/browser_toolbox_remoteness_change.js') diff --git a/devtools/client/framework/test/browser_toolbox_remoteness_change.js b/devtools/client/framework/test/browser_toolbox_remoteness_change.js new file mode 100644 index 0000000000..af5f105214 --- /dev/null +++ b/devtools/client/framework/test/browser_toolbox_remoteness_change.js @@ -0,0 +1,52 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +const URL_1 = "about:robots"; +const URL_2 = + "data:text/html;charset=UTF-8," + + encodeURIComponent('
foo
'); + +// Testing navigation between processes +add_task(async function () { + info(`Testing navigation between processes`); + + info("Open a tab on a URL supporting only running in parent process"); + const tab = await addTab(URL_1); + is( + tab.linkedBrowser.currentURI.spec, + URL_1, + "We really are on the expected document" + ); + is( + tab.linkedBrowser.getAttribute("remote"), + "", + "And running in parent process" + ); + + const toolbox = await openToolboxForTab(tab); + + info("Navigate to a URL supporting remote process"); + await navigateTo(URL_2); + + is( + tab.linkedBrowser.getAttribute("remote"), + "true", + "Navigated to a data: URI and switching to remote" + ); + + info("Veryify we are inspecting the new document"); + const console = await toolbox.selectTool("webconsole"); + const { ui } = console.hud; + ui.wrapper.dispatchEvaluateExpression("document.location.href"); + await waitUntil(() => ui.outputNode.querySelector(".result")); + const url = ui.outputNode.querySelector(".result"); + + ok( + url.textContent.includes(URL_2), + "The console inspects the second document" + ); + + const { client } = toolbox.target; + await toolbox.destroy(); + ok(client._transportClosed, "The client is closed after closing the toolbox"); +}); -- cgit v1.2.3