OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 equals(results.resultType("http://example.com/foo.bar-diff.txt"), "text"); | 73 equals(results.resultType("http://example.com/foo.bar-diff.txt"), "text"); |
74 equals(results.resultType("http://example.com/foo-actual.png"), "image"); | 74 equals(results.resultType("http://example.com/foo-actual.png"), "image"); |
75 equals(results.resultType("http://example.com/foo-expected.png"), "image"); | 75 equals(results.resultType("http://example.com/foo-expected.png"), "image"); |
76 equals(results.resultType("http://example.com/foo-diff.png"), "image"); | 76 equals(results.resultType("http://example.com/foo-diff.png"), "image"); |
77 equals(results.resultType("http://example.com/foo-pretty-diff.html"), "text"
); | 77 equals(results.resultType("http://example.com/foo-pretty-diff.html"), "text"
); |
78 equals(results.resultType("http://example.com/foo-wdiff.html"), "text"); | 78 equals(results.resultType("http://example.com/foo-wdiff.html"), "text"); |
79 equals(results.resultType("http://example.com/foo.xyz"), "text"); | 79 equals(results.resultType("http://example.com/foo.xyz"), "text"); |
80 }); | 80 }); |
81 | 81 |
82 asyncTest("fetchResultsURLs", 5, function() { | 82 asyncTest("fetchResultsURLs", 5, function() { |
83 var simulator = new NetworkSimulator(); | 83 var simulator = new NetworkSimulator(ok, start); |
84 | 84 |
85 var probedURLs = []; | 85 var probedURLs = []; |
86 simulator.probe = function(url) | 86 simulator.probe = function(url) |
87 { | 87 { |
88 probedURLs.push(url); | 88 probedURLs.push(url); |
89 if (url.endsWith('.txt')) | 89 if (url.endsWith('.txt')) |
90 return Promise.resolve(); | 90 return Promise.resolve(); |
91 else if (/taco.+png$/.test(url)) | 91 else if (/taco.+png$/.test(url)) |
92 return Promise.resolve(); | 92 return Promise.resolve(); |
93 else | 93 else |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 MockResultsBaseURL + "/userscripts/taco-diff.png", | 136 MockResultsBaseURL + "/userscripts/taco-diff.png", |
137 MockResultsBaseURL + "/userscripts/taco-actual.txt", | 137 MockResultsBaseURL + "/userscripts/taco-actual.txt", |
138 MockResultsBaseURL + "/userscripts/taco-expected.txt", | 138 MockResultsBaseURL + "/userscripts/taco-expected.txt", |
139 MockResultsBaseURL + "/userscripts/taco-diff.txt", | 139 MockResultsBaseURL + "/userscripts/taco-diff.txt", |
140 ]); | 140 ]); |
141 start(); | 141 start(); |
142 }); | 142 }); |
143 }); | 143 }); |
144 | 144 |
145 })(); | 145 })(); |
OLD | NEW |