summaryrefslogtreecommitdiffstats
path: root/devtools/shared/commands/target/tests
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
commit086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch)
treea4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /devtools/shared/commands/target/tests
parentAdding debian version 124.0.1-1. (diff)
downloadfirefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz
firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/shared/commands/target/tests')
-rw-r--r--devtools/shared/commands/target/tests/browser_target_command_bfcache.js2
-rw-r--r--devtools/shared/commands/target/tests/browser_target_command_frames.js2
-rw-r--r--devtools/shared/commands/target/tests/browser_target_command_processes.js2
-rw-r--r--devtools/shared/commands/target/tests/browser_target_command_scope_flag.js19
-rw-r--r--devtools/shared/commands/target/tests/test_service_worker.js2
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.
};