diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2021-04-22 20:39:02 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-23 10:39:02 +1000 |
commit | 1f821dd5e581228febc9b4410bb402646d5f2b13 (patch) | |
tree | 0e8195ff86dbac114a16f613c8145c2d14813c3c /core/runtime.rs | |
parent | 2b5cc6b49846c89b3e50a6f51688d527520e4cc4 (diff) |
chore: remove dead code (#10321)
Diffstat (limited to 'core/runtime.rs')
-rw-r--r-- | core/runtime.rs | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/core/runtime.rs b/core/runtime.rs index ac33cce8d..917588720 100644 --- a/core/runtime.rs +++ b/core/runtime.rs @@ -1613,82 +1613,6 @@ pub mod tests { } #[test] - #[ignore] // TODO(ry) re-enable? setAsyncHandler has been removed - fn test_poll_async_delayed_ops() { - run_in_task(|cx| { - let (mut runtime, dispatch_count) = setup(Mode::Async); - - runtime - .execute( - "setup2.js", - r#" - let nrecv = 0; - Deno.core.setAsyncHandler(1, (buf) => { - nrecv++; - }); - "#, - ) - .unwrap(); - assert_eq!(dispatch_count.load(Ordering::Relaxed), 0); - runtime - .execute( - "check1.js", - r#" - assert(nrecv == 0); - let control = 42; - Deno.core.send(1, null, control); - assert(nrecv == 0); - "#, - ) - .unwrap(); - assert_eq!(dispatch_count.load(Ordering::Relaxed), 1); - assert!(matches!(runtime.poll_event_loop(cx), Poll::Ready(Ok(_)))); - assert_eq!(dispatch_count.load(Ordering::Relaxed), 1); - runtime - .execute( - "check2.js", - r#" - assert(nrecv == 1); - Deno.core.send(1, null, control); - assert(nrecv == 1); - "#, - ) - .unwrap(); - assert_eq!(dispatch_count.load(Ordering::Relaxed), 2); - assert!(matches!(runtime.poll_event_loop(cx), Poll::Ready(Ok(_)))); - runtime.execute("check3.js", "assert(nrecv == 2)").unwrap(); - assert_eq!(dispatch_count.load(Ordering::Relaxed), 2); - // We are idle, so the next poll should be the last. - assert!(matches!(runtime.poll_event_loop(cx), Poll::Ready(Ok(_)))); - }); - } - - #[test] - #[ignore] // TODO(ry) re-enable? setAsyncHandler has been removed - fn test_poll_async_optional_ops() { - run_in_task(|cx| { - let (mut runtime, dispatch_count) = setup(Mode::AsyncUnref); - runtime - .execute( - "check1.js", - r#" - Deno.core.setAsyncHandler(1, (buf) => { - // This handler will never be called - assert(false); - }); - let control = 42; - Deno.core.send(1, null, control); - "#, - ) - .unwrap(); - assert_eq!(dispatch_count.load(Ordering::Relaxed), 1); - // The above op never finish, but runtime can finish - // because the op is an unreffed async op. - assert!(matches!(runtime.poll_event_loop(cx), Poll::Ready(Ok(_)))); - }) - } - - #[test] fn terminate_execution() { let (mut isolate, _dispatch_count) = setup(Mode::Async); // TODO(piscisaureus): in rusty_v8, the `thread_safe_handle()` method |