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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/diff-module.html

Issue 2349823002: DevTools: Preserve the text when doing a line-by-line diff (Closed)
Patch Set: Docs Created 4 years, 2 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/diff-module-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="../http/tests/inspector/inspector-test.js"></script>
4 <script>
5
6 function initialize_DiffTest()
7 {
8 InspectorTest.preloadModule("diff");
9 }
10
11 function test()
12 {
13 print(WebInspector.Diff.charDiff("test this sentence.", "test that sentence" ));
14 print(WebInspector.Diff.lineDiff(["test this sentence."], ["test that senten ce"]));
15 print(WebInspector.Diff.lineDiff(["a", "b", "c"], ["a", "c"]));
16 print(WebInspector.Diff.lineDiff(["a", "b", "c"], ["b", "a", "c"]));
17 print(WebInspector.Diff.lineDiff(["a", "c"], ["a", "b", "c"]));
18 print(WebInspector.Diff.lineDiff(
19 [
20 "for (var i = 0; i < 100; i++) {",
21 " willBeLeftAlone()",
22 " willBeDeleted();",
23 "}",
24 "for (var j = 0; j < 100; j++) {",
25 " console.log('something changed');",
26 " willBeDeletedAgain();",
27 "}"
28 ],
29 [
30 "for (var i = 0; i < 100; i++) {",
31 " willBeLeftAlone();",
32 "}",
33 "insertThisLine();",
34 "for (var j = 0; j < 100; j++) {",
35 " console.log('changed');",
36 "}"
37 ]));
38 InspectorTest.completeTest();
39 function print(results)
40 {
41 InspectorTest.addResult("");
42 for (var i = 0; i < results.length; i++) {
43 var result = results[i];
44 var type = "Unknown";
45 if (result[0] === WebInspector.Diff.Operation.Equal)
46 type = "=";
47 else if (result[0] === WebInspector.Diff.Operation.Insert)
48 type = "+";
49 else if (result[0] === WebInspector.Diff.Operation.Delete)
50 type = "-";
51 else if (result[0] === WebInspector.Diff.Operation.Edit)
52 type = "E";
53 InspectorTest.addResult(type + ": " + JSON.stringify(result[1], null , 4));
54 }
55 }
56 }
57 </script>
58 </head>
59 <body onload="runTest()">
60 <p>Tests that the Diff module correctly diffs things.</p>
61 </body>
62 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/diff-module-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698