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

Unified Diff: test/webkit/fast/js/Promise-already-resolved.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-already-resolved.js
diff --git a/test/webkit/indexed-setter-on-global-object.js b/test/webkit/fast/js/Promise-already-resolved.js
similarity index 71%
copy from test/webkit/indexed-setter-on-global-object.js
copy to test/webkit/fast/js/Promise-already-resolved.js
index 20c70c24f5e5b8f887cc8ec8f1d4fbd99431c45d..7a8640ae166544e6112a988f95392d0f5cfeed59 100644
--- a/test/webkit/indexed-setter-on-global-object.js
+++ b/test/webkit/fast/js/Promise-already-resolved.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,16 +21,23 @@
// (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 creating an indexed setter on the global object doesn't break things."
-);
+// Flags: --harmony
+'use strict';
+description('Resolve or reject do not take effect on a resolved Promise.');
-var thingy;
+var result;
-this.__defineSetter__(42, function(value) {
- thingy = value;
+new Promise(function(resolve, reject) {
+ var anotherResolve;
+ resolve(new Promise(function(r) { anotherResolve = r; }));
+ resolve('resolve');
+ reject('reject');
+ anotherResolve('foo');
+}).then(function(localResult) {
+ result = localResult;
+ shouldBeEqualToString('result', 'foo');
+ finishJSTest();
+}, function() {
+ testFailed('rejected');
+ finishJSTest();
});
-
-this[42] = "foo";
-
-shouldBe("thingy", "\"foo\"");
« no previous file with comments | « test/webkit/fast/js/Promise-already-rejected-expected.txt ('k') | test/webkit/fast/js/Promise-already-resolved-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698