From 1f821dd5e581228febc9b4410bb402646d5f2b13 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Thu, 22 Apr 2021 20:39:02 -0400 Subject: [PATCH] chore: remove dead code (#10321) --- core/runtime.rs | 76 ------------------------------------------------- 1 file changed, 76 deletions(-) diff --git a/core/runtime.rs b/core/runtime.rs index ac33cce8d5..917588720c 100644 --- a/core/runtime.rs +++ b/core/runtime.rs @@ -1612,82 +1612,6 @@ pub mod tests { assert_eq!(dispatch_count.load(Ordering::Relaxed), 1); } - #[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);