tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

watch-availability-callback-parameter.html (900B)


      1 <!DOCTYPE html>
      2 <html>
      3  <title>
      4    Test that the callback is called with boolean parameter when calling
      5    watchAvailability()
      6  </title>
      7  <script src="/resources/testharness.js"></script>
      8  <script src="/resources/testharnessreport.js"></script>
      9  <script src="/common/media.js"></script>
     10  <script>
     11    async_test(t => {
     12      let v = document.createElement("video");
     13      v.src = getVideoURI("/media/movie_5");
     14 
     15      v.remote
     16        .watchAvailability(
     17          t.step_func_done(available => assert_true(typeof available === "boolean"))
     18        )
     19        .then(
     20          t.step_func(() => {}),
     21          t.unreached_func()
     22        )
     23        .catch(
     24          t.step_func_done(error =>
     25            assert_equals(error.name, "NotSupportedError")
     26          )
     27        );
     28    }, "Test that the callback is called with boolean parameter when calling watchAvailability().");
     29  </script>
     30 </html>