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

Unified Diff: third_party/WebKit/LayoutTests/inspector/changes/changes-highlighter.html

Issue 2772643002: DevTools: Changes View (Closed)
Patch Set: fix test Created 3 years, 9 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 | third_party/WebKit/LayoutTests/inspector/changes/changes-highlighter-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/inspector/changes/changes-highlighter.html
diff --git a/third_party/WebKit/LayoutTests/inspector/changes/changes-highlighter.html b/third_party/WebKit/LayoutTests/inspector/changes/changes-highlighter.html
new file mode 100644
index 0000000000000000000000000000000000000000..b63fd2994d997b0edbb3cd250e4ec3addfa41106
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector/changes/changes-highlighter.html
@@ -0,0 +1,43 @@
+<html>
+<head>
+
+<link rel="stylesheet" href="resources/before.css">
+<link rel="stylesheet" href="resources/after.css">
+<script src="../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../http/tests/inspector/debugger-test.js"></script>
+<script src="changes-test.js"></script>
+<script>
+
+function test() {
+ InspectorTest.waitForUISourceCode("after.css").then(uiSourceCode => uiSourceCode.requestContent()).then(onAfterContent);
+
+ function onAfterContent(content) {
+ InspectorTest.waitForScriptSource("before.css", uiSourceCode => uiSourceCode.setWorkingCopy(content));
+ InspectorTest.addSniffer(Changes.ChangesView.prototype, "_renderDiffRows", rowsRendered, true);
+ UI.viewManager.showView("changes.changes");
+ }
+
+ function rowsRendered() {
+ var codeMirror = this._editor._codeMirror;
+ for (var i = 0; i < codeMirror.lineCount(); i++) {
+ codeMirror.scrollIntoView(i); // Ensure highlighting
+ var lineInfo = codeMirror.lineInfo(i);
+ var prefix = "";
+ if (lineInfo.handle.styleClasses.bgClass === "deletion")
+ prefix = "-";
+ else if (lineInfo.handle.styleClasses.bgClass === "addition")
+ prefix = "+";
+ else if (lineInfo.handle.styleClasses.bgClass === "equal")
+ prefix = " ";
+ InspectorTest.addResult(prefix + " " + lineInfo.text);
+
+ }
+ InspectorTest.completeTest();
+ }
+}
+</script>
+</head>
+<body onload="runTest()">
+<p>Tests that the changes view highlights diffs correctly.</p>
+</body>
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/changes/changes-highlighter-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698