mirror of
https://github.com/lexmount/moli.git
synced 2026-11-04 08:07:27 +00:00
fix(performance): validate observer options and retain observe mode
This commit is contained in:
@@ -2313,6 +2313,7 @@ mod offline_audio_context_interfaces;
|
||||
mod offline_audio_float;
|
||||
mod payment_response_interfaces;
|
||||
mod performance_measurement_interfaces;
|
||||
mod performance_observer_contract;
|
||||
mod performance_receivers;
|
||||
mod periodic_wave_interfaces;
|
||||
mod popup_root_window;
|
||||
|
||||
@@ -1541,6 +1541,7 @@ mod strict_script_mime;
|
||||
|
||||
mod network;
|
||||
mod onerror;
|
||||
mod performance_observer_contract;
|
||||
mod postmessage;
|
||||
mod canvas_transform_snapshots;
|
||||
mod synthetic_exceptions;
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
use super::*;
|
||||
|
||||
#[tokio::test]
|
||||
async fn worker_observer_options_modes_and_disconnect_match_window_semantics() {
|
||||
ensure_v8();
|
||||
let source = format!(
|
||||
r#"const probe = {};
|
||||
const checks = probe(globalThis, globalThis, 'worker');
|
||||
postMessage({{total: checks.length, failures: checks.filter(row => !row.passed)}});
|
||||
close();"#,
|
||||
include_str!("../../../script_vm/tests/performance_observer_contract.js"),
|
||||
);
|
||||
let mut worker = spawn_worker(source, "test://performance_observer_contract".into());
|
||||
let message = timeout(TIMEOUT, worker.recv())
|
||||
.await
|
||||
.expect("timed out")
|
||||
.expect("channel closed");
|
||||
assert_eq!(expect_post_json(message), r#"{"total":91,"failures":[]}"#);
|
||||
}
|
||||
Reference in New Issue
Block a user