| OLD | NEW |
| (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)); |
| 13 function onAfterContent(content) { |
| 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() { |
| 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> |
| OLD | NEW |