Bug 1279095: reduce warning messages.
MozReview-Commit-ID: H349u2VgyGT
--- a/dom/canvas/test/captureStream_common.js
+++ b/dom/canvas/test/captureStream_common.js
@@ -112,22 +112,26 @@ CaptureStreamTestHelper.prototype = {
/*
* Returns a promise that resolves when the provided function |test|
* returns true.
*/
waitForPixel: function (video, offsetX, offsetY, test, timeout, width, height) {
return new Promise(resolve => {
const startTime = video.currentTime;
+ var log_warning = true;
var ontimeupdate = () => {
var pixelMatch = false;
try {
pixelMatch = test(this.getPixel(video, offsetX, offsetY, width, height));
} catch (NS_ERROR_NOT_AVAILABLE) {
- info("Waiting for pixel but no video available");
+ if (log_warning) {
+ info("Waiting for pixel but no video available");
+ log_warning = false;
+ }
}
if (!pixelMatch &&
(!timeout || video.currentTime < startTime + (timeout / 1000.0))) {
// No match yet and,
// No timeout (waiting indefinitely) or |timeout| has not passed yet.
return;
}
video.removeEventListener("timeupdate", ontimeupdate);