From ce54507b179f1749f0bd5c86edb499dfa1543c07 Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Tue, 8 Dec 2015 15:05:50 -0500 Subject: [PATCH] Bug 1229987: P3. Update mochitests and add new one verifying behavior. r=cpearce --- dom/media/mediasource/test/mochitest.ini | 12 ++-- .../test/test_BufferingWait_mp4.html | 8 +-- .../test/test_DrainOnMissingData_mp4.html | 60 +++++++++++++++++++ .../mediasource/test/test_PlayEvents.html | 3 - .../test/test_WaitingOnMissingData_mp4.html | 5 +- .../test_WaitingToEndedTransition_mp4.html | 5 +- 6 files changed, 73 insertions(+), 20 deletions(-) create mode 100644 dom/media/mediasource/test/test_DrainOnMissingData_mp4.html diff --git a/dom/media/mediasource/test/mochitest.ini b/dom/media/mediasource/test/mochitest.ini index 9dfee51bed18..70438b072281 100644 --- a/dom/media/mediasource/test/mochitest.ini +++ b/dom/media/mediasource/test/mochitest.ini @@ -40,7 +40,9 @@ skip-if = ((os == "win" && os_version == "5.1") || (os != "win" && os != "mac")) [test_BufferingWait.html] skip-if = toolkit == 'android' #timeout android bug 1199531 [test_BufferingWait_mp4.html] -skip-if = ((os == "win" && os_version == "5.1") || (os != "win" && os != "mac") || (os == "win" && os_version == "6.1")) # Only supported on osx and vista+, disabling on win7 bug 1191138 +skip-if = ((os == "win" && os_version == "5.1") || (os != "win" && os != "mac")) # Only supported on osx and vista+ +[test_DrainOnMissingData_mp4.html] +skip-if = ((os == "win" && os_version == "5.1") || (os != "win" && os != "mac")) # Only supported on osx and vista+ [test_EndOfStream.html] skip-if = (true || toolkit == 'android' || buildapp == 'mulet') #timeout android/mulet only bug 1101187 and bug 1182946 [test_EndOfStream_mp4.html] @@ -51,7 +53,7 @@ skip-if = ((os == "win" && os_version == "5.1") || (os != "win" && os != "mac")) [test_FrameSelection.html] [test_HaveMetadataUnbufferedSeek.html] [test_HaveMetadataUnbufferedSeek_mp4.html] -skip-if = ((os == "win" && os_version == "5.1") || (os != "win" && os != "mac") || (os == "win" && os_version == "6.1")) # Only supported on osx and vista+, disabling on win7 bug 1191138 +skip-if = ((os == "win" && os_version == "5.1") || (os != "win" && os != "mac")) # Only supported on osx and vista+ [test_LoadedDataFired_mp4.html] skip-if = ((os == "win" && os_version == "5.1") || (os != "win" && os != "mac")) # Only supported on osx and vista+ [test_LoadedMetadataFired.html] @@ -96,11 +98,11 @@ skip-if = ((os == "win" && os_version == "5.1") || (os != "win" && os != "mac")) skip-if = ((os == "win" && os_version == "5.1") || (os != "win" && os != "mac")) # Only supported on osx and vista+ [test_TruncatedDuration.html] [test_TruncatedDuration_mp4.html] -skip-if = ((os == "win" && os_version == "5.1") || (os != "win" && os != "mac") || (os == "win" && os_version == "6.1")) # Only supported on osx and vista+, disabling on win7 bug 1191138 +skip-if = ((os == "win" && os_version == "5.1") || (os != "win" && os != "mac")) # Only supported on osx and vista+ [test_WaitingOnMissingData.html] skip-if = true # Disabled due to bug 1124493 and friends. WebM MSE is deprioritized. [test_WaitingOnMissingData_mp4.html] -skip-if = ((os == "win" && os_version == "5.1") || (os != "win" && os != "mac") || (os == "win" && os_version == "6.1")) # Only supported on osx and vista+, disabling on win7 bug 1191138 +skip-if = ((os == "win" && os_version == "5.1") || (os != "win" && os != "mac")) # Only supported on osx and vista+ [test_WaitingToEndedTransition_mp4.html] -skip-if = ((os == "win" && os_version == "5.1") || (os != "win" && os != "mac") || (os == "win" && os_version == "6.1")) # Only supported on osx and vista+, disabling on win7 bug 1191138 +skip-if = ((os == "win" && os_version == "5.1") || (os != "win" && os != "mac")) # Only supported on osx and vista+ diff --git a/dom/media/mediasource/test/test_BufferingWait_mp4.html b/dom/media/mediasource/test/test_BufferingWait_mp4.html index 289b915d8383..9afc509276db 100644 --- a/dom/media/mediasource/test/test_BufferingWait_mp4.html +++ b/dom/media/mediasource/test/test_BufferingWait_mp4.html @@ -41,18 +41,14 @@ runWithMSE(function(ms, v) { /* Note - Missing |bipbop4| segment here corresponding to (2.41, 3.20] */ .then(fetchAndLoad.bind(null, sb, 'bipbop/bipbop', ['5'], '.m4s')) .then(function() { - // Some decoders (Windows in particular) may keep up to 25 frames queued - // before returning a sample. 0.7 is 1.62s - 25 * 0.03333 - var promise = waitUntilTime(0.7); + var promise = waitUntilTime(1.62-1/30); info("Playing video. It should play for a bit, then fire 'waiting'"); v.play(); return promise; }).then(function() { window.firstStop = Date.now(); fetchAndLoad(sb, 'bipbop/bipbop', ['3'], '.m4s'); - // Some decoders (Windows in particular) may keep up to 25 frames queued - // before returning a sample. 1.5 is 2.41s - 25 * 0.03333 - return waitUntilTime(1.5); + return waitUntilTime(2.41-1/30); }).then(function() { var waitDuration = (Date.now() - window.firstStop) / 1000; ok(waitDuration < 15, "Should not spend an inordinate amount of time buffering: " + waitDuration); diff --git a/dom/media/mediasource/test/test_DrainOnMissingData_mp4.html b/dom/media/mediasource/test/test_DrainOnMissingData_mp4.html new file mode 100644 index 000000000000..f2284377f695 --- /dev/null +++ b/dom/media/mediasource/test/test_DrainOnMissingData_mp4.html @@ -0,0 +1,60 @@ + + + + MSE: |waiting| event when source data is missing + + + + + +

+
+ + diff --git a/dom/media/mediasource/test/test_PlayEvents.html b/dom/media/mediasource/test/test_PlayEvents.html index 1f6f1ad11a0e..54e97328f1a0 100644 --- a/dom/media/mediasource/test/test_PlayEvents.html +++ b/dom/media/mediasource/test/test_PlayEvents.html @@ -37,9 +37,6 @@ runWithMSE(function(ms, el) { var promises = []; promises.push(once(el, 'loadeddata')); promises.push(once(el, 'canplay')); - // Load [0, 1.601666). We must ensure that we load over 25 frames as the - // windows H264 decoder will not produce a sample until then - // (bug 1191138). promises.push(fetchAndLoad(videosb, 'bipbop/bipbop_video', range(1, 3), '.m4s')); return Promise.all(promises); }) diff --git a/dom/media/mediasource/test/test_WaitingOnMissingData_mp4.html b/dom/media/mediasource/test/test_WaitingOnMissingData_mp4.html index b9d52daba958..5b83d5420dd7 100644 --- a/dom/media/mediasource/test/test_WaitingOnMissingData_mp4.html +++ b/dom/media/mediasource/test/test_WaitingOnMissingData_mp4.html @@ -40,9 +40,8 @@ runWithMSE(function(ms, el) { // currentTime is based on the current video frame, so if the audio ends just before // the next video frame, currentTime can be up to 1 frame's worth earlier than // min(audioEnd, videoEnd). - // Some decoders (Windows in particular) may keep up to 25 frames queued. - isfuzzy(el.currentTime, Math.min(audiosb.buffered.end(0), videosb.buffered.end(0)) - 1/60, - 25 * 1/30, "Got a waiting event at " + el.currentTime); + isfuzzy(el.currentTime, Math.min(audiosb.buffered.end(0), videosb.buffered.end(0)) - 1/30, + 0.04, "Got a waiting event at " + el.currentTime); info("Loading more data"); var p = once(el, 'ended'); var loads = Promise.all([fetchAndLoad(audiosb, 'bipbop/bipbop_audio', [5], '.m4s'), diff --git a/dom/media/mediasource/test/test_WaitingToEndedTransition_mp4.html b/dom/media/mediasource/test/test_WaitingToEndedTransition_mp4.html index 185d3e6242bb..a8a83490f07c 100644 --- a/dom/media/mediasource/test/test_WaitingToEndedTransition_mp4.html +++ b/dom/media/mediasource/test/test_WaitingToEndedTransition_mp4.html @@ -39,9 +39,8 @@ runWithMSE(function(ms, el) { // the next video frame, currentTime can be up to 1 frame's worth earlier than // min(audioEnd, videoEnd). // Some decoders (Windows in particular) may keep up to 25 frames queued. - isfuzzy(el.currentTime, Math.min(audiosb.buffered.end(0), videosb.buffered.end(0)) - 1/60, - 25 * 1/30, "Got a waiting event at " + el.currentTime); - }).then(function() { + isfuzzy(el.currentTime, Math.min(audiosb.buffered.end(0), videosb.buffered.end(0)) - 1/30, + 0.04, "Got a waiting event at " + el.currentTime); var p = once(el, 'ended'); ms.endOfStream(); return p;