Index: test/mjsunit/es6/mirror-promises.js |
diff --git a/test/mjsunit/es6/mirror-promises.js b/test/mjsunit/es6/mirror-promises.js |
index c0eb5bf9bb286f4dfd55e25b4cef8db54c86f547..5a21a6b9e621487b56745829ad03fbac1b16845f 100644 |
--- a/test/mjsunit/es6/mirror-promises.js |
+++ b/test/mjsunit/es6/mirror-promises.js |
@@ -17,7 +17,7 @@ MirrorRefCache.prototype.lookup = function(handle) { |
return this.refs_[handle]; |
} |
-function testPromiseMirror(promise, status) { |
+function testPromiseMirror(promise, status, value) { |
// Create mirror and JSON representation. |
var mirror = debug.MakeMirror(promise); |
var serializer = debug.MakeMirrorSerializer(); |
@@ -39,6 +39,7 @@ function testPromiseMirror(promise, status) { |
assertEquals("Object", mirror.className()); |
assertEquals("#<Promise>", mirror.toText()); |
assertSame(promise, mirror.value()); |
+ assertEquals(value, mirror.promiseValue()); |
// Parse JSON representation and check. |
var fromJSON = eval('(' + json + ')'); |
@@ -47,7 +48,7 @@ function testPromiseMirror(promise, status) { |
assertEquals('function', refs.lookup(fromJSON.constructorFunction.ref).type); |
assertEquals('Promise', refs.lookup(fromJSON.constructorFunction.ref).name); |
assertEquals(status, fromJSON.status); |
- |
+ assertEquals(value, fromJSON.promiseValue); |
} |
// Test a number of different promises. |
@@ -55,6 +56,14 @@ var resolved = new Promise(function(resolve, reject) { resolve() }); |
var rejected = new Promise(function(resolve, reject) { reject() }); |
var pending = new Promise(function(resolve, reject) {}); |
-testPromiseMirror(resolved, "resolved"); |
-testPromiseMirror(rejected, "rejected"); |
-testPromiseMirror(pending, "pending"); |
+testPromiseMirror(resolved, "resolved", undefined); |
+testPromiseMirror(rejected, "rejected", undefined); |
+testPromiseMirror(pending, "pending", undefined); |
+ |
+var resolvedv = new Promise(function(resolve, reject) { resolve('resolve') }); |
+var rejectedv = new Promise(function(resolve, reject) { reject('reject') }); |
+var thrownv = new Promise(function(resolve, reject) { throw 'throw' }); |
+ |
+testPromiseMirror(resolvedv, "resolved", 'resolve'); |
+testPromiseMirror(rejectedv, "rejected", 'reject'); |
+testPromiseMirror(thrownv, "rejected", 'throw'); |