Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Side by Side Diff: LayoutTests/http/tests/inspector/inspector-test.js

Issue 911993002: DevTools: [Console] render console stacktraces consistently (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebaseline one more test Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 var initialize_InspectorTest = function() { 1 var initialize_InspectorTest = function() {
2 2
3 var results = []; 3 var results = [];
4 4
5 function consoleOutputHook(messageType) 5 function consoleOutputHook(messageType)
6 { 6 {
7 InspectorTest.addResult(messageType + ": " + Array.prototype.slice.call(argu ments, 1)); 7 InspectorTest.addResult(messageType + ": " + Array.prototype.slice.call(argu ments, 1));
8 } 8 }
9 9
10 console.log = consoleOutputHook.bind(InspectorTest, "log"); 10 console.log = consoleOutputHook.bind(InspectorTest, "log");
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 currentNode = currentNode.parentNode; 442 currentNode = currentNode.parentNode;
443 } 443 }
444 return Array(result * 4 + 1).join(" "); 444 return Array(result * 4 + 1).join(" ");
445 } 445 }
446 446
447 var buffer = ""; 447 var buffer = "";
448 var currentNode = node; 448 var currentNode = node;
449 while (currentNode = currentNode.traverseNextNode(node)) { 449 while (currentNode = currentNode.traverseNextNode(node)) {
450 if (currentNode.nodeType === Node.TEXT_NODE) { 450 if (currentNode.nodeType === Node.TEXT_NODE) {
451 buffer += currentNode.nodeValue; 451 buffer += currentNode.nodeValue;
452 } else if (currentNode.nodeName === "LI") { 452 } else if (currentNode.nodeName === "LI" || currentNode.nodeName === "TR ") {
453 buffer += "\n" + padding(currentNode); 453 buffer += "\n" + padding(currentNode);
454 } else if (currentNode.nodeName === "STYLE") { 454 } else if (currentNode.nodeName === "STYLE") {
455 currentNode = currentNode.traverseNextNode(node); 455 currentNode = currentNode.traverseNextNode(node);
456 continue; 456 continue;
457 } else if (currentNode.classList.contains("console-message")) { 457 } else if (currentNode.classList.contains("console-message")) {
458 buffer += "\n\n"; 458 buffer += "\n\n";
459 } 459 }
460 } 460 }
461 return buffer; 461 return buffer;
462 } 462 }
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
921 _output("[page] " + text); 921 _output("[page] " + text);
922 } 922 }
923 923
924 function _output(result) 924 function _output(result)
925 { 925 {
926 if (!outputElement) 926 if (!outputElement)
927 createOutputElement(); 927 createOutputElement();
928 outputElement.appendChild(document.createTextNode(result)); 928 outputElement.appendChild(document.createTextNode(result));
929 outputElement.appendChild(document.createElement("br")); 929 outputElement.appendChild(document.createElement("br"));
930 } 930 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698