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

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

Issue 24980002: Implement AP2 Promises (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 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-resolve-with-itself.html
diff --git a/LayoutTests/fast/js/Promise-already-rejected.html b/LayoutTests/fast/js/Promise-resolve-with-itself.html
similarity index 50%
copy from LayoutTests/fast/js/Promise-already-rejected.html
copy to LayoutTests/fast/js/Promise-resolve-with-itself.html
index 52697b5d6b8056f3f99595684f75e3eb5abd46b3..630021ccaba2b90526b87a318f2bb3c760b2cebb 100644
--- a/LayoutTests/fast/js/Promise-already-rejected.html
+++ b/LayoutTests/fast/js/Promise-resolve-with-itself.html
@@ -11,18 +11,18 @@ description('Test Promise.');
window.jsTestIsAsync = true;
-new Promise(function(resolve, reject) {
- reject('foo');
- resolve('resolve');
- reject('reject');
-}).then(function() {
+var resolve;
+var promise = new Promise(function(r) { resolve = r; });
+
+promise.then(function () {
testFailed('fulfilled');
- finishJSTest();
-}, function(result) {
- window.result = result;
- shouldBeEqualToString('result', 'foo');
- finishJSTest();
-});
+}, function (error) {
+ testPassed('rejected');
+ window.result = error.toString();
+ shouldBeEqualToString('result', 'TypeError: Resolve a promise with itself');
+}).then(finishJSTest, finishJSTest);
+
+resolve(promise);
</script>
<script src="resources/js-test-post.js"></script>

Powered by Google App Engine
This is Rietveld 408576698