tor-browser

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

track-cue-empty.html (723B)


      1 <!DOCTYPE html>
      2 <title>Invoke getCueAsHTML() on an empty cue</title>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <script>
      6 test(function() {
      7    var emptyCue = new VTTCue(0, 0, "");
      8    var fragment = emptyCue.getCueAsHTML();
      9 
     10    // The getCueAsHTML() method should return a document fragment.
     11    assert_true(fragment instanceof DocumentFragment);
     12 
     13    // The document fragment should have one child, an empty Text node.
     14    assert_equals(fragment.childNodes.length, 1);
     15    assert_equals(fragment.childNodes[0].constructor.name, Text.name);
     16    assert_equals(fragment.childNodes[0].length, 0);
     17    assert_equals(fragment.childNodes[0].data, "");
     18 });
     19 </script>