| 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>
|
|
|