From ff7c050be0b6f46cb4138c39f0d5bf7104843a2d Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Tue, 17 Nov 2015 16:34:28 +1300 Subject: [PATCH] Bug 1223696. Don't destroy VideoFrameContainer when we reach MetadataLoaded without a video track. r=jwwang --- dom/canvas/test/captureStream_common.js | 1 + dom/html/HTMLMediaElement.cpp | 10 +--- dom/media/tests/mochitest/mochitest.ini | 1 + .../test_getUserMedia_bug1223696.html | 48 +++++++++++++++++++ 4 files changed, 51 insertions(+), 9 deletions(-) create mode 100644 dom/media/tests/mochitest/test_getUserMedia_bug1223696.html diff --git a/dom/canvas/test/captureStream_common.js b/dom/canvas/test/captureStream_common.js index 6b9b4c66a8f..0912425c8ce 100644 --- a/dom/canvas/test/captureStream_common.js +++ b/dom/canvas/test/captureStream_common.js @@ -28,6 +28,7 @@ CaptureStreamTestHelper.prototype = { blackTransparent: { data: [0, 0, 0, 0], name: "blackTransparent" }, green: { data: [0, 255, 0, 255], name: "green" }, red: { data: [255, 0, 0, 255], name: "red" }, + grey: { data: [128, 128, 128, 255], name: "grey" }, /* Default element size for createAndAppendElement() */ elemWidth: 100, diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp index 06df311970e..850e669028e 100644 --- a/dom/html/HTMLMediaElement.cpp +++ b/dom/html/HTMLMediaElement.cpp @@ -3428,15 +3428,7 @@ void HTMLMediaElement::MetadataLoaded(const MediaInfo* aInfo, #endif // MOZ_EME } - // If this element had a video track, but consists only of an audio track now, - // delete the VideoFrameContainer. This happens when the src is changed to an - // audio only file. - // Else update its dimensions. - if (!aInfo->HasVideo()) { - ResetState(); - } else { - mWatchManager.ManualNotify(&HTMLMediaElement::UpdateReadyStateInternal); - } + mWatchManager.ManualNotify(&HTMLMediaElement::UpdateReadyStateInternal); if (IsVideo() && aInfo->HasVideo()) { // We are a video element playing video so update the screen wakelock diff --git a/dom/media/tests/mochitest/mochitest.ini b/dom/media/tests/mochitest/mochitest.ini index 53a064c8921..fe645f6afca 100644 --- a/dom/media/tests/mochitest/mochitest.ini +++ b/dom/media/tests/mochitest/mochitest.ini @@ -49,6 +49,7 @@ skip-if = buildapp == 'b2g' || toolkit == 'android' # no windowshare on b2g/andr skip-if = buildapp == 'b2g' || toolkit == 'android' # no windowshare on b2g/android # Bug 1141029 Mulet parity with B2G Desktop for TC [test_getUserMedia_basicVideoAudio.html] skip-if = (toolkit == 'gonk' || buildapp == 'mulet' && debug) # debug-only failure, turned an intermittent (bug 962579) into a permanant orange +[test_getUserMedia_bug1223696.html] [test_getUserMedia_constraints.html] [test_getUserMedia_callbacks.html] skip-if = toolkit == 'gonk' || buildapp == 'mulet' # Bug 1063290, intermittent timeout # TC: Bug 1144079 - Re-enable Mulet mochitests and reftests taskcluster-specific disables. diff --git a/dom/media/tests/mochitest/test_getUserMedia_bug1223696.html b/dom/media/tests/mochitest/test_getUserMedia_bug1223696.html new file mode 100644 index 00000000000..55b7b02d84c --- /dev/null +++ b/dom/media/tests/mochitest/test_getUserMedia_bug1223696.html @@ -0,0 +1,48 @@ + + + + + + + +
+
+
+ +