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

Unified Diff: test/mjsunit/harmony/mirror-async-function.js

Issue 2566103002: [debug-wrappers] remove mirror tests. (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « test/mjsunit/es6/mirror-symbols.js ('k') | test/mjsunit/harmony/mirror-async-function-promise.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/mirror-async-function.js
diff --git a/test/mjsunit/harmony/mirror-async-function.js b/test/mjsunit/harmony/mirror-async-function.js
deleted file mode 100644
index b4ba8314a535f50895a1366af971159c79ccc0eb..0000000000000000000000000000000000000000
--- a/test/mjsunit/harmony/mirror-async-function.js
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --expose-debug-as debug --harmony-async-await --allow-natives-syntax
-// Test the mirror object for functions.
-
-var AsyncFunction = (async function() {}).constructor;
-
-function MirrorRefCache(json_refs) {
- var tmp = eval('(' + json_refs + ')');
- this.refs_ = [];
- for (var i = 0; i < tmp.length; i++) {
- this.refs_[tmp[i].handle] = tmp[i];
- }
-}
-
-MirrorRefCache.prototype.lookup = function(handle) {
- return this.refs_[handle];
-}
-
-function testFunctionMirror(f) {
- // Create mirror and JSON representation.
- var mirror = debug.MakeMirror(f);
- var serializer = debug.MakeMirrorSerializer();
- var json = JSON.stringify(serializer.serializeValue(mirror));
- var refs = new MirrorRefCache(
- JSON.stringify(serializer.serializeReferencedObjects()));
-
- // Check the mirror hierachy.
- assertTrue(mirror instanceof debug.Mirror);
- assertTrue(mirror instanceof debug.ValueMirror);
- assertTrue(mirror instanceof debug.ObjectMirror);
- assertTrue(mirror instanceof debug.FunctionMirror);
-
- // Check the mirror properties.
- assertTrue(mirror.isFunction());
- assertEquals('function', mirror.type());
- assertFalse(mirror.isPrimitive());
- assertEquals("Function", mirror.className());
- assertEquals(f.name, mirror.name());
- assertTrue(mirror.resolved());
- assertEquals(f.toString(), mirror.source());
- assertTrue(mirror.constructorFunction() instanceof debug.ObjectMirror);
- assertTrue(mirror.protoObject() instanceof debug.Mirror);
- assertTrue(mirror.prototypeObject() instanceof debug.Mirror);
-
- // Test text representation
- assertEquals(f.toString(), mirror.toText());
-
- // Parse JSON representation and check.
- var fromJSON = eval('(' + json + ')');
- assertEquals('function', fromJSON.type);
- assertEquals('Function', fromJSON.className);
- assertEquals('function', refs.lookup(fromJSON.constructorFunction.ref).type);
- assertEquals('AsyncFunction',
- refs.lookup(fromJSON.constructorFunction.ref).name);
- assertTrue(fromJSON.resolved);
- assertEquals(f.name, fromJSON.name);
- assertEquals(f.toString(), fromJSON.source);
-
- // Check the formatted text (regress 1142074).
- assertEquals(f.toString(), fromJSON.text);
-}
-
-
-// Test a number of different functions.
-testFunctionMirror(async function(){});
-testFunctionMirror(AsyncFunction());
-testFunctionMirror(new AsyncFunction());
-testFunctionMirror(async() => {});
-testFunctionMirror(async function a(){return 1;});
-testFunctionMirror(({ async foo() {} }).foo);
-testFunctionMirror((async function(){}).bind({}), "Object");
-
-%RunMicrotasks();
« no previous file with comments | « test/mjsunit/es6/mirror-symbols.js ('k') | test/mjsunit/harmony/mirror-async-function-promise.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698