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

Side by Side Diff: LayoutTests/http/tests/media/media-source/mediasource-config-changes.js

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
« no previous file with comments | « no previous file | LayoutTests/http/tests/media/media-source/mediasource-duration.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Extract & return the resolution string from a filename, if any. 1 // Extract & return the resolution string from a filename, if any.
2 function resolutionFromFilename(filename) 2 function resolutionFromFilename(filename)
3 { 3 {
4 resolution = filename.replace(/^.*[^0-9]([0-9]+x[0-9]+)[^0-9].*$/, "$1"); 4 resolution = filename.replace(/^.*[^0-9]([0-9]+x[0-9]+)[^0-9].*$/, "$1");
5 if (resolution != filename) { 5 if (resolution != filename) {
6 return resolution; 6 return resolution;
7 } 7 }
8 return ""; 8 return "";
9 } 9 }
10 10
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 { 57 {
58 // Add the second buffer starting at 1.5 second. 58 // Add the second buffer starting at 1.5 second.
59 sourceBuffer.timestampOffset = 1.5; 59 sourceBuffer.timestampOffset = 1.5;
60 appendBuffer(test, sourceBuffer, dataB); 60 appendBuffer(test, sourceBuffer, dataB);
61 ++expectedResizeEventCount; 61 ++expectedResizeEventCount;
62 }); 62 });
63 63
64 test.waitForExpectedEvents(function() 64 test.waitForExpectedEvents(function()
65 { 65 {
66 // Truncate the presentation to a duration of 2 seconds. 66 // Truncate the presentation to a duration of 2 seconds.
67 assert_false(sourceBuffer.updating, "sourceBuffer.updating") ;
68
67 mediaSource.duration = 2; 69 mediaSource.duration = 2;
70
71 assert_true(sourceBuffer.updating, "sourceBuffer.updating");
72 test.expectEvent(sourceBuffer, "updatestart");
73 test.expectEvent(sourceBuffer, "update");
74 test.expectEvent(sourceBuffer, "updateend");
75 });
76
77 test.waitForExpectedEvents(function()
78 {
68 mediaSource.endOfStream(); 79 mediaSource.endOfStream();
69 80
70 if (expectResizeEvents) { 81 if (expectResizeEvents) {
71 for (var i = 0; i < expectedResizeEventCount; ++i) { 82 for (var i = 0; i < expectedResizeEventCount; ++i) {
72 test.expectEvent(mediaElement, "resize"); 83 test.expectEvent(mediaElement, "resize");
73 } 84 }
74 } 85 }
75 test.expectEvent(mediaElement, "ended"); 86 test.expectEvent(mediaElement, "ended");
76 mediaElement.play(); 87 mediaElement.play();
77 }); 88 });
78 89
79 test.waitForExpectedEvents(function() { 90 test.waitForExpectedEvents(function() {
80 test.done(); 91 test.done();
81 }); 92 });
82 }); 93 });
83 }); 94 });
84 }, description, { timeout: 10000 } ); 95 }, description, { timeout: 10000 } );
85 }; 96 };
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/media/media-source/mediasource-duration.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698