summaryrefslogtreecommitdiff
path: root/cli/tools/test.rs
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2023-05-03 22:10:51 +0100
committerGitHub <noreply@github.com>2023-05-03 23:10:51 +0200
commite3276fbb71093faf4e8850f68ed2e080a9bda222 (patch)
tree19cccef2cc096de54487073daa9e5528f94e9617 /cli/tools/test.rs
parentd905f20cadfd95b927027a3c597d578db606984e (diff)
fix(test): disable preventDefault() for beforeunload event (#18911)
Fixes #18910.
Diffstat (limited to 'cli/tools/test.rs')
-rw-r--r--cli/tools/test.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/cli/tools/test.rs b/cli/tools/test.rs
index 847260352..50e220a46 100644
--- a/cli/tools/test.rs
+++ b/cli/tools/test.rs
@@ -1033,12 +1033,9 @@ pub async fn test_specifier(
sender.send(TestEvent::Result(desc.id, result, elapsed as u64))?;
}
- loop {
- if !worker.dispatch_beforeunload_event(located_script_name!())? {
- break;
- }
- worker.run_event_loop(false).await?;
- }
+ // Ignore `defaultPrevented` of the `beforeunload` event. We don't allow the
+ // event loop to continue beyond what's needed to await results.
+ worker.dispatch_beforeunload_event(located_script_name!())?;
worker.dispatch_unload_event(located_script_name!())?;
if let Some(coverage_collector) = coverage_collector.as_mut() {