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

Unified Diff: test/inspector/runtime/console-spec.js

Issue 2785293002: [inspector] move console to builtins (Closed)
Patch Set: removed unused variable Created 3 years, 8 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
« no previous file with comments | « test/inspector/inspector-impl.cc ('k') | test/inspector/runtime/console-spec-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/inspector/runtime/console-spec.js
diff --git a/test/inspector/runtime/console-spec.js b/test/inspector/runtime/console-spec.js
new file mode 100644
index 0000000000000000000000000000000000000000..6644d29dbe3244ceaaf0abd271b740d2daf466ab
--- /dev/null
+++ b/test/inspector/runtime/console-spec.js
@@ -0,0 +1,51 @@
+// Copyright 2017 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.
+
+InspectorTest.addScript(`
+var self = this;
+function checkPrototype() {
+ const prototype1 = Object.getPrototypeOf(console);
+ const prototype2 = Object.getPrototypeOf(prototype1);
+ if (Object.getOwnPropertyNames(prototype1).length !== 0)
+ return "false: The [[Prototype]] must have no properties";
+ if (prototype2 !== Object.prototype)
+ return "false: The [[Prototype]]'s [[Prototype]] must be %ObjectPrototype%";
+ return "true";
+}
+`);
+
+InspectorTest.runAsyncTestSuite([
+ async function consoleExistsOnGlobal() {
+ let message = await Protocol.Runtime.evaluate({
+ expression: 'self.hasOwnProperty(\'console\')', returnByValue: true});
+ InspectorTest.log(message.result.result.value);
+ },
+
+ async function consoleHasRightPropertyDescriptor() {
+ let message = await Protocol.Runtime.evaluate({
+ expression: 'Object.getOwnPropertyDescriptor(self, \'console\')',
+ returnByValue: true});
+ let result = message.result.result.value;
+ result.value = '<value>';
+ InspectorTest.logObject(result);
+ },
+
+ async function ConsoleNotExistsOnGlobal() {
+ let message = await Protocol.Runtime.evaluate({
+ expression: '\'Console\' in self', returnByValue: true})
+ InspectorTest.log(message.result.result.value);
+ },
+
+ async function prototypeChainMustBeCorrect() {
+ let message = await Protocol.Runtime.evaluate({
+ expression: "checkPrototype()", returnByValue: true });
+ InspectorTest.log(message.result.result.value);
+ },
+
+ async function consoleToString() {
+ let message = await Protocol.Runtime.evaluate({
+ expression: 'console.toString()', returnByValue: true})
+ InspectorTest.log(message.result.result.value);
+ }
+]);
« no previous file with comments | « test/inspector/inspector-impl.cc ('k') | test/inspector/runtime/console-spec-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698