Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / console / console-format-broken-unicode.html
blobc14cbae0310bd20c8a46fda5e0b8bb3090e9e0fe
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>
7 var str = " \uD835\uDC14\uD835\uDC0D\uD835\uDC08\uD835\uDC02\uD835\uDC0E\uD835\uDC03\uD835\uDC04"; // " UNICODE"
8 var brokenSurrogate = str.substring(0, str.length - 1);
9 var obj = { foo: brokenSurrogate };
10 obj[brokenSurrogate] = "foo";
12 function test()
14 InspectorTest.evaluateInConsole("obj");
15 InspectorTest.evaluateInConsole("[obj]");
16 InspectorTest.evaluateInConsole("obj.foo");
17 InspectorTest.evaluateInConsole("[obj.foo]");
18 InspectorTest.runAfterPendingDispatches(step1);
20 function step1()
22 InspectorTest.waitForRemoteObjectsConsoleMessages(step2);
25 function step2()
27 InspectorTest.expandConsoleMessages(step3);
30 function step3()
32 InspectorTest.evaluateInPage("obj.foo", step4);
35 function step4(result)
37 var text = result.description;
38 InspectorTest.assertEquals(15, text.length, "text length");
39 InspectorTest.assertEquals(6, countTextNodes(text), "nodes count");
40 InspectorTest.addResult("PASS: Found all nodes with the broken text");
41 InspectorTest.completeTest();
44 function countTextNodes(textContent)
46 InspectorTest.disableConsoleViewport();
48 var count = 0;
49 var viewMessages = WebInspector.ConsolePanel._view()._visibleViewMessages;
50 for (var i = 0; i < viewMessages.length; ++i) {
51 var node = viewMessages[i].contentElement();
52 var currentNode = node;
53 while (currentNode = currentNode.traverseNextNode(node)) {
54 if (currentNode.nodeType === Node.TEXT_NODE && currentNode.nodeValue === textContent)
55 ++count;
58 return count;
62 </script>
63 </head>
65 <body onload="runTest()">
66 <p>
67 Tests that console logging dumps proper messages with broken Unicode.
68 </p>
70 </body>
71 </html>