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

Unified Diff: test/webkit/fast/js/Promise-onFulfilled-deep.js

Issue 182713002: Import Blink layout tests for Promises. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Created 6 years, 10 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: test/webkit/fast/js/Promise-onFulfilled-deep.js
diff --git a/test/webkit/dfg-arguments-cross-code-origin.js b/test/webkit/fast/js/Promise-onFulfilled-deep.js
similarity index 71%
copy from test/webkit/dfg-arguments-cross-code-origin.js
copy to test/webkit/fast/js/Promise-onFulfilled-deep.js
index 0793dfa9acb5dd82d3360b069f384667bdf48281..9e19aa56b2ef6346a8c2e8fdea02143f30c2d348 100644
--- a/test/webkit/dfg-arguments-cross-code-origin.js
+++ b/test/webkit/fast/js/Promise-onFulfilled-deep.js
@@ -1,4 +1,4 @@
-// Copyright 2013 the V8 project authors. All rights reserved.
+// Copyright 2014 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -21,24 +21,22 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-description(
-"Tests uses of 'arguments' that are aliased but span code origins."
-);
+// Flags: --harmony
+'use strict';
+description('Test whether deeply chained then-s work.');
-function foo() {
- return arguments;
-}
+var result;
+var resolve;
+var promise = new Promise(function (r) { resolve = r; });
-function bar(a) {
- var result = 0;
- for (var i = 0; i < a.length; ++i)
- result += a[i];
- return result;
+for (var i = 0; i < 5000; ++i) {
+ promise = promise.then(function (value) { return value + 1; }, function () { testFailed('rejected'); });
}
-function baz(x) {
- return bar(foo(x));
-}
+promise.then(function (value) {
+ result = value;
+ shouldBe('result', '5042');
+}).then(finishJSTest, finishJSTest);
-for (var i = 0; i < 200; ++i)
- shouldBe("baz(42)", "42");
+shouldBe('result', 'undefined');
+resolve(42);
« no previous file with comments | « test/webkit/fast/js/Promise-init-expected.txt ('k') | test/webkit/fast/js/Promise-onFulfilled-deep-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698