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);
30 console
.log("%% self-escape1", "dummy");
31 console
.log("%%s self-escape2", "dummy");
32 console
.log("%%ss self-escape3", "dummy");
33 console
.log("%%s%s%%s self-escape4", "dummy");
34 console
.log("%%%%% self-escape5", "dummy");
35 console
.log("%%%s self-escape6", "dummy");
38 var regex1
= /^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i;
39 var regex2
= new RegExp("foo\\\\bar\\sbaz", "i");
41 var str2
= "test named \"test\"";
42 var error
= new Error
;
43 var errorWithMessage
= new Error("my error message");
44 var errorWithMultilineMessage
= new Error("my multiline\nerror message");
45 var node
= document
.getElementById("p");
46 var func = function() { return 1; };
47 var multilinefunc = function() {
51 var linkify
= "http://webkit.org/";
52 var valuelessAttribute
= document
.createAttribute("attr");
53 var valuedAttribute
= document
.createAttribute("attr");
54 valuedAttribute
.value
= "value";
55 var existingAttribute
= document
.getElementById("x").attributes
[0];
56 var throwingLengthGetter
= {get length() { throw "Length called"; }};
57 var objectWithNonEnumerables
= Object
.create({ foo
: 1 }, {
58 getFoo
: { value: function() { return this.foo
; } },
59 bar
: { get: function() { return this.bar
; }, set: function(x
) { this.bar
= x
; } }
61 var negZero
= 1 / Number
.NEGATIVE_INFINITY
;
62 var textNode
= document
.getElementById("x").nextSibling
;
63 var arrayLikeFunction = function( /**/ foo
/**/, /*/**/bar
,
65 arrayLikeFunction
.splice = function() {};
66 var smallTypedArray
= new Uint8Array(new ArrayBuffer(400));
67 smallTypedArray
["foo"] = "bar";
68 var bigTypedArray
= new Uint8Array(new ArrayBuffer(400 * 1000 * 1000));
69 bigTypedArray
["FAIL"] = "FAIL: Object.getOwnPropertyNames() should not have been run";
71 regex1
, regex2
, str
, str2
, error
, errorWithMessage
, errorWithMultilineMessage
, node
, func
, multilinefunc
,
72 num
, linkify
, null, undefined, valuelessAttribute
, valuedAttribute
, existingAttribute
, throwingLengthGetter
,
73 NaN
, Number
.POSITIVE_INFINITY
, Number
.NEGATIVE_INFINITY
, array
, {}, [function() {}], bar
, svg
,
74 objectWithNonEnumerables
, negZero
, Object
.create(null), Object
, Object
.prototype, arrayLikeFunction
,
75 new Number(42), new String("abc"), new Uint16Array([1, 2, 3]), textNode
, domException(),
76 smallTypedArray
, bigTypedArray
82 function domException()
86 var a
= document
.createElement("div");
87 var b
= document
.createElement("div");
95 //# sourceURL=console-format.html
101 InspectorTest
.hideInspectorView();
102 InspectorTest
.evaluateInPage("globals.length", loopOverGlobals
.bind(this, 0));
104 function loopOverGlobals(current
, total
)
108 var next
= current
+ 1;
109 if (next
== total
.description
)
110 InspectorTest
.waitForRemoteObjectsConsoleMessages(onRemoteObjectsLoaded
);
112 loopOverGlobals(next
, total
);
115 function onRemoteObjectsLoaded()
117 InspectorTest
.expandConsoleMessages(InspectorTest
.expandConsoleMessagesErrorParameters
.bind(this, finish
), undefined, function(section
) { return section
.element
.firstChild
.textContent
!== "#text"; });
122 InspectorTest
.dumpConsoleMessagesIgnoreErrorStackFrames();
123 InspectorTest
.completeTest();
126 InspectorTest
.evaluateInPage("log(" + current
+ ")");
127 InspectorTest
.runAfterPendingDispatches(evalInConsole
);
128 function evalInConsole()
130 InspectorTest
.evaluateInConsole("globals[" + current
+ "]");
131 InspectorTest
.runAfterPendingDispatches(advance
);
138 <body onload=
"onload()">
140 <p id=
"p">Tests that console logging dumps proper messages.
</p>
142 <svg id=
"svg-node"></svg>