Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / console / console-format.html
blob4e7ab5c13e4b31e4901d9b3319bd3cf13a487fbc
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/console-test.js"></script>
6 <script>
7 // Global Values
8 var globals = [];
10 function log(current)
12 console.log(globals[current]);
13 console.log([globals[current]]);
16 function onload()
18 var foo = { foo: "foo"};
19 var bar = { bar: "bar" };
20 bar.__proto__ = foo;
21 var array = ["test", "test2"]; array.length = 10;
22 array.foo = {};
23 array[4] = "test4";
25 var svg = document.getElementById("svg-node");
26 console.log(array);
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");
37 // Populate Globals
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");
40 var str = "test";
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() {
48 return 2;
50 var num = 1.2e-1;
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; } }
60 });
61 var negZero = 1 / Number.NEGATIVE_INFINITY;
62 var textNode = document.getElementById("x").nextSibling;
63 var arrayLikeFunction = function( /**/ foo/**/, /*/**/bar,
64 /**/baz) {};
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";
70 globals = [
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
79 runTest();
82 function domException()
84 var result = "FAIL";
85 try {
86 var a = document.createElement("div");
87 var b = document.createElement("div");
88 a.removeChild(b);
89 } catch(e) {
90 e.stack = "";
91 result = e;
93 return result;
95 //# sourceURL=console-format.html
96 </script>
98 <script>
99 function test()
101 InspectorTest.hideInspectorView();
102 InspectorTest.evaluateInPage("globals.length", loopOverGlobals.bind(this, 0));
104 function loopOverGlobals(current, total)
106 function advance()
108 var next = current + 1;
109 if (next == total.description)
110 InspectorTest.waitForRemoteObjectsConsoleMessages(onRemoteObjectsLoaded);
111 else
112 loopOverGlobals(next, total);
115 function onRemoteObjectsLoaded()
117 InspectorTest.expandConsoleMessages(InspectorTest.expandConsoleMessagesErrorParameters.bind(this, finish), undefined, function(section) { return section.element.firstChild.textContent !== "#text"; });
120 function finish()
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);
135 </script>
136 </head>
138 <body onload="onload()">
139 <div id="x"></div>
140 <p id="p">Tests that console logging dumps proper messages.</p>
141 </body>
142 <svg id="svg-node"></svg>
143 </html>