From efff11f482287a65d5583fb19049d4e69ec7386e Mon Sep 17 00:00:00 2001 From: Andreas Pehrson Date: Mon, 16 Nov 2015 10:58:13 +0800 Subject: [PATCH] Bug 1223696 - Make canvas captureStream helper resilient to exceptions when there's no video. r=roc --HG-- extra : commitid : FAzUHddlKxp extra : rebase_source : cdd127adc5352c464675635626274fc0d0da2c0e --- dom/canvas/test/captureStream_common.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dom/canvas/test/captureStream_common.js b/dom/canvas/test/captureStream_common.js index 6b9b4c66a8fc..368b37a39b52 100644 --- a/dom/canvas/test/captureStream_common.js +++ b/dom/canvas/test/captureStream_common.js @@ -97,7 +97,12 @@ CaptureStreamTestHelper.prototype = { const startTime = video.currentTime; CaptureStreamTestHelper2D.prototype.clear.call(this, this.cout); var ontimeupdate = () => { - const pixelMatch = test(this.getPixel(video, offsetX, offsetY)); + var pixelMatch = false; + try { + pixelMatch = test(this.getPixel(video, offsetX, offsetY)); + } catch (NS_ERROR_NOT_AVAILABLE) { + info("Waiting for pixel but no video available"); + } if (!pixelMatch && (!timeout || video.currentTime < startTime + (timeout / 1000.0))) { // No match yet and,