tor-browser

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

disable-remote-playback-cancel-watch-availability-throws.html (1164B)


      1 <!DOCTYPE html>
      2 <html>
      3  <title>
      4    Test that calling cancelWatchAvailability() when disableRemotePlayback attribute is set throws InvalidStateError
      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      v.remote
     15        .watchAvailability(() => {})
     16        .then(id => {
     17          v.disableRemotePlayback = true;
     18          v.remote.cancelWatchAvailability(id).then(
     19            t.unreached_func(),
     20            t.step_func(e => {
     21              assert_equals(e.name, "InvalidStateError");
     22              v.remote.cancelWatchAvailability().then(
     23                t.unreached_func(),
     24                t.step_func_done(e => {
     25                  assert_equals(e.name, "InvalidStateError");
     26                })
     27              );
     28            })
     29          );
     30        }, t.unreached_func());
     31    }, "Test that calling cancelWatchAvailability() when disableRemotePlayback attribute is set throws InvalidStateError.");
     32  </script>
     33 </html>