diff options
Diffstat (limited to 'devtools/shared/commands/target/tests')
5 files changed, 24 insertions, 3 deletions
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. }; |