Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / console / console-dir.html
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/console-test.js"></script>
5 <script>
6
7 function onload()
8 {
9     console.dir(["test1", "test2"]);
10     console.dir(document.childNodes);
11     console.dir(document.evaluate("//head", document, null, XPathResult.ANY_TYPE, null));
12
13     // Object with properties containing whitespaces
14     var obj = { $foo5_: 0 };
15     obj[" a b "] = " a b ";
16     obj["c d"] = "c d";
17     obj[""] = "";
18     obj["  "] = "  ";
19     obj["a\n\nb\nc"] = "a\n\nb\nc";
20     obj["negZero"] = -0;
21     console.dir(obj);
22
23     // This should correctly display information about the function.
24     console.dir(function() {});
25
26     // Test function inferred name in prototype constructor.
27     var outer = { inner: function() {} };
28     console.dir(new outer.inner());
29
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);
35
36     runTest();
37 }
38
39 function test()
40 {
41     InspectorTest.expandConsoleMessages(step1, expandTreeElementFilter);
42
43     function expandTreeElementFilter(treeElement)
44     {
45         var name = treeElement.nameElement && treeElement.nameElement.textContent;
46         return name === "foo" || treeElement.title === "<function scope>";
47     }
48
49     function step1()
50     {
51         InspectorTest.expandConsoleMessages(dumpConsoleMessages, expandTreeElementFilter);
52     }
53
54     function dumpConsoleMessages()
55     {
56         InspectorTest.dumpConsoleMessages(false, false, InspectorTest.textContentWithLineBreaks);
57         InspectorTest.completeTest();
58     }
59 }
60
61 </script>
62 </head>
63
64 <body onload="onload()">
65 <p>
66 Tests that console logging dumps proper messages.
67 </p>
68
69 </body>
70 </html>