OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <html> |
| 3 <head> |
| 4 <title>AudioTrackList & VideoTrackList.getTrackById</title> |
| 5 <script src="../../resources/testharness.js"></script> |
| 6 <script src="../../resources/testharnessreport.js"></script> |
| 7 <script src="../media-file.js"></script> |
| 8 </head> |
| 9 <body> |
| 10 <div id="log"></div> |
| 11 <script> |
| 12 async_test(function(t) |
| 13 { |
| 14 var e = document.createElement('video'); |
| 15 |
| 16 assert_equals(e.audioTracks.length, 0); |
| 17 assert_equals(e.audioTracks.getTrackById(''), null); |
| 18 |
| 19 assert_equals(e.videoTracks.length, 0); |
| 20 assert_equals(e.videoTracks.getTrackById(''), null); |
| 21 |
| 22 e.src = findMediaFile('video', '../content/test'); |
| 23 |
| 24 e.addEventListener('loadedmetadata', t.step_func(function() |
| 25 { |
| 26 assert_equals(e.audioTracks.length, 1); |
| 27 assert_equals(e.audioTracks.getTrackById(e.audioTracks[0].id
), e.audioTracks[0]); |
| 28 assert_equals(e.audioTracks.getTrackById('fake-id'), null); |
| 29 |
| 30 assert_equals(e.videoTracks.length, 1); |
| 31 assert_equals(e.videoTracks.getTrackById(e.videoTracks[0].id
), e.videoTracks[0]); |
| 32 assert_equals(e.videoTracks.getTrackById('fake-id'), null); |
| 33 |
| 34 t.done(); |
| 35 })); |
| 36 }); |
| 37 </script> |
| 38 </body> |
| 39 </html> |
OLD | NEW |