mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 20:05:49 +00:00
Backed out changeset 0a3b00521c3b (bug 965644) for turning test_promise.html nearly permafail
This commit is contained in:
parent
5e91ece22c
commit
5f29f7751e
@ -202,23 +202,15 @@ function promiseRacePromiseArray() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var arr = [
|
var arr = [
|
||||||
new Promise(function(resolve) {
|
timeoutPromise(50),
|
||||||
resolve("first");
|
timeoutPromise(20),
|
||||||
}),
|
timeoutPromise(30),
|
||||||
Promise.resolve("second"),
|
timeoutPromise(100)
|
||||||
new Promise(function() {}),
|
|
||||||
new Promise(function(resolve) {
|
|
||||||
setTimeout(function() {
|
|
||||||
setTimeout(function() {
|
|
||||||
resolve("fourth");
|
|
||||||
}, 0);
|
|
||||||
}, 0);
|
|
||||||
}),
|
|
||||||
];
|
];
|
||||||
|
|
||||||
var p = Promise.race(arr);
|
var p = Promise.race(arr);
|
||||||
p.then(function(winner) {
|
p.then(function(winner) {
|
||||||
is(winner, "first", "First queued resolution should win the race.");
|
is(winner, 20, "Fastest timeout should win.");
|
||||||
runTest();
|
runTest();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -565,23 +565,15 @@ function promiseRacePromiseArray() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var arr = [
|
var arr = [
|
||||||
new Promise(function(resolve) {
|
timeoutPromise(50),
|
||||||
resolve("first");
|
timeoutPromise(20),
|
||||||
}),
|
timeoutPromise(30),
|
||||||
Promise.resolve("second"),
|
timeoutPromise(100)
|
||||||
new Promise(function() {}),
|
|
||||||
new Promise(function(resolve) {
|
|
||||||
setTimeout(function() {
|
|
||||||
setTimeout(function() {
|
|
||||||
resolve("fourth");
|
|
||||||
}, 0);
|
|
||||||
}, 0);
|
|
||||||
}),
|
|
||||||
];
|
];
|
||||||
|
|
||||||
var p = Promise.race(arr);
|
var p = Promise.race(arr);
|
||||||
p.then(function(winner) {
|
p.then(function(winner) {
|
||||||
is(winner, "first", "First queued resolution should win the race.");
|
is(winner, 20, "Fastest timeout should win.");
|
||||||
runTest();
|
runTest();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user