Implement the Remote Playback API.
[WebKit-https.git] / LayoutTests / imported / w3c / web-platform-tests / remote-playback / watch-availability-initial-callback.html
1 <!DOCTYPE html>
2 <html>
3 <title>Test that the callback is called once watchAvailability() resolves.</title>
4 <script src="/resources/testharness.js"></script>
5 <script src="/resources/testharnessreport.js"></script>
6 <script src="/common/media.js"></script>
7 <script>
8 async_test(t => {
9   var v = document.createElement('video');
10   v.src = getVideoURI('movie_5');
11
12   var promiseResolved = false;
13
14   function callback(available) {
15     assert_true(promiseResolved);
16   }
17
18   v.remote.watchAvailability(t.step_func_done(callback)).then(
19     t.step_func(() => { promiseResolved = true; }), t.unreached_func());
20 }, 'Test that the callback is called once watchAvailability() resolves.');
21 </script>
22 </html>