mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 18:38:33 +00:00
fix(test): disable preventDefault() for beforeunload event (#18911)
Fixes #18910.
This commit is contained in:
parent
d905f20cad
commit
e3276fbb71
8 changed files with 40 additions and 12 deletions
|
@ -498,12 +498,9 @@ async fn bench_specifier(
|
|||
sender.send(BenchEvent::Result(desc.id, result))?;
|
||||
}
|
||||
|
||||
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!())?;
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue