3 <script src=
"../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"../../http/tests/inspector/console-test.js"></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";
14 InspectorTest
.evaluateInConsole("obj");
15 InspectorTest
.evaluateInConsole("[obj]");
16 InspectorTest
.evaluateInConsole("obj.foo");
17 InspectorTest
.evaluateInConsole("[obj.foo]");
18 InspectorTest
.runAfterPendingDispatches(step1
);
22 InspectorTest
.waitForRemoteObjectsConsoleMessages(step2
);
27 InspectorTest
.expandConsoleMessages(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();
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
)
65 <body onload=
"runTest()">
67 Tests that console logging dumps proper messages with broken Unicode.