Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(236)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-addsourcebuffer.html

Issue 2226443002: Support multiple media tracks in MSE / ChunkDemuxer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mp4 format is not supported on some trybots, so use webm Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="/w3c/resources/testharness.js"></script> 4 <script src="/w3c/resources/testharness.js"></script>
5 <script src="/w3c/resources/testharnessreport.js"></script> 5 <script src="/w3c/resources/testharnessreport.js"></script>
6 <script src="mediasource-util.js"></script> 6 <script src="mediasource-util.js"></script>
7 7
8 <link rel='stylesheet' href='/w3c/resources/testharness.css'> 8 <link rel='stylesheet' href='/w3c/resources/testharness.css'>
9 </head> 9 </head>
10 <body> 10 <body>
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 127
128 var sourceBufferA = mediaSource.addSourceBuffer(videoMimetype); 128 var sourceBufferA = mediaSource.addSourceBuffer(videoMimetype);
129 var sourceBufferB = mediaSource.addSourceBuffer(audioMimetype); 129 var sourceBufferB = mediaSource.addSourceBuffer(audioMimetype);
130 assert_equals(mediaSource.sourceBuffers[0], sourceBufferA, "source BufferA is in mediaSource.sourceBuffers"); 130 assert_equals(mediaSource.sourceBuffers[0], sourceBufferA, "source BufferA is in mediaSource.sourceBuffers");
131 assert_equals(mediaSource.activeSourceBuffers.length, 0, "SourceBu fferA is not in mediaSource.activeSourceBuffers"); 131 assert_equals(mediaSource.activeSourceBuffers.length, 0, "SourceBu fferA is not in mediaSource.activeSourceBuffers");
132 assert_equals(mediaSource.sourceBuffers[1], sourceBufferB, "source BufferB is in mediaSource.sourceBuffers"); 132 assert_equals(mediaSource.sourceBuffers[1], sourceBufferB, "source BufferB is in mediaSource.sourceBuffers");
133 assert_equals(mediaSource.activeSourceBuffers.length, 0, "SourceBu fferB is not in mediaSource.activeSourceBuffers"); 133 assert_equals(mediaSource.activeSourceBuffers.length, 0, "SourceBu fferB is not in mediaSource.activeSourceBuffers");
134 test.done(); 134 test.done();
135 }, "Test addSourceBuffer() with AAC and H.264 in separate SourceBuffer s"); 135 }, "Test addSourceBuffer() with AAC and H.264 in separate SourceBuffer s");
136 136
137 mediasource_test(function(test, mediaElement, mediaSource) 137 mediasource_testafterdataloaded(function(test, mediaElement, mediaSour ce, segmentInfo, sourceBuffer, mediaData)
138 { 138 {
139 var reachedLimit = false; 139 sourceBuffer.appendBuffer(mediaData);
140 140 test.expectEvent(sourceBuffer, "updateend");
141 // The 20 here is an arbitrary upper limit to make sure the test te rminates. This test 141 test.waitForExpectedEvents(function()
142 // assumes that implementations won't support more than 20 SourceBu ffers simultaneously. 142 {
143 for (var i = 0; i < 20; ++i) { 143 assert_throws({name: "QuotaExceededError"},
144 try { 144 function() { mediaSource.addSourceBuffer(MediaSourceUtil.A UDIO_VIDEO_TYPE); },
145 mediaSource.addSourceBuffer(MediaSourceUtil.AUDIO_VIDEO_TYP E); 145 "addSourceBuffer must throw an exception if the MediaSourc e has already got some data");
146 } catch(e) { 146 test.done();
147 assert_equals(e.name, "QuotaExceededError"); 147 });
148 reachedLimit = true; 148 }, "Test addSourceBuffer() throws QuotaExceededError after data has be en appended.");
wolenetz 2016/09/13 21:03:14 nit: change this to be similar to the unit test: o
servolk 2016/09/14 18:15:27 Wait. First, there's only one sourceBuffer here, t
wolenetz 2016/09/14 23:31:21 I'm being a little pedantic here, but tests kind o
wolenetz 2016/09/14 23:34:28 mediasource-util.js includes a helper for this. Us
servolk 2016/09/15 00:18:32 Ah, ok, I see what you mean now. Done. I guess we
149 break;
150 }
151 }
152 assert_true(reachedLimit, "Reached SourceBuffer limit.");
153 test.done();
154 }, "Test addSourceBuffer() QuotaExceededError.");
155 </script> 149 </script>
156 </body> 150 </body>
157 </html> 151 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698