зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset cc96b54811f6 (bug 1357625) for failing xpcshell's test_PromiseUtils.js. r=backout
This commit is contained in:
Родитель
ea13be78b8
Коммит
0c8fb370d2
|
@ -375,8 +375,6 @@ proto.throws = function(block, expected, message) {
|
|||
* (mixed) Test reference to evaluate against the rejection result
|
||||
* @param message (optional)
|
||||
* (string) Short explanation of the expected result
|
||||
* @return promise A promise that is resolved with the object the passed
|
||||
* promise is rejected with.
|
||||
*/
|
||||
proto.rejects = function(promise, expected, message) {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
@ -392,7 +390,7 @@ proto.rejects = function(promise, expected, message) {
|
|||
return;
|
||||
}
|
||||
this.report(false, err, expected, message);
|
||||
resolve(err);
|
||||
resolve();
|
||||
}
|
||||
).then(null, reject);
|
||||
});
|
||||
|
|
|
@ -351,10 +351,6 @@ add_task(function* test_rejects() {
|
|||
// A regex to match against the message.
|
||||
yield assert.rejects(Promise.reject(new Error("oh no")), /oh no/, "rejected");
|
||||
|
||||
// Check the promise is resolved with the original rejection.
|
||||
let result = yield assert.rejects(Promise.reject("oh no"));
|
||||
equal(result, "oh no");
|
||||
|
||||
// Failure cases:
|
||||
// An instance to check against that doesn't match.
|
||||
yield checkRejectsFails(new Error("something else"), SomeErrorLikeThing);
|
||||
|
|
Загрузка…
Ссылка в новой задаче