task-controller-abort-completed-tasks.any.js (662B)
1 // META: title=Scheduler: Aborting Completed Tasks is a No-op 2 // META: global=window,worker 3 'use strict'; 4 5 promise_test(async t => { 6 const controller1 = new TaskController(); 7 const controller2 = new TaskController(); 8 9 await scheduler.postTask(() => {}, {signal: controller1.signal}); 10 11 const task = scheduler.postTask(() => {}, {signal: controller2.signal}); 12 controller2.abort(); 13 await promise_rejects_dom(t, 'AbortError', task); 14 15 // The tasks associated with these controllers have completed, so this should 16 // not lead to any unhandled rejections. 17 controller1.abort(); 18 controller2.abort(); 19 }, 'Aborting completed tasks should be a no-op.');