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

Unified Diff: test/webkit/fast/js/Promise-simple.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-simple.js
diff --git a/test/webkit/dfg-uint32-to-number-in-middle-of-copy-propagation.js b/test/webkit/fast/js/Promise-simple.js
similarity index 73%
copy from test/webkit/dfg-uint32-to-number-in-middle-of-copy-propagation.js
copy to test/webkit/fast/js/Promise-simple.js
index dc022379284510d8ef9c2e6efb82c1784d85ef11..047f420028fe863e66e649594fd47f140f9519dd 100644
--- a/test/webkit/dfg-uint32-to-number-in-middle-of-copy-propagation.js
+++ b/test/webkit/fast/js/Promise-simple.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,17 +21,26 @@
// (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 that UInt32ToNumber and OSR exit are aware of copy propagation and correctly recover both versions of a variable that was subject to a UInt32ToNumber cast."
-);
+// Flags: --harmony
+'use strict';
+description('Test Promise.');
-function foo(b) {
- var a = b | 0;
- var x, y;
- x = a;
- y = a >>> 0;
- return [x, y];
-}
+var resolve;
+var thisInInit;
+var thisInOnFulfilled;
+var result;
-for (var i = 0; i < 100; ++i)
- shouldBe("foo(-1)", "[-1, 4294967295]");
+new Promise(function(newResolve) {
+ thisInInit = this;
+ resolve = newResolve;
+}).then(function(localResult) {
+ thisInOnFulfilled = this;
+ shouldBe('thisInOnFulfilled', 'undefined');
+ result = localResult;
+ shouldBeEqualToString('result', 'hello');
+ finishJSTest();
+});
+
+shouldBe('thisInInit', 'undefined');
+
+resolve('hello');
« no previous file with comments | « test/webkit/fast/js/Promise-resolve-with-then-reject-expected.txt ('k') | test/webkit/fast/js/Promise-simple-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698