3 <script src=
"../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"../../http/tests/inspector/console-test.js"></script>
9 console
.dir(["test1", "test2"]);
10 console
.dir(document
.childNodes
);
11 console
.dir(document
.evaluate("//head", document
, null, XPathResult
.ANY_TYPE
, null));
13 // Object with properties containing whitespaces
14 var obj
= { $foo5_
: 0 };
15 obj
[" a b "] = " a b ";
19 obj
["a\n\nb\nc"] = "a\n\nb\nc";
23 // This should correctly display information about the function.
24 console
.dir(function() {});
26 // Test function inferred name in prototype constructor.
27 var outer
= { inner: function() {} };
28 console
.dir(new outer
.inner());
30 // Test "No Properties" placeholder.
31 console
.dir({ __proto__
: null });
32 console
.dir({ foo
: { __proto__
: null }});
33 // Test "No Scopes" placeholder.
34 console
.dir(Object
.getOwnPropertyDescriptor(Object
.prototype, "__proto__").get);
36 // Test big typed array: should be no crash or timeout.
37 var bigTypedArray
= new Uint8Array(new ArrayBuffer(400 * 1000 * 1000));
38 bigTypedArray
["FAIL"] = "FAIL: Object.getOwnPropertyNames() should not have been run";
39 console
.dir(bigTypedArray
);
43 //# sourceURL=console-dir.html
49 InspectorTest
.expandConsoleMessages(step1
, expandTreeElementFilter
);
51 function expandTreeElementFilter(treeElement
)
53 var name
= treeElement
.nameElement
&& treeElement
.nameElement
.textContent
;
54 return name
=== "foo" || treeElement
.title
=== "<function scope>";
59 InspectorTest
.expandConsoleMessages(dumpConsoleMessages
, expandTreeElementFilter
);
62 function dumpConsoleMessages()
64 InspectorTest
.dumpConsoleMessagesIgnoreErrorStackFrames();
65 InspectorTest
.completeTest();
72 <body onload=
"onload()">
74 Tests that console logging dumps proper messages.