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

Unified Diff: test/webkit/fast/js/Promise-onRejected-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-onRejected-deep.js
diff --git a/test/webkit/dfg-call-method-hit-watchpoint.js b/test/webkit/fast/js/Promise-onRejected-deep.js
similarity index 71%
copy from test/webkit/dfg-call-method-hit-watchpoint.js
copy to test/webkit/fast/js/Promise-onRejected-deep.js
index 8c486c786e3e88b262d430b998b3ddc29b25f94c..b9c281fba6c042a2612e4e857d44e2909b02bba4 100644
--- a/test/webkit/dfg-call-method-hit-watchpoint.js
+++ b/test/webkit/fast/js/Promise-onRejected-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,32 +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 correctness of method calls when the prototype is changed."
-);
+// Flags: --harmony
+'use strict';
+description('Test whether deeply chained then-s work.');
-function Thingy() {
-}
-
-Thingy.prototype = {
- foo: function() {
- return 42;
- }
-};
+var result;
+var reject;
+var promise = new Promise(function (_, r) { reject = r; });
-function callFoo(o) {
- return o.foo();
+for (var i = 0; i < 5000; ++i) {
+ promise = promise.then(function (value) { testFailed('fulfilled'); throw value + 1; }, function (value) { throw value + 1; });
}
-var o = new Thingy();
+promise.catch(function (value) {
+ result = value;
+ shouldBe('result', '5042');
+}).then(finishJSTest, finishJSTest);
-for (var i = 0; i < 200; ++i) {
- if (i == 150)
- Thingy.prototype.foo = function() { return 56; }
- var expected;
- if (i < 150)
- expected = 42;
- else
- expected = 56;
- shouldBe("callFoo(o)", "" + expected);
-}
+shouldBe('result', 'undefined');
+reject(42);
« no previous file with comments | « test/webkit/fast/js/Promise-onFulfilled-deep-expected.txt ('k') | test/webkit/fast/js/Promise-onRejected-deep-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698