summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/label.html
blob: c60e85c21ac728c5c856cfcbbe23b97e3cd81f8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<!doctype html>
<title>TextTrack.label</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', 'foo');
    window.track = document.createElement('track');
    track.setAttribute('label', 'bar');
    video.appendChild(track);
    window.t2 = track.track;
});
test(function(){
    assert_equals(t1.label, 'foo');
    assert_equals(t2.label, 'bar');
    track.label = 'baz';
    assert_equals(t2.label, 'baz');
    track.removeAttribute('label');
    assert_equals(t2.label, '');
});
test(function(){
    track.label = '\u0000a';
    assert_equals(t2.label, '\u0000a');
    track.setAttribute('label', '\u0000b', 'IDL attribute');
    assert_equals(t2.label, '\u0000b', 'content attribute');
}, document.title+', \\u0000');
</script>