Bug 1300658 P3 Don't fail test_consoleAndBlobs.html if other console messages are received. r=baku
authorBen Kelly <ben@wanderview.com>
Mon, 12 Sep 2016 11:21:02 -0700
changeset 354864 2453a17bc6c12fe822e87f56b2914b16db442b60
parent 354863 623fb54446e0e10f24e2250f66d85a0427e099ff
child 354865 2d98a586c04dce1fed582f07a764cc293a73b5dd
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1300658
milestone51.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1300658 P3 Don't fail test_consoleAndBlobs.html if other console messages are received. r=baku
dom/workers/test/test_consoleAndBlobs.html
dom/workers/test/worker_consoleAndBlobs.js
--- a/dom/workers/test/test_consoleAndBlobs.html
+++ b/dom/workers/test/test_consoleAndBlobs.html
@@ -17,22 +17,24 @@
     SpecialPowers.addObserver(this, "console-api-log-event", false);
   }
 
   var order = 0;
   consoleListener.prototype  = {
     observe: function(aSubject, aTopic, aData) {
       ok(true, "Something has been received");
       is(aTopic, "console-api-log-event");
-      SpecialPowers.removeObserver(this, "console-api-log-event");
 
       var obj = aSubject.wrappedJSObject;
-      is(obj.arguments[0].size, 3, "The size is correct");
-      is(obj.arguments[0].type, 'foo/bar', "The type is correct");
-      SimpleTest.finish();
+      if (obj.arguments[0] && obj.arguments[0].msg === 'consoleAndBlobs') {
+        SpecialPowers.removeObserver(this, "console-api-log-event");
+        is(obj.arguments[0].blob.size, 3, "The size is correct");
+        is(obj.arguments[0].blob.type, 'foo/bar', "The type is correct");
+        SimpleTest.finish();
+      }
     }
   }
 
   var cl = new consoleListener();
 
   new Worker('worker_consoleAndBlobs.js');
   SimpleTest.waitForExplicitFinish();
 
--- a/dom/workers/test/worker_consoleAndBlobs.js
+++ b/dom/workers/test/worker_consoleAndBlobs.js
@@ -1,8 +1,8 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 "use strict";
 
 var b = new Blob(['123'], { type: 'foo/bar'});
-console.log(b);
+console.log({ msg: 'consoleAndBlobs', blob: b });