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

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

Issue 197213007: ScriptPromise implementation for V8 Promises (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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-native-resolve.html
diff --git a/LayoutTests/fast/js/Promise-onFulfilled-deep.html b/LayoutTests/fast/js/Promise-native-resolve.html
similarity index 50%
copy from LayoutTests/fast/js/Promise-onFulfilled-deep.html
copy to LayoutTests/fast/js/Promise-native-resolve.html
index fce7702a697c8623ae3e3c44894969176b0962e8..8697898c75361ac57266ca60dccb15cbad1bf873 100644
--- a/LayoutTests/fast/js/Promise-onFulfilled-deep.html
+++ b/LayoutTests/fast/js/Promise-native-resolve.html
@@ -7,23 +7,22 @@
<div id="description"></div>
<div id="console"></div>
<script>
-description('Test Promise.');
+description('Test Promise resolve inside Blink.');
window.jsTestIsAsync = true;
var result;
var resolve;
-var promise = new Promise(function (r) { resolve = r; });
+var promise = new Promise(function(res) { resolve = res; });
+var blinkPromise = internals.createResolvedPromise(promise);
-for (var i = 0; i < 5000; ++i)
- promise = promise.then(function (value) { return value; }, function () { testFailed('rejected'); });
-
-promise.then(function (value) {
- window.result = value;
+promise.then(function(value) {
+ return blinkPromise;
+}).then(function(value) {
+ result = value;
shouldBe('result', '42');
}).then(finishJSTest, finishJSTest);
-shouldBe('result', 'undefined');
resolve(42);
</script>

Powered by Google App Engine
This is Rietveld 408576698