diff options
author | Luca Casonato <lucacasonato@yahoo.com> | 2020-08-19 14:43:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-19 14:43:20 +0200 |
commit | 1507a8cf2d8bce8c3596583b995fea4914a99203 (patch) | |
tree | 3e9280b01dab60dcea368894a153a9237884d676 /op_crates/web/lib.rs | |
parent | 27f4aeb92469660fdd78a89a7b2902c08a23ca4a (diff) |
refactor(op_crates/web): move abort signal (#7117)
Diffstat (limited to 'op_crates/web/lib.rs')
-rw-r--r-- | op_crates/web/lib.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/op_crates/web/lib.rs b/op_crates/web/lib.rs index 4cfe8d090..03c0c89af 100644 --- a/op_crates/web/lib.rs +++ b/op_crates/web/lib.rs @@ -6,6 +6,7 @@ use std::path::PathBuf; crate_modules!(); pub struct WebScripts { + pub abort_signal: String, pub declaration: String, pub dom_exception: String, pub event: String, @@ -21,6 +22,7 @@ fn get_str_path(file_name: &str) -> String { pub fn get_scripts() -> WebScripts { WebScripts { + abort_signal: get_str_path("02_abort_signal.js"), declaration: get_str_path("lib.deno_web.d.ts"), dom_exception: get_str_path("00_dom_exception.js"), event: get_str_path("01_event.js"), @@ -53,6 +55,9 @@ mod tests { ); js_check(isolate.execute("01_event.js", include_str!("01_event.js"))); js_check( + isolate.execute("02_abort_signal.js", include_str!("02_abort_signal.js")), + ); + js_check( isolate .execute("08_text_encoding.js", include_str!("08_text_encoding.js")), ); @@ -60,6 +65,20 @@ mod tests { } #[test] + fn test_abort_controller() { + run_in_task(|mut cx| { + let mut isolate = setup(); + js_check(isolate.execute( + "abort_controller_test.js", + include_str!("abort_controller_test.js"), + )); + if let Poll::Ready(Err(_)) = isolate.poll_unpin(&mut cx) { + unreachable!(); + } + }); + } + + #[test] fn test_event() { run_in_task(|mut cx| { let mut isolate = setup(); |