Bug 1279095: reduce warning messages. draft
authorNils Ohlmeier [:drno] <drno@ohlmeier.org>
Mon, 03 Oct 2016 12:49:34 -0700
changeset 420245 274a4a9311062c85bc2743d0f8b348087051533a
parent 420017 955840bfd3c20eb24dd5a01be27bdc55c489a285
child 532763 477f45925abfec6af768aabc8d368084afa5453f
push id31143
push userdrno@ohlmeier.org
push dateMon, 03 Oct 2016 19:49:57 +0000
bugs1279095
milestone52.0a1
Bug 1279095: reduce warning messages. MozReview-Commit-ID: H349u2VgyGT
dom/canvas/test/captureStream_common.js
--- 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);