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

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

Issue 468763004: DevTools: Avoid rebaselining test results after changing InjectedScript. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/inspector/console/console-eval-syntax-error-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 var initialize_ConsoleTest = function() { 1 var initialize_ConsoleTest = function() {
2 2
3 3
4 InspectorTest.showConsolePanel = function() 4 InspectorTest.showConsolePanel = function()
5 { 5 {
6 WebInspector.inspectorView.showPanel("console"); 6 WebInspector.inspectorView.showPanel("console");
7 } 7 }
8 8
9 InspectorTest.prepareConsoleMessageText = function(messageElement) 9 InspectorTest.prepareConsoleMessageText = function(messageElement, consoleMessag e)
10 { 10 {
11 var messageText = messageElement.textContent.replace(/\u200b/g, ""); 11 var messageText = messageElement.textContent.replace(/\u200b/g, "");
12 // Replace scriptIds with generic scriptId string to avoid flakiness. 12 // Replace scriptIds with generic scriptId string to avoid flakiness.
13 messageText = messageText.replace(/VM\d+/g, "VM"); 13 messageText = messageText.replace(/\bVM\d+/g, "VM");
14 // Strip out InjectedScript from stack traces to avoid rebaselining each tim e InjectedScriptSource is edited. 14 // Strip out InjectedScript from stack traces to avoid rebaselining each tim e InjectedScriptSource is edited.
15 messageText = messageText.replace(/InjectedScript[\.a-zA-Z_]+ VM:\d+/g, ""); 15 messageText = messageText.replace(/InjectedScript[\.a-zA-Z_]+ VM:\d+/g, "");
16 // Strip out InjectedScript line numbers from console message anchor.
17 var functionName = consoleMessage && consoleMessage.stackTrace && consoleMes sage.stackTrace[0] && consoleMessage.stackTrace[0].functionName || "";
18 if (functionName.indexOf("InjectedScript") !== -1)
19 messageText = messageText.replace(/\bVM:\d+/, ""); // Only first replace .
16 // The message might be extremely long in case of dumping stack overflow mes sage. 20 // The message might be extremely long in case of dumping stack overflow mes sage.
17 messageText = messageText.substring(0, 1024); 21 messageText = messageText.substring(0, 1024);
18 return messageText; 22 return messageText;
19 } 23 }
20 24
21 InspectorTest.disableConsoleViewport = function() 25 InspectorTest.disableConsoleViewport = function()
22 { 26 {
23 InspectorTest.fixConsoleViewportDimensions(600, 2000); 27 InspectorTest.fixConsoleViewportDimensions(600, 2000);
24 } 28 }
25 29
(...skipping 23 matching lines...) Expand all
49 for (var node = element.firstChild; node; node = node.traverseNextNo de(element)) { 53 for (var node = element.firstChild; node; node = node.traverseNextNo de(element)) {
50 if (node.nodeType === Node.ELEMENT_NODE && node.className) 54 if (node.nodeType === Node.ELEMENT_NODE && node.className)
51 classNames.push(node.className); 55 classNames.push(node.className);
52 } 56 }
53 } 57 }
54 58
55 if (InspectorTest.dumpConsoleTableMessage(uiMessage, false)) { 59 if (InspectorTest.dumpConsoleTableMessage(uiMessage, false)) {
56 if (dumpClassNames) 60 if (dumpClassNames)
57 InspectorTest.addResult(classNames.join(" > ")); 61 InspectorTest.addResult(classNames.join(" > "));
58 } else { 62 } else {
59 var messageText = formatter(element); 63 var messageText = formatter(element, message);
60 InspectorTest.addResult(messageText + (dumpClassNames ? " " + classN ames.join(" > ") : "")); 64 InspectorTest.addResult(messageText + (dumpClassNames ? " " + classN ames.join(" > ") : ""));
61 } 65 }
62 66
63 if (printOriginatingCommand && uiMessage.consoleMessage().originatingMes sage()) 67 if (printOriginatingCommand && uiMessage.consoleMessage().originatingMes sage())
64 InspectorTest.addResult("Originating from: " + uiMessage.consoleMess age().originatingMessage().messageText); 68 InspectorTest.addResult("Originating from: " + uiMessage.consoleMess age().originatingMessage().messageText);
65 } 69 }
66 return result; 70 return result;
67 } 71 }
68 72
69 InspectorTest.dumpConsoleTableMessage = function(viewMessage, forceInvalidate) 73 InspectorTest.dumpConsoleTableMessage = function(viewMessage, forceInvalidate)
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 } 208 }
205 if (!option) { 209 if (!option) {
206 InspectorTest.addResult("FAILED: context with prefix: " + namePrefix + " not found in the context list"); 210 InspectorTest.addResult("FAILED: context with prefix: " + namePrefix + " not found in the context list");
207 return; 211 return;
208 } 212 }
209 option.selected = true; 213 option.selected = true;
210 WebInspector.ConsolePanel._view()._executionContextChanged(); 214 WebInspector.ConsolePanel._view()._executionContextChanged();
211 } 215 }
212 216
213 } 217 }
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/inspector/console/console-eval-syntax-error-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698