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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/inspector/console/console-eval-syntax-error-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/inspector/console-test.js
diff --git a/LayoutTests/http/tests/inspector/console-test.js b/LayoutTests/http/tests/inspector/console-test.js
index 3d29cbd42013da09bc1b9eef51d5a0f262aa924f..94e26a293824c0978d98b58b2fef9297c295e710 100644
--- a/LayoutTests/http/tests/inspector/console-test.js
+++ b/LayoutTests/http/tests/inspector/console-test.js
@@ -6,13 +6,17 @@ InspectorTest.showConsolePanel = function()
WebInspector.inspectorView.showPanel("console");
}
-InspectorTest.prepareConsoleMessageText = function(messageElement)
+InspectorTest.prepareConsoleMessageText = function(messageElement, consoleMessage)
{
var messageText = messageElement.textContent.replace(/\u200b/g, "");
// Replace scriptIds with generic scriptId string to avoid flakiness.
- messageText = messageText.replace(/VM\d+/g, "VM");
+ messageText = messageText.replace(/\bVM\d+/g, "VM");
// Strip out InjectedScript from stack traces to avoid rebaselining each time InjectedScriptSource is edited.
messageText = messageText.replace(/InjectedScript[\.a-zA-Z_]+ VM:\d+/g, "");
+ // Strip out InjectedScript line numbers from console message anchor.
+ var functionName = consoleMessage && consoleMessage.stackTrace && consoleMessage.stackTrace[0] && consoleMessage.stackTrace[0].functionName || "";
+ if (functionName.indexOf("InjectedScript") !== -1)
+ messageText = messageText.replace(/\bVM:\d+/, ""); // Only first replace.
// The message might be extremely long in case of dumping stack overflow message.
messageText = messageText.substring(0, 1024);
return messageText;
@@ -56,7 +60,7 @@ InspectorTest.dumpConsoleMessages = function(printOriginatingCommand, dumpClassN
if (dumpClassNames)
InspectorTest.addResult(classNames.join(" > "));
} else {
- var messageText = formatter(element);
+ var messageText = formatter(element, message);
InspectorTest.addResult(messageText + (dumpClassNames ? " " + classNames.join(" > ") : ""));
}
« 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