watch-availability-initial-callback.html (810B)
1 <!DOCTYPE html> 2 <html> 3 <title> 4 Test that the callback is called after the Promise returned by watchAvailability() resolves 5 </title> 6 <script src="/resources/testharness.js"></script> 7 <script src="/resources/testharnessreport.js"></script> 8 <script src="/common/media.js"></script> 9 <script> 10 async_test(t => { 11 let v = document.createElement("video"); 12 v.src = getVideoURI("/media/movie_5"); 13 14 let promiseResolved = false; 15 16 v.remote 17 .watchAvailability(t.step_func_done(() => assert_true(promiseResolved))) 18 .then( 19 t.step_func(() => { 20 promiseResolved = true; 21 }), 22 t.unreached_func() 23 ); 24 }, "Test that the callback is called after the Promise returned by watchAvailability() resolves."); 25 </script> 26 </html>