tor-browser

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

resource-selection-candidate-remove-onerror.html (931B)


      1 <!doctype html>
      2 <title>removing the candidate source, onerror</title>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <div id=log></div>
      6 <script>
      7 var v;
      8 function createSource(src) {
      9  var source = document.createElement('source');
     10  source.src = src;
     11  return source;
     12 }
     13 var t = async_test(function(t) {
     14  v = document.createElement('video');
     15  v.appendChild(createSource('resources/delayed-broken-video.py')); // invokes resource selection
     16  v.firstChild.onerror = t.step_func(function() { t.done(); });
     17 });
     18 </script>
     19 <!-- now resource selection algorithm will continue its sync section (the </script> tag below provides a stable state) -->
     20 <!-- the <source> is candidate -->
     21 <!-- pointer is between the <source> and the end of the list -->
     22 <script>
     23 t.step(function() {
     24  v.removeChild(v.firstChild); // tests that we fire 'error' on it despite being removed
     25 });
     26 </script>