mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 965644 - Fix intermittent oranges on promise tests. r=bz
This commit is contained in:
parent
5986c65e5c
commit
63a593f6cb
@ -202,15 +202,23 @@ function promiseRacePromiseArray() {
|
||||
}
|
||||
|
||||
var arr = [
|
||||
timeoutPromise(50),
|
||||
timeoutPromise(20),
|
||||
timeoutPromise(30),
|
||||
timeoutPromise(100)
|
||||
new Promise(function(resolve) {
|
||||
resolve("first");
|
||||
}),
|
||||
Promise.resolve("second"),
|
||||
new Promise(function() {}),
|
||||
new Promise(function(resolve) {
|
||||
setTimeout(function() {
|
||||
setTimeout(function() {
|
||||
resolve("fourth");
|
||||
}, 0);
|
||||
}, 0);
|
||||
}),
|
||||
];
|
||||
|
||||
var p = Promise.race(arr);
|
||||
p.then(function(winner) {
|
||||
is(winner, 20, "Fastest timeout should win.");
|
||||
is(winner, "first", "First queued resolution should win the race.");
|
||||
runTest();
|
||||
});
|
||||
}
|
||||
|
@ -565,15 +565,23 @@ function promiseRacePromiseArray() {
|
||||
}
|
||||
|
||||
var arr = [
|
||||
timeoutPromise(50),
|
||||
timeoutPromise(20),
|
||||
timeoutPromise(30),
|
||||
timeoutPromise(100)
|
||||
new Promise(function(resolve) {
|
||||
resolve("first");
|
||||
}),
|
||||
Promise.resolve("second"),
|
||||
new Promise(function() {}),
|
||||
new Promise(function(resolve) {
|
||||
setTimeout(function() {
|
||||
setTimeout(function() {
|
||||
resolve("fourth");
|
||||
}, 0);
|
||||
}, 0);
|
||||
}),
|
||||
];
|
||||
|
||||
var p = Promise.race(arr);
|
||||
p.then(function(winner) {
|
||||
is(winner, 20, "Fastest timeout should win.");
|
||||
is(winner, "first", "First queued resolution should win the race.");
|
||||
runTest();
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user