tor-browser

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

id.html (1301B)


      1 <!doctype html>
      2 <title>TextTrackCue.id</title>
      3 <script src=/resources/testharness.js></script>
      4 <script src=/resources/testharnessreport.js></script>
      5 <div id=log></div>
      6 <script>
      7 setup(function(){
      8    window.video = document.createElement('video');
      9    window.t1 = video.addTextTrack('subtitles');
     10    document.body.appendChild(video);
     11 });
     12 test(function(){
     13    var c1 = new VTTCue(0, 1, 'text1');
     14    c1.id = 'id1\r\n\u0000';
     15    assert_equals(c1.id, 'id1\r\n\u0000');
     16    c1.id = c1.id;
     17    assert_equals(c1.id, 'id1\r\n\u0000');
     18    c1.id = null;
     19    assert_equals(c1.id, 'null');
     20 }, document.title+', script-created cue');
     21 
     22 var t_parsed = async_test(document.title+', parsed cue');
     23 t_parsed.step(function(){
     24    var t = document.createElement('track');
     25    t.onload = this.step_func(function(){
     26        var c = t.track.cues;
     27        assert_equals(c[0].id, '');
     28        assert_equals(c[1].id, 'foobar');
     29        this.done();
     30    });
     31    t.onerror = this.step_func(function() {
     32      assert_unreached('got error event');
     33    });
     34    t.src = 'data:text/vtt,'+encodeURIComponent('WEBVTT\n\n00:00:00.000 --> 00:00:00.001\ntest'+
     35                                                      '\n\nfoobar\n00:00:00.000 --> 00:00:00.001\ntest');
     36    t.track.mode = 'showing';
     37    video.appendChild(t);
     38 });
     39 </script>