<!doctype html>
<title>TextTrack.cues</title>
<script src=../../../../../resources/testharness.js></script>
<script src=../../../../../resources/testharnessreport.js></script>
<div id=log></div>
<script>
setup(function(){
    window.video = document.createElement('video');
    window.t1 = video.addTextTrack('subtitles');
    window.track = document.createElement('track');
    track['default'] = true;
    video.appendChild(track); // queues a task to "honor user preferences...", media element event task source
    window.t2 = track.track;
    window.t1_cues = t1.cues
    window.t2_cues = t2.cues
});
test(function(){
    assert_equals(t1.cues, t1_cues, 't1.cues should return same object');
    assert_not_equals(t1.cues, null, 't1.cues should not be null');
    assert_equals(t1.cues.length, 0, 't1.cues should have length 0');
}, document.title+', empty list');
test(function(){
    var c = new VTTCue(0, 1, "text");
    c.id = "id";
    t1.addCue(c);
    assert_equals(t1.cues, t1_cues, "t1.cues should return same object");
    assert_equals(t1.cues.length, 1, "t1.cues.length");
    var c2 = new VTTCue(1, 2, "text2");
    c2.id = "id2";
    t1.addCue(c2);
    assert_equals(t1.cues, t1_cues, "t1.cues should return the same object after adding a second cue");
    assert_equals(t1.cues.length, 2, "t1.cues.length after adding a second cue");
    assert_equals(t1.cues[0].id, "id");
    assert_equals(t1.cues[1].id, "id2");
}, document.title+', after addCue()');
test(function(){
    t1.mode = 'showing';
    assert_equals(t1.cues, t1_cues, "t1.cues should return the same object after setting mode to 'showing'");
    t1.mode = 'hidden';
    assert_equals(t1.cues, t1_cues, "t1.cues should return the same object after setting mode to 'hidden'");
    t1.mode = 'disabled';
    assert_equals(t1.cues, null, "t1.cues should be null when mode is 'disabled'");
    assert_equals(t1_cues.length, 2, "t1_cues should still be intact after setting mode to 'disabled'");
    assert_equals(t1_cues[0].id, "id", "t1_cues first cue should still be intact after setting mode to 'disabled'");
    assert_equals(t1_cues[1].id, "id2", "t1_cues second cue should still be intact after setting mode to 'disabled'");
    t1.mode = 'hidden';
    assert_equals(t1.cues, t1_cues, "t1.cues should return the same object after setting mode to 'disabled' and then 'hidden'");
    t1.mode = 'disabled';
    assert_equals(t1.cues, null, "t1.cues should be null when mode is set to 'disabled' again");
    assert_equals(t1_cues.length, 2, "t1_cues should still be intact after setting mode to 'disabled' again");
    assert_equals(t1_cues[0].id, "id", "t1_cues first cue should still be intact after setting mode to 'disabled' again");
    assert_equals(t1_cues[1].id, "id2", "t1_cues second cue should still be intact after setting mode to 'disabled' again");
    t1.mode = 'showing';
    assert_equals(t1.cues, t1_cues, "t1.cues should return the same object after setting mode to 'disabled' and then 'showing'");
}, document.title+', different modes');
test(function(){
    t1.mode = 'showing';
    t1.cues[1].startTime = 0; // this should change the text track cue order
    assert_equals(t1.cues[0].id, 'id2');
    assert_equals(t1.cues[1].id, 'id');
    t1.cues[0].startTime = 0.5; // this should change it back
    assert_equals(t1.cues[0].id, 'id');
    assert_equals(t1.cues[1].id, 'id2');
}, document.title+', changing order');
</script>
