diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /devtools/shared/commands/target | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/shared/commands/target')
6 files changed, 25 insertions, 4 deletions
diff --git a/devtools/shared/commands/target/actions/targets.js b/devtools/shared/commands/target/actions/targets.js index 577e5fedd3..8acd411866 100644 --- a/devtools/shared/commands/target/actions/targets.js +++ b/devtools/shared/commands/target/actions/targets.js @@ -16,7 +16,7 @@ function unregisterTarget(targetFront) { * @param {String} targetActorID: The actorID of the target we want to select. */ function selectTarget(targetActorID) { - return function ({ dispatch, getState }) { + return function ({ dispatch }) { dispatch({ type: "SELECT_TARGET", targetActorID }); }; } diff --git a/devtools/shared/commands/target/tests/browser_target_command_bfcache.js b/devtools/shared/commands/target/tests/browser_target_command_bfcache.js index 598e9c550b..c5ce76848e 100644 --- a/devtools/shared/commands/target/tests/browser_target_command_bfcache.js +++ b/devtools/shared/commands/target/tests/browser_target_command_bfcache.js @@ -236,7 +236,7 @@ async function testTopLevelNavigations(bfcacheInParent) { await commands.destroy(); } -async function testTopLevelNavigationsOnDocumentWithIframe(bfcacheInParent) { +async function testTopLevelNavigationsOnDocumentWithIframe() { info(" # Test TOP LEVEL navigations on document with iframe"); // Create a TargetCommand for a given test tab const tab = diff --git a/devtools/shared/commands/target/tests/browser_target_command_frames.js b/devtools/shared/commands/target/tests/browser_target_command_frames.js index 6aa0655b64..5f4e633d11 100644 --- a/devtools/shared/commands/target/tests/browser_target_command_frames.js +++ b/devtools/shared/commands/target/tests/browser_target_command_frames.js @@ -366,7 +366,7 @@ async function testBrowserFrames() { await commands.destroy(); } -async function testTabFrames(mainRoot) { +async function testTabFrames() { info("Test TargetCommand against frames via a tab target"); // Create a TargetCommand for a given test tab diff --git a/devtools/shared/commands/target/tests/browser_target_command_processes.js b/devtools/shared/commands/target/tests/browser_target_command_processes.js index d4f57ae036..9b55b34027 100644 --- a/devtools/shared/commands/target/tests/browser_target_command_processes.js +++ b/devtools/shared/commands/target/tests/browser_target_command_processes.js @@ -178,11 +178,13 @@ async function testProcesses(targetCommand, target) { onAvailable: onAvailable2, }); }); + info("open new tab in new process"); const tab1 = await BrowserTestUtils.openNewForegroundTab({ gBrowser, url: TEST_URL, forceNewProcess: true, }); + info("wait for process target to be created"); const createdTarget = await onProcessCreated; // For some reason, creating a new tab purges processes created from previous tests // so it is not reasonable to assert the size of `targets` as it may be lower than expected. diff --git a/devtools/shared/commands/target/tests/browser_target_command_scope_flag.js b/devtools/shared/commands/target/tests/browser_target_command_scope_flag.js index 65d9e9a622..0ceaaf39ee 100644 --- a/devtools/shared/commands/target/tests/browser_target_command_scope_flag.js +++ b/devtools/shared/commands/target/tests/browser_target_command_scope_flag.js @@ -52,6 +52,25 @@ add_task(async function () { forceNewProcess: true, }); + // Verify that only PROCESS and top target have their thread actor attached. + // We especially care about having the FRAME targets to not be attached, + // otherwise we would have two thread actor debugging the same thread + // with the PROCESS target already debugging all FRAME documents. + for (const target of targets) { + const threadFront = await target.getFront("thread"); + const isAttached = await threadFront.isAttached(); + if (target.targetType == TYPES.PROCESS) { + ok(isAttached, "All process targets are attached"); + } else if (target.isTopLevel) { + ok(isAttached, "The top level target is attached"); + } else { + ok( + !isAttached, + "The frame targets should not be attached in multiprocess mode" + ); + } + } + const newTabProcessID = gBrowser.selectedTab.linkedBrowser.browsingContext.currentWindowGlobal .osPid; diff --git a/devtools/shared/commands/target/tests/test_service_worker.js b/devtools/shared/commands/target/tests/test_service_worker.js index aabc3fda0f..0ed8942239 100644 --- a/devtools/shared/commands/target/tests/test_service_worker.js +++ b/devtools/shared/commands/target/tests/test_service_worker.js @@ -6,6 +6,6 @@ // We don't need any computation in the worker, // but at least register a fetch listener so that // we force instantiating the SW when loading the page. -self.onfetch = function (event) { +self.onfetch = function () { // do nothing. }; |