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

Unified Diff: LayoutTests/fast/js/resources/Promise-init-in-workers.js

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/resources/Promise-init-in-workers.js
diff --git a/LayoutTests/fast/js/resources/Promise-init-in-workers.js b/LayoutTests/fast/js/resources/Promise-init-in-workers.js
index 40052bf516dc005cc15d8591aa05719a81f4ee1d..e5962790255dd767dc5e184ece1f5ef469910335 100644
--- a/LayoutTests/fast/js/resources/Promise-init-in-workers.js
+++ b/LayoutTests/fast/js/resources/Promise-init-in-workers.js
@@ -6,17 +6,18 @@ global.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"');
@@ -27,8 +28,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) {
global.result = result;

Powered by Google App Engine
This is Rietveld 408576698