OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <script src="/w3c/resources/testharness.js"></script> |
| 5 <script src="/w3c/resources/testharnessreport.js"></script> |
| 6 <script src="mediasource-util.js"></script> |
| 7 |
| 8 <link rel='stylesheet' href='/w3c/resources/testharness.css'> |
| 9 </head> |
| 10 <body> |
| 11 <div id="log"></div> |
| 12 <script> |
| 13 mediasource_testafterdataloaded(function(test, mediaElement, mediaSour
ce, segmentInfo, sourceBuffer, mediaData) |
| 14 { |
| 15 var initSegment = MediaSourceUtil.extractSegmentData(mediaData, se
gmentInfo.init); |
| 16 test.expectEvent(sourceBuffer, 'updateend', 'initSegment append en
ded.'); |
| 17 sourceBuffer.appendBuffer(initSegment); |
| 18 test.waitForExpectedEvents(function() |
| 19 { |
| 20 // TODO(servolk): Find a way to make tests more concise in JS |
| 21 assert_equals(mediaElement.videoTracks.length, 1, "videoTracks.l
ength"); |
| 22 assert_equals(mediaElement.videoTracks[0].id, "1", "videoTrack.i
d"); |
| 23 assert_equals(mediaElement.videoTracks[0].kind, "main", "videoTr
ack.kind"); |
| 24 assert_equals(mediaElement.videoTracks[0].label, "", "videoTrack
.label"); |
| 25 assert_equals(mediaElement.videoTracks[0].language, "eng", "vide
oTrack.language"); |
| 26 |
| 27 assert_equals(mediaElement.audioTracks.length, 1, "audioTracks.l
ength"); |
| 28 assert_equals(mediaElement.audioTracks[0].id, "2", "audioTrack.i
d"); |
| 29 assert_equals(mediaElement.audioTracks[0].kind, "main", "audioTr
ack.kind"); |
| 30 assert_equals(mediaElement.audioTracks[0].label, "", "audioTrack
.label"); |
| 31 assert_equals(mediaElement.audioTracks[0].language, "eng", "audi
oTrack.language"); |
| 32 |
| 33 assert_equals(sourceBuffer.videoTracks.length, 1, "videoTracks.l
ength"); |
| 34 assert_equals(sourceBuffer.videoTracks[0].id, "1", "videoTrack.i
d"); |
| 35 assert_equals(sourceBuffer.videoTracks[0].kind, "main", "videoTr
ack.kind"); |
| 36 assert_equals(sourceBuffer.videoTracks[0].label, "", "videoTrack
.label"); |
| 37 assert_equals(sourceBuffer.videoTracks[0].language, "eng", "vide
oTrack.language"); |
| 38 |
| 39 assert_equals(sourceBuffer.audioTracks.length, 1, "audioTracks.l
ength"); |
| 40 assert_equals(sourceBuffer.audioTracks[0].id, "2", "audioTrack.i
d"); |
| 41 assert_equals(sourceBuffer.audioTracks[0].kind, "main", "audioTr
ack.kind"); |
| 42 assert_equals(sourceBuffer.audioTracks[0].label, "", "audioTrack
.label"); |
| 43 assert_equals(sourceBuffer.audioTracks[0].language, "eng", "audi
oTrack.language"); |
| 44 |
| 45 test.done(); |
| 46 }); |
| 47 }, "MediaSource audio tracks"); |
| 48 </script> |
| 49 </body> |
| 50 </html> |
| 51 |
OLD | NEW |