Bug 1300658 P3 Don't fail test_consoleAndBlobs.html if other console messages are received. r=baku

This commit is contained in:
Ben Kelly 2016-09-12 11:21:02 -07:00
parent 7bb3320bdd
commit 33f12f6300
2 changed files with 7 additions and 5 deletions

View File

@ -22,12 +22,14 @@
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();
}
}
}

View File

@ -5,4 +5,4 @@
"use strict";
var b = new Blob(['123'], { type: 'foo/bar'});
console.log(b);
console.log({ msg: 'consoleAndBlobs', blob: b });