summaryrefslogtreecommitdiffstats
path: root/devtools/shared/commands/target/tests
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/shared/commands/target/tests')
-rw-r--r--devtools/shared/commands/target/tests/browser_target_command_bfcache.js5
-rw-r--r--devtools/shared/commands/target/tests/browser_target_command_detach.js6
-rw-r--r--devtools/shared/commands/target/tests/browser_target_command_scope_flag.js6
3 files changed, 14 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 c5ce76848e..03de5e3b5d 100644
--- a/devtools/shared/commands/target/tests/browser_target_command_bfcache.js
+++ b/devtools/shared/commands/target/tests/browser_target_command_bfcache.js
@@ -145,7 +145,12 @@ async function testTopLevelNavigations(bfcacheInParent) {
// Go back to the first page, this should be a bfcache navigation, and,
// we should get a new target
info("Go back to the first page");
+ const onPageShow = BrowserTestUtils.waitForContentEvent(
+ gBrowser.selectedBrowser,
+ "pageshow"
+ );
gBrowser.selectedBrowser.goBack();
+ await onPageShow;
await waitFor(
() => targets.length == 3,
diff --git a/devtools/shared/commands/target/tests/browser_target_command_detach.js b/devtools/shared/commands/target/tests/browser_target_command_detach.js
index a0056cd7a5..800832a111 100644
--- a/devtools/shared/commands/target/tests/browser_target_command_detach.js
+++ b/devtools/shared/commands/target/tests/browser_target_command_detach.js
@@ -30,9 +30,9 @@ add_task(async function () {
info("Call any target front method, to ensure it works fine");
await targetCommand.targetFront.focus();
- // Destroying the target front should end up calling "WindowGlobalTargetActor.detach"
- // which should destroy the target on the server side
- await targetCommand.targetFront.destroy();
+ // Simulate a toolbox closing by the cleanup of TargetCommand.
+ // This will stop watching for all target types and destroy all target actors/fronts.
+ await targetCommand.stopListening();
info(
"Now create a second commands after destroy, to see if we can spawn a new, functional target"
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 0ceaaf39ee..883cf9356b 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
@@ -27,6 +27,12 @@ add_task(async function () {
const commands = await CommandsFactory.forMainProcess();
const targetCommand = commands.targetCommand;
await targetCommand.startListening();
+
+ // Pass any configuration, in order to ensure attaching all the thread actors
+ await commands.threadConfigurationCommand.updateConfiguration({
+ skipBreakpoints: false,
+ });
+
const { TYPES } = targetCommand;
const targets = new Set();