OLD | NEW |
1 <!doctype html> | 1 <!doctype html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>AudioTrackList & VideoTrackList after load()</title> | 4 <title>AudioTrackList & VideoTrackList after load()</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.addEventListener("loadedmetadata", t.step_func(function() | 17 e.addEventListener("loadedmetadata", t.step_func(function() |
20 { | 18 { |
21 | 19 |
22 assert_equals(e.audioTracks.length, 1, "audioTracks.length")
; | 20 assert_equals(e.audioTracks.length, 1, "audioTracks.length")
; |
23 assert_equals(e.videoTracks.length, 1, "videoTracks.length")
; | 21 assert_equals(e.videoTracks.length, 1, "videoTracks.length")
; |
24 assert_equals(e.videoTracks.selectedIndex, 0, "videoTracks.s
electedIndex"); | 22 assert_equals(e.videoTracks.selectedIndex, 0, "videoTracks.s
electedIndex"); |
25 | 23 |
26 e.load(); | 24 e.load(); |
27 | 25 |
28 assert_equals(e.audioTracks.length, 0, "audioTracks.length")
; | 26 assert_equals(e.audioTracks.length, 0, "audioTracks.length")
; |
29 assert_equals(e.videoTracks.length, 0, "videoTracks.length")
; | 27 assert_equals(e.videoTracks.length, 0, "videoTracks.length")
; |
30 assert_equals(e.videoTracks.selectedIndex, -1, "videoTracks.
selectedIndex"); | 28 assert_equals(e.videoTracks.selectedIndex, -1, "videoTracks.
selectedIndex"); |
31 | 29 |
32 t.done(); | 30 t.done(); |
33 })); | 31 })); |
34 }); | 32 }); |
35 </script> | 33 </script> |
36 </body> | 34 </body> |
37 </html> | 35 </html> |
OLD | NEW |