Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Unified Diff: LayoutTests/fast/js/Promise-init.html

Issue 23567043: Promise init callback takes resolve and reject functions (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/js/Promise-init.html
diff --git a/LayoutTests/fast/js/Promise-init.html b/LayoutTests/fast/js/Promise-init.html
index d2c910f8e9e0d121b9edf1b7600e97a7d0af97a8..a2ee6a7c5502751d5523a09e9ba17a3f6a21b24d 100644
--- a/LayoutTests/fast/js/Promise-init.html
+++ b/LayoutTests/fast/js/Promise-init.html
@@ -12,17 +12,18 @@ window.jsTestIsAsync = true;
description('Test Promise.');
var thisInInit;
-var resolver;
-var promise = new Promise(function(r) {
+var resolve, reject;
+var promise = new Promise(function(newResolve, newReject) {
thisInInit = this;
- resolver = r;
+ resolve = newResolve;
+ reject = newReject;
});
shouldBeTrue('promise instanceof Promise');
shouldBe('promise.constructor', 'Promise');
shouldBe('thisInInit', 'promise');
-shouldBeTrue('resolver instanceof PromiseResolver');
-shouldBe('resolver.constructor', 'PromiseResolver');
+shouldBeTrue('resolve instanceof Function');
+shouldBeTrue('reject instanceof Function');
shouldThrow('new Promise()', '"TypeError: Promise constructor takes a function argument"');
shouldThrow('new Promise(37)', '"TypeError: Promise constructor takes a function argument"');
@@ -33,8 +34,8 @@ promise.then(undefined, function(result) {
shouldBeEqualToString('result.message', 'foo');
});
-new Promise(function(resolver) {
- resolver.fulfill("hello");
+new Promise(function(resolve) {
+ resolve("hello");
throw Error("foo");
}).then(function(result) {
window.result = result;
« no previous file with comments | « LayoutTests/fast/js/Promise-fulfill-in-workers-expected.txt ('k') | LayoutTests/fast/js/Promise-init-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698