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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/html/syntax/parsing/common.js

Issue 1984023002: Move web-platform-tests to wpt (part 1 of 2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
1 function mark_diffs(expected, actual) { 1 function mark_diffs(expected, actual) {
2 var expected_lines = expected.split("\n"); 2 var expected_lines = expected.split("\n");
3 var actual_lines = actual.split("\n"); 3 var actual_lines = actual.split("\n");
4 4
5 var max_length = Math.max(expected_lines.length, actual_lines.length); 5 var max_length = Math.max(expected_lines.length, actual_lines.length);
6 6
7 var expected_diff = ["code", {}]; 7 var expected_diff = ["code", {}];
8 var actual_diff = ["code", {}]; 8 var actual_diff = ["code", {}];
9 9
10 for (var i=0; i<max_length; i++) { 10 for (var i=0; i<max_length; i++) {
11 if (expected_lines[i] === actual_lines[i]) { 11 if (expected_lines[i] === actual_lines[i]) {
12 expected_diff.push(expected_lines[i] + "\n"); 12 expected_diff.push(expected_lines[i] + "\n");
13 actual_diff.push(actual_lines[i] + "\n"); 13 actual_diff.push(actual_lines[i] + "\n");
14 } else { 14 } else {
15 if (expected_lines[i]) { 15 if (expected_lines[i]) {
16 expected_diff.push(["span", {style:"color:red"}, expected_lines[i] + "\n "]); 16 expected_diff.push(["span", {style:"color:red"}, expected_lines[i] + "\n "]);
17 } 17 }
18 if (actual_lines[i]) { 18 if (actual_lines[i]) {
19 actual_diff.push(["span", {style:"color:red"}, actual_lines[i] + "\n"]); 19 actual_diff.push(["span", {style:"color:red"}, actual_lines[i] + "\n"]);
20 } 20 }
21 } 21 }
22 } 22 }
23 return [expected_diff, actual_diff]; 23 return [expected_diff, actual_diff];
24 } 24 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698