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

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

Issue 2772643002: DevTools: Changes View (Closed)
Patch Set: no highlighting 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 unified diff | Download patch
OLDNEW
(Empty)
1 <html>
2 <head>
3
4 <link rel="stylesheet" href="resources/before.css">
5 <link rel="stylesheet" href="resources/after.css">
6 <script src="../../http/tests/inspector/inspector-test.js"></script>
7 <script src="../../http/tests/inspector/debugger-test.js"></script>
8 <script src="changes-test.js"></script>
9 <script>
10
11 function test() {
12 InspectorTest.waitForScriptSource("after.css", uiSourceCode => uiSourceCode. requestContent().then(onAfterContent));
lushnikov 2017/03/28 03:32:10 waitForUISourceCode(.. (cause i'm about to remove
einbinder 2017/03/28 23:51:04 Done.
13 function onAfterContent(content) {
lushnikov 2017/03/28 03:32:10 nit: newline before function
einbinder 2017/03/28 23:51:04 Done.
14 InspectorTest.waitForScriptSource("before.css", uiSourceCode => uiSourceCo de.setWorkingCopy(content));
15 InspectorTest.addSniffer(Changes.ChangesView.prototype, "_renderRows", row sRendered, true);
16 UI.viewManager.showView("changes.changes");
17 }
18 function rowsRendered() {
lushnikov 2017/03/28 03:32:10 nit: newline
einbinder 2017/03/28 23:51:04 Done.
19 var codeMirror = this._editor._codeMirror;
20 for (var i = 0; i < codeMirror.lineCount(); i++) {
21 codeMirror.scrollIntoView(i); // Ensure highlighting
22 var lineInfo = codeMirror.lineInfo(i);
23 var prefix = "";
24 if (lineInfo.handle.styleClasses.bgClass === "deletion")
25 prefix = "-";
26 else if (lineInfo.handle.styleClasses.bgClass === "addition")
27 prefix = "+";
28 else if (lineInfo.handle.styleClasses.bgClass === "equal")
29 prefix = " ";
30 InspectorTest.addResult(prefix + " " + lineInfo.text);
31
32 }
33 InspectorTest.completeTest();
34 }
35 }
36 </script>
37 </head>
38 <body onload="runTest()">
39 <p>Tests that the changes view highlights diffs correctly.</p>
40 </body>
41 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698