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

Unified Diff: LayoutTests/fast/js/Promise-static-resolve.html

Issue 18648011: Implement Promise.fulfill, Promise.resolve and Promise.reject. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 7 years, 5 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-static-resolve.html
diff --git a/LayoutTests/fast/js/Promise-already-fulfilled.html b/LayoutTests/fast/js/Promise-static-resolve.html
similarity index 62%
copy from LayoutTests/fast/js/Promise-already-fulfilled.html
copy to LayoutTests/fast/js/Promise-static-resolve.html
index 560803e23a7b73b3a5938822521f65adbb29000a..95ec15718b0d5e75423e06a50460440fef96c915 100644
--- a/LayoutTests/fast/js/Promise-already-fulfilled.html
+++ b/LayoutTests/fast/js/Promise-static-resolve.html
@@ -10,19 +10,22 @@
description('Test Promise.');
window.jsTestIsAsync = true;
+result = undefined;
-new Promise(function(resolver) {
- resolver.fulfill('foo');
- resolver.fulfill('bar');
-}).then(function(result) {
+var resolver;
+var promise = Promise.resolve(new Promise(function (r) { resolver = r;} ));
+
+promise.then(function(result) {
window.result = result;
- shouldBeEqualToString('result', 'foo');
+ shouldBeEqualToString('result', 'hello');
finishJSTest();
}, function() {
testFailed('rejected');
finishJSTest();
});
+resolver.resolve('hello');
+shouldBe('result', 'undefined');
</script>
<script src="resources/js-test-post.js"></script>
</body>
« no previous file with comments | « LayoutTests/fast/js/Promise-static-reject-expected.txt ('k') | LayoutTests/fast/js/Promise-static-resolve-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698