summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TrackEvent/constructor.html
blob: 54567d14a68e8fd4ea6886ed4b26291dfe14bbb5 (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
<!doctype html>
<title>TrackEvent constructor</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<div id=log></div>
<script>
test(function(){
    var ev = new TrackEvent('foo');
    assert_true(ev instanceof TrackEvent, 'ev instanceof TrackEvent');
    assert_true(ev instanceof Event, 'ev instanceof Event');
    assert_equals(ev.track, null, 'ev.track');
    ev.track = {};
    assert_equals(ev.track, null, 'ev.track after assignment');
}, document.title+', one arg');
test(function(){
    var obj = {};
    var ev = new TrackEvent('foo', {track:obj});
    assert_true(ev instanceof TrackEvent, 'ev instanceof TrackEvent');
    assert_true(ev instanceof Event, 'ev instanceof Event');
    assert_equals(ev.track, obj, 'ev.track');
    ev.track = {};
    assert_equals(ev.track, obj, 'ev.track after assignment');
}, document.title+', two args');
</script>