3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/console-test.js"></script>
12 console.log(globals[current]);
13 console.log([globals[current]]);
18 var foo = { foo: "foo"};
19 var bar = { bar: "bar" };
21 var array = ["test", "test2"]; array.length = 10;
25 var svg = document.getElementById("svg-node");
27 console.log("%o", array);
28 console.log("%O", array);
29 console.log("Test for zero \"%f\" in formatter", 0);
31 var regex1 = /^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i;
32 var regex2 = new RegExp("foo\\\\bar\\sbaz", "i");
34 var str2 = "test named \"test\"";
35 var error = new Error;
36 var errorWithMessage = new Error("my error message");
37 var node = document.getElementById("p");
38 var func = function() { return 1; };
39 var multilinefunc = function() {
43 var linkify = "http://webkit.org/";
44 var valuelessAttribute = document.createAttribute("attr");
45 var valuedAttribute = document.createAttribute("attr");
46 valuedAttribute.value = "value";
47 var existingAttribute = document.getElementById("x").attributes[0];
48 var throwingLengthGetter = {get length() { throw "Length called"; }};
49 var objectWithNonEnumerables = Object.create({ foo: 1 }, {
50 getFoo: { value: function() { return this.foo; } },
51 bar: { get: function() { return this.bar; }, set: function(x) { this.bar = x; } }
53 var negZero = 1 / Number.NEGATIVE_INFINITY;
55 var arrayLikeFunction = function() {};
56 arrayLikeFunction.splice = function() {};
59 regex1, regex2, str, str2, error, errorWithMessage, node, func, multilinefunc, num, linkify,
60 null, undefined, valuelessAttribute, valuedAttribute, existingAttribute, throwingLengthGetter,
61 NaN, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY, array, {}, [function() {}], bar, svg,
62 objectWithNonEnumerables, negZero, Object.create(null), Object, Object.prototype, arrayLikeFunction
70 InspectorTest.evaluateInPage("globals.length", loopOverGlobals.bind(this, 0));
72 function loopOverGlobals(current, total)
76 var next = current + 1;
77 if (next == total.description) {
78 InspectorTest.expandConsoleMessages();
79 InspectorTest.runAfterPendingDispatches(finish);
81 loopOverGlobals(next, total);
87 InspectorTest.dumpConsoleMessages();
88 InspectorTest.completeTest();
91 InspectorTest.evaluateInPage("log(" + current + ")");
92 InspectorTest.runAfterPendingDispatches(evalInConsole);
93 function evalInConsole()
95 InspectorTest.evaluateInConsole("globals[" + current + "]");
96 InspectorTest.runAfterPendingDispatches(advance);
103 <body onload="onload()">
105 <p id="p">Tests that console logging dumps proper messages.</p>
107 <svg id="svg-node"></svg>