OLD | NEW |
1 <!doctype html> | 1 <!doctype html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>VideoTrack.selected change</title> | 4 <title>VideoTrack.selected change</title> |
5 <script src="../../resources/testharness.js"></script> | 5 <script src="../../resources/testharness.js"></script> |
6 <script src="../../resources/testharnessreport.js"></script> | 6 <script src="../../resources/testharnessreport.js"></script> |
7 <script src="../media-file.js"></script> | 7 <script src="../media-file.js"></script> |
8 </head> | 8 </head> |
9 <body> | 9 <body> |
10 <div id="log"></div> | 10 <div id="log"></div> |
11 <script> | 11 <script> |
12 async_test(function(t) | 12 async_test(function(t) |
13 { | 13 { |
14 var e = document.createElement("video"); | 14 var e = document.createElement("video"); |
15 // add to body to prevent GC pending http://crbug.com/400659 | |
16 document.body.appendChild(e); | |
17 e.src = findMediaFile("video", "../content/test"); | 15 e.src = findMediaFile("video", "../content/test"); |
18 | 16 |
19 e.onloadedmetadata = t.step_func(function() | 17 e.onloadedmetadata = t.step_func(function() |
20 { | 18 { |
21 assert_equals(e.videoTracks.length, 1, "videoTracks.length")
; | 19 assert_equals(e.videoTracks.length, 1, "videoTracks.length")
; |
22 assert_equals(e.videoTracks.selectedIndex, 0, "videoTracks.s
electedIndex (initial)"); | 20 assert_equals(e.videoTracks.selectedIndex, 0, "videoTracks.s
electedIndex (initial)"); |
23 assert_true(e.videoTracks[0].selected, "videoTrack.selected
(initial)"); | 21 assert_true(e.videoTracks[0].selected, "videoTrack.selected
(initial)"); |
24 e.videoTracks[0].selected = false; | 22 e.videoTracks[0].selected = false; |
25 assert_equals(e.videoTracks.selectedIndex, -1, "videoTracks.
selectedIndex (first setter)"); | 23 assert_equals(e.videoTracks.selectedIndex, -1, "videoTracks.
selectedIndex (first setter)"); |
26 assert_false(e.videoTracks[0].selected, "videoTrack.selected
(first setter)"); | 24 assert_false(e.videoTracks[0].selected, "videoTrack.selected
(first setter)"); |
(...skipping 10 matching lines...) Expand all Loading... |
37 assert_equals(e.videoTracks.selectedIndex, 0, "video
Tracks.selectedIndex (change event)"); | 35 assert_equals(e.videoTracks.selectedIndex, 0, "video
Tracks.selectedIndex (change event)"); |
38 assert_true(e.videoTracks[0].selected, "videoTrack.s
elected (change event)"); | 36 assert_true(e.videoTracks[0].selected, "videoTrack.s
elected (change event)"); |
39 t.done(); | 37 t.done(); |
40 }); | 38 }); |
41 }), 0); | 39 }), 0); |
42 }); | 40 }); |
43 }, "VideoTrackList track change"); | 41 }, "VideoTrackList track change"); |
44 </script> | 42 </script> |
45 </body> | 43 </body> |
46 </html> | 44 </html> |
OLD | NEW |