OLD | NEW |
1 <html> | 1 <html> |
2 <script> | 2 <script> |
3 var tests = []; | 3 var tests = []; |
4 | 4 |
5 scanFolder("inspector/console"); | 5 scanFolder("inspector/console"); |
6 // scanFolder("inspector/debugger"); | 6 // scanFolder("inspector/debugger"); |
7 scanFolder("inspector/editor"); | 7 scanFolder("inspector/editor"); |
8 scanFolder("inspector/elements"); | 8 scanFolder("inspector/elements"); |
9 scanFolder("inspector/profiler"); | 9 scanFolder("inspector/profiler"); |
10 scanFolder("inspector/styles"); | 10 scanFolder("inspector/styles"); |
(...skipping 17 matching lines...) Expand all Loading... |
28 var path = "/LayoutTests/" + folder + "/" + match[1]; | 28 var path = "/LayoutTests/" + folder + "/" + match[1]; |
29 var expected = fetchExpectations(path); | 29 var expected = fetchExpectations(path); |
30 tests.push([path, expected]); | 30 tests.push([path, expected]); |
31 } | 31 } |
32 } | 32 } |
33 | 33 |
34 function fetchExpectations(path) | 34 function fetchExpectations(path) |
35 { | 35 { |
36 var ext = path.lastIndexOf("."); | 36 var ext = path.lastIndexOf("."); |
37 path = path.substring(0, ext) + "-expected.txt"; | 37 path = path.substring(0, ext) + "-expected.txt"; |
38 var chromiumPath = path.replace("/LayoutTests/", "/LayoutTests/platform/chro
mium/"); | |
39 | 38 |
40 var expectations = fetch(chromiumPath) || fetch(path) || ""; | 39 var expectations = fetch(path) || ""; |
41 | 40 |
42 var expectationLines = expectations.split("\n"); | 41 var expectationLines = expectations.split("\n"); |
43 var filtered = []; | 42 var filtered = []; |
44 for (var i = 0; i < expectationLines.length; ++i) { | 43 for (var i = 0; i < expectationLines.length; ++i) { |
45 if (!expectationLines[i].indexOf("ALERT: ") || | 44 if (!expectationLines[i].indexOf("ALERT: ") || |
46 !expectationLines[i].indexOf("CONSOLE MESSAGE: ")) { | 45 !expectationLines[i].indexOf("CONSOLE MESSAGE: ")) { |
47 filtered = []; | 46 filtered = []; |
48 continue; | 47 continue; |
49 } | 48 } |
50 filtered.push(expectationLines[i]); | 49 filtered.push(expectationLines[i]); |
51 } | 50 } |
52 return filtered.join("\n"); | 51 return filtered.join("\n"); |
53 } | 52 } |
54 | 53 |
55 function fetch(path) | 54 function fetch(path) |
56 { | 55 { |
57 var xhr = new XMLHttpRequest(); | 56 var xhr = new XMLHttpRequest(); |
58 xhr.open("GET", path, false); | 57 xhr.open("GET", path, false); |
59 xhr.send(null); | 58 xhr.send(null); |
60 return xhr.status !== 404 ? xhr.responseText : ""; | 59 return xhr.status !== 404 ? xhr.responseText : ""; |
61 } | 60 } |
62 | 61 |
63 window.parent.postMessage(["tests", tests], "*"); | 62 window.parent.postMessage(["tests", tests], "*"); |
64 | 63 |
65 </script> | 64 </script> |
66 <body> | 65 <body> |
67 </body> | 66 </body> |
68 </html> | 67 </html> |
OLD | NEW |