зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1463614 - Fix intermittent failure in test_timer.html, r=me
This commit is contained in:
Родитель
16731e010d
Коммит
21437f85f8
|
@ -21,16 +21,11 @@ function ConsoleListener() {
|
|||
ConsoleListener.prototype = {
|
||||
observe(aSubject, aTopic, aData) {
|
||||
let obj = aSubject.wrappedJSObject;
|
||||
if (obj.arguments[0] != 'test') {
|
||||
if (obj.arguments[0] != "test_bug1463614") {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this._cb) {
|
||||
ok(false, "Callback not set!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this._cb(obj)) {
|
||||
if (!this._cb || !this._cb(obj)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -57,10 +52,10 @@ async function runTest() {
|
|||
let cl = listener.waitFor(obj => {
|
||||
return ("timer" in obj) &&
|
||||
("name" in obj.timer) &&
|
||||
obj.timer.name == 'test';
|
||||
obj.timer.name == "test_bug1463614";
|
||||
});
|
||||
|
||||
console.time('test');
|
||||
console.time("test_bug1463614");
|
||||
await cl;
|
||||
ok(true, "Console.time received!");
|
||||
|
||||
|
@ -68,7 +63,7 @@ async function runTest() {
|
|||
cl = listener.waitFor(obj => {
|
||||
return ("timer" in obj) &&
|
||||
("name" in obj.timer) &&
|
||||
obj.timer.name == 'test' &&
|
||||
obj.timer.name == "test_bug1463614" &&
|
||||
("duration" in obj.timer) &&
|
||||
obj.timer.duration >= 0 &&
|
||||
obj.arguments[1] == 1 &&
|
||||
|
@ -76,7 +71,7 @@ async function runTest() {
|
|||
obj.arguments[3] == 3 &&
|
||||
obj.arguments[4] == 4;
|
||||
});
|
||||
console.timeLog('test', 1, 2, 3, 4);
|
||||
console.timeLog("test_bug1463614", 1, 2, 3, 4);
|
||||
await cl;
|
||||
ok(true, "Console.timeLog received!");
|
||||
|
||||
|
@ -84,11 +79,11 @@ async function runTest() {
|
|||
cl = listener.waitFor(obj => {
|
||||
return ("timer" in obj) &&
|
||||
("name" in obj.timer) &&
|
||||
obj.timer.name == 'test' &&
|
||||
obj.timer.name == "test_bug1463614" &&
|
||||
("duration" in obj.timer) &&
|
||||
obj.timer.duration >= 0;
|
||||
});
|
||||
console.timeEnd('test');
|
||||
console.timeEnd("test_bug1463614");
|
||||
await cl;
|
||||
ok(true, "Console.timeEnd received!");
|
||||
|
||||
|
@ -96,10 +91,10 @@ async function runTest() {
|
|||
cl = listener.waitFor(obj => {
|
||||
return ("timer" in obj) &&
|
||||
("name" in obj.timer) &&
|
||||
obj.timer.name == 'test' &&
|
||||
obj.timer.name == "test_bug1463614" &&
|
||||
("error" in obj.timer);
|
||||
});
|
||||
console.timeLog('test');
|
||||
console.timeLog("test_bug1463614");
|
||||
await cl;
|
||||
ok(true, "Console.time with error received!");
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче