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

Side by Side Diff: LayoutTests/http/tests/media/media-source/mediasource-play.html

Issue 319213002: Fix MediaSource.duration setter behavior to match the current spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix release build buster Created 6 years, 6 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 <link rel='stylesheet' href='/w3c/resources/testharness.css'> 7 <link rel='stylesheet' href='/w3c/resources/testharness.css'>
8 </head> 8 </head>
9 <body> 9 <body>
10 <div id="log"></div> 10 <div id="log"></div>
11 <script> 11 <script>
12 mediasource_testafterdataloaded(function(test, mediaElement, mediaSour ce, segmentInfo, sourceBuffer, mediaData) 12 mediasource_testafterdataloaded(function(test, mediaElement, mediaSour ce, segmentInfo, sourceBuffer, mediaData)
13 { 13 {
14 test.failOnEvent(mediaElement, 'error'); 14 test.failOnEvent(mediaElement, 'error');
15 test.endOnEvent(mediaElement, 'ended');
16 15
17 sourceBuffer.addEventListener('updateend', test.step_func(function () 16 assert_false(sourceBuffer.updating, "sourceBuffer.updating");
17
18 sourceBuffer.appendBuffer(mediaData);
19
20 assert_true(sourceBuffer.updating, "sourceBuffer.updating");
21 test.expectEvent(sourceBuffer, "updateend");
22
23 test.waitForExpectedEvents(function()
18 { 24 {
25 assert_false(sourceBuffer.updating, "sourceBuffer.updating");
26
19 mediaSource.duration = 1; 27 mediaSource.duration = 1;
28
29 assert_true(sourceBuffer.updating, "sourceBuffer.updating");
30 test.expectEvent(sourceBuffer, "updateend");
31 });
32
33 test.waitForExpectedEvents(function()
34 {
20 mediaSource.endOfStream(); 35 mediaSource.endOfStream();
21 mediaElement.play(); 36 mediaElement.play();
22 }));
23 37
24 sourceBuffer.appendBuffer(mediaData); 38 test.endOnEvent(mediaElement, 'ended');
39 });
40
25 }, "Test normal playback case with MediaSource API", {timeout: 5000}); 41 }, "Test normal playback case with MediaSource API", {timeout: 5000});
26 </script> 42 </script>
27 </body> 43 </body>
28 </html> 44 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698