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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/media/video-play-stall.html

Issue 2423903003: AudioRendererImpl: Don't advance time when rendering stops. (Closed)
Patch Set: feedback Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/renderers/audio_renderer_impl_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/media/video-play-stall.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-play-stall.html b/third_party/WebKit/LayoutTests/http/tests/media/video-play-stall.html
index 0e99c95e121e08398605b5734cc246fd24fcdab8..8ab9dcf78669a52761b5c3762889b7b2333ec0e2 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-play-stall.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-play-stall.html
@@ -11,12 +11,16 @@ async_test(t => {
let log_console = document.getElementById('log_console');
// For debugging.
- function logEvent(e) {
+ function logMessage(msg) {
let span = document.createElement("span");
- span.innerHTML = 'event: ' + e.type + '<br>';
+ span.innerHTML = msg + '<br>';
log_console.appendChild(span);
};
+ function logEvent(e) {
+ logMessage('event: ' + e.type);
+ };
+
playback_ew = new EventWatcher(t, video, [
'canplay',
'canplaythrough',
@@ -46,6 +50,25 @@ async_test(t => {
return promise;
}
+ // Monitor timeupdate w.r.t. readyState throughout test. Time should not
+ // advance while readyState <= HAVE_CURRENT_DATA.
+ let timeAtStartOfWaiting = null;
+ video.addEventListener('timeupdate', t.step_func(function(e) {
+ logMessage('event: timeupdate at time: ' + e.target.currentTime +' readystate:' + e.target.readyState);
+ if (e.target.readyState <= HTMLMediaElement.HAVE_CURRENT_DATA) {
+ if (timeAtStartOfWaiting == null) {
+ // Note the time when waiting begins.
+ timeAtStartOfWaiting = e.target.currentTime;
+ } else {
+ // Verify that current time is not advancing while waiting.
+ assert_equals(e.target.currentTime, timeAtStartOfWaiting);
+ }
+ } else if (timeAtStartOfWaiting != null) {
+ // Waiting has ended, so clear timeAtStartOfWaiting.
+ timeAtStartOfWaiting = null;
+ }
+ }));
+
// NOTE: Event sequence verification is achieved by chaining together
// promises via then(). To verify separate parallel event sequences (e.g.
// playback vs network), we setup separate chains of promises. Promise.all
@@ -73,7 +96,7 @@ async_test(t => {
// Now observe waiting event and verify readyState
.then(() => playback_ew.wait_for('waiting')).then(logEvent)
.then(t.step_func(function(){
- assert_equals(HTMLMediaElement.HAVE_CURRENT_DATA, video.readyState);
+ assert_equals(video.readyState, HTMLMediaElement.HAVE_CURRENT_DATA);
})),
// timeupdate should fire throughout playback. Make sure we see one.
« no previous file with comments | « media/renderers/audio_renderer_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698