Bug 1300658 P3 Don't fail test_consoleAndBlobs.html if other console messages are received. r=baku
authorBen Kelly <ben@wanderview.com>
Tue, 13 Sep 2016 20:14:02 -0700
changeset 313768 c66ad87e9f779bfa14362641cc6261026846b511
parent 313767 23830bda70ee962ff89e154b4b54155d6f9bbd43
child 313769 466a5fb382edd3f6bdc9eade5eadd0037bb35598
push id81710
push userbkelly@mozilla.com
push dateWed, 14 Sep 2016 03:25:36 +0000
treeherdermozilla-inbound@f7275e98b63b [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 });