From d8bbc7858622b6d9c278469aab701ca0b609cddf Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 15 May 2024 05:35:49 +0200 Subject: Merging upstream version 126.0. Signed-off-by: Daniel Baumann --- .../test/browser_dynamic_tool_enabling.js | 2 +- .../framework/test/browser_toolbox_error_count.js | 32 ++++++++++++++++++++-- ...wser_toolbox_error_count_reset_on_navigation.js | 2 +- .../test/browser_toolbox_remoteness_change.js | 2 +- .../test/browser_toolbox_screenshot_tool.js | 2 +- .../test/browser_toolbox_watchedByDevTools.js | 5 ++++ 6 files changed, 39 insertions(+), 6 deletions(-) (limited to 'devtools/client/framework/test') diff --git a/devtools/client/framework/test/browser_dynamic_tool_enabling.js b/devtools/client/framework/test/browser_dynamic_tool_enabling.js index 56313607cf..0caf32b134 100644 --- a/devtools/client/framework/test/browser_dynamic_tool_enabling.js +++ b/devtools/client/framework/test/browser_dynamic_tool_enabling.js @@ -11,7 +11,7 @@ var gItemsToTest = { }; function expectedAttributeValueFromPrefs(prefs) { - return prefs.every(pref => Services.prefs.getBoolPref(pref)) ? "" : "true"; + return prefs.every(pref => Services.prefs.getBoolPref(pref)) ? null : "true"; } function checkItem(el, prefs) { diff --git a/devtools/client/framework/test/browser_toolbox_error_count.js b/devtools/client/framework/test/browser_toolbox_error_count.js index e4dcf0214f..858615f18b 100644 --- a/devtools/client/framework/test/browser_toolbox_error_count.js +++ b/devtools/client/framework/test/browser_toolbox_error_count.js @@ -22,8 +22,14 @@ const TEST_URI = `https://example.com/document-builder.sjs?html= { + Services.prefs.clearUserPref("devtools.toolbox.splitconsole.enabled"); + }); + const tab = await addTab(TEST_URI); const toolbox = await openToolboxForTab( @@ -175,6 +181,28 @@ add_task(async function () { "The error is displayed again, with the correct error count, after enabling it from the settings panel" ); + info("Disable the split console from the options panel"); + const splitConsoleButtonToggleEl = + optionsPanel.panelWin.document.querySelector( + "input#devtools-enable-split-console" + ); + splitConsoleButtonToggleEl.click(); + await waitFor( + () => getErrorIcon(toolbox).getAttribute("title") === "Show Console" + ); + ok( + true, + "The error count icon title changed to reflect split console being disabled" + ); + + info( + "Check if with split console being disabled click leads to the console tab" + ); + const onWebConsole = toolbox.once("webconsole-selected"); + getErrorIcon(toolbox).click(); + await onWebConsole; + ok(!toolbox.splitConsole, "Web Console opened instead of split console"); + toolbox.destroy(); }); diff --git a/devtools/client/framework/test/browser_toolbox_error_count_reset_on_navigation.js b/devtools/client/framework/test/browser_toolbox_error_count_reset_on_navigation.js index 53f5068655..ebf862be88 100644 --- a/devtools/client/framework/test/browser_toolbox_error_count_reset_on_navigation.js +++ b/devtools/client/framework/test/browser_toolbox_error_count_reset_on_navigation.js @@ -23,7 +23,7 @@ add_task(async function () { // Make sure we start the test with the split console disabled. // ⚠️ In this test it's important to _not_ enable the console. - await pushPref("devtools.toolbox.splitconsoleEnabled", false); + await pushPref("devtools.toolbox.splitconsole.open", false); const tab = await addTab(TEST_URI); const toolbox = await openToolboxForTab( diff --git a/devtools/client/framework/test/browser_toolbox_remoteness_change.js b/devtools/client/framework/test/browser_toolbox_remoteness_change.js index af5f105214..ff019d1826 100644 --- a/devtools/client/framework/test/browser_toolbox_remoteness_change.js +++ b/devtools/client/framework/test/browser_toolbox_remoteness_change.js @@ -19,7 +19,7 @@ add_task(async function () { ); is( tab.linkedBrowser.getAttribute("remote"), - "", + null, "And running in parent process" ); diff --git a/devtools/client/framework/test/browser_toolbox_screenshot_tool.js b/devtools/client/framework/test/browser_toolbox_screenshot_tool.js index 63c8b9fd58..e87830a940 100644 --- a/devtools/client/framework/test/browser_toolbox_screenshot_tool.js +++ b/devtools/client/framework/test/browser_toolbox_screenshot_tool.js @@ -121,6 +121,6 @@ add_task(async function () { await resetDownloads(); const closePromise = BrowserTestUtils.windowClosed(privateWindow); - privateWindow.BrowserTryToCloseWindow(); + privateWindow.BrowserCommands.tryToCloseWindow(); await closePromise; }); diff --git a/devtools/client/framework/test/browser_toolbox_watchedByDevTools.js b/devtools/client/framework/test/browser_toolbox_watchedByDevTools.js index a58b57885d..7365c43313 100644 --- a/devtools/client/framework/test/browser_toolbox_watchedByDevTools.js +++ b/devtools/client/framework/test/browser_toolbox_watchedByDevTools.js @@ -64,6 +64,11 @@ add_task(async function () { info("Check that the flag is reset when the toolbox is closed"); await gDevTools.closeToolboxForTab(tab); + + // As the destroy sequence of DevTools server is synchronous and we aren't waiting + // for full completion of server cleanups, we have to wait for its full processing. + await waitFor(() => !tab.linkedBrowser.browsingContext.watchedByDevTools); + is( tab.linkedBrowser.browsingContext.watchedByDevTools, false, -- cgit v1.2.3