Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/http/tests/inspector/console-test.js |
| diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/console-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/console-test.js |
| index fd341208f6d3b16d4bca85a44704212991392dc1..5255bdd790ad703ab71ca9c8dc4e43cedc316343 100644 |
| --- a/third_party/WebKit/LayoutTests/http/tests/inspector/console-test.js |
| +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/console-test.js |
| @@ -56,9 +56,9 @@ InspectorTest.evaluateInConsoleAndDump = function(code, callback, dontForceMainC |
| InspectorTest.evaluateInConsole(code, mycallback, dontForceMainContext); |
| } |
| -InspectorTest.prepareConsoleMessageText = function(messageElement, consoleMessage) |
| +InspectorTest.cleanConsoleMessageText = function(messageText) |
| { |
| - var messageText = messageElement.deepTextContent().replace(/\u200b/g, ""); |
| + messageText.replace(/\u200b/g, ""); |
| // Replace scriptIds with generic scriptId string to avoid flakiness. |
| messageText = messageText.replace(/VM\d+/g, "VM"); |
| if (messageText.startsWith("Navigated to")) { |
| @@ -70,6 +70,27 @@ InspectorTest.prepareConsoleMessageText = function(messageElement, consoleMessag |
| return messageText; |
| } |
| +InspectorTest.prepareConsoleMessageText = function(messageElement, consoleMessage) |
| +{ |
| + var messageText = messageElement.deepTextContent(); |
| + return InspectorTest.cleanConsoleMessageText(messageText); |
| +} |
| + |
| +InspectorTest.dumpConsoleMessagesWithObjectProperties = function(messageElement, consoleMessage) |
|
lushnikov
2016/08/05 01:42:04
let's reuse the existing infrastructure (see conso
luoe
2016/08/05 01:48:10
Done.
|
| +{ |
| + var messageText = messageElement.childTextNodes().map(formatPropertyNames).join(""); |
| + return InspectorTest.cleanConsoleMessageText(messageText); |
| + |
| + function formatPropertyNames(node) { |
| + if (node.parentElement && node.parentElement.parentElement && node.parentElement.parentElement.classList.contains("console-view-object-properties-section")) |
| + return "\n" + node.textContent; |
| + if (node.parentElement && node.parentElement.classList.contains("name")) |
| + return "\n" + node.textContent; |
| + else |
| + return node.textContent; |
| + } |
| +} |
| + |
| InspectorTest.disableConsoleViewport = function() |
| { |
| InspectorTest.fixConsoleViewportDimensions(600, 2000); |