Bug 1223696 - Make canvas captureStream helper resilient to exceptions when there's no video. r=roc

--HG--
extra : commitid : FAzUHddlKxp
extra : rebase_source : cdd127adc5352c464675635626274fc0d0da2c0e
This commit is contained in:
Andreas Pehrson 2015-11-16 10:58:13 +08:00
parent ddc78c3b0c
commit efff11f482

View File

@ -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,