OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Include test fixture. | 5 // Include test fixture. |
6 GEN_INCLUDE(['net_internals_test.js']); | 6 GEN_INCLUDE(['net_internals_test.js']); |
7 | 7 |
8 // Anonymous namespace | 8 // Anonymous namespace |
9 (function() { | 9 (function() { |
10 | 10 |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 var tableId = SdchView.BLACKLIST_TBODY_ID; | 167 var tableId = SdchView.BLACKLIST_TBODY_ID; |
168 var domain = NetInternalsTest.getTbodyText(tableId, 0, 0); | 168 var domain = NetInternalsTest.getTbodyText(tableId, 0, 0); |
169 var reason = NetInternalsTest.getTbodyText(tableId, 0, 1); | 169 var reason = NetInternalsTest.getTbodyText(tableId, 0, 1); |
170 expectEquals(entry.domain, domain); | 170 expectEquals(entry.domain, domain); |
171 expectEquals(this.reason_, reason); | 171 expectEquals(this.reason_, reason); |
172 this.onTaskDone(); | 172 this.onTaskDone(); |
173 } | 173 } |
174 } | 174 } |
175 }; | 175 }; |
176 | 176 |
177 /** | |
178 * Load a page, which results in downloading a SDCH dictionary. Make sure its | |
179 * data is displayed. | |
180 */ | |
181 TEST_F('NetInternalsTest', 'netInternalsSdchViewFetchDictionary', function() { | |
182 var taskQueue = new NetInternalsTest.TaskQueue(true); | |
183 taskQueue.addTask( | |
184 new NetInternalsTest.GetTestServerURLTask( | |
185 BASE_PATH + encodeURI('/sdch/page.html'))); | |
186 taskQueue.addTask(new LoadSdchDictionaryTask()); | |
187 taskQueue.run(); | |
188 }); | |
189 | |
190 /** | |
191 * Load a page, get the dictionary for it, and get decoding error to see | |
192 * the blacklist in action. | |
193 */ | |
194 TEST_F('NetInternalsTest', 'netInternalsSdchViewBlacklistMeta', function() { | |
195 var taskQueue = new NetInternalsTest.TaskQueue(true); | |
196 taskQueue.addTask( | |
197 new NetInternalsTest.GetTestServerURLTask( | |
198 BASE_PATH + encodeURI('/sdch/page.html'))); | |
199 taskQueue.addTask(new LoadSdchDictionaryTask()); | |
200 taskQueue.addTask( | |
201 new NetInternalsTest.GetTestServerURLTask( | |
202 BASE_PATH + encodeURI('/sdch/non-html'))); | |
203 taskQueue.addTask( | |
204 new LoadPageWithDecodeErrorTask('META_REFRESH_UNSUPPORTED')); | |
205 taskQueue.run(); | |
206 }); | |
207 | |
208 /** | |
209 * Load a page, which is said to be SDCH-encoded, though we don't expect it. | |
210 */ | |
211 TEST_F('NetInternalsTest', 'netInternalsSdchViewBlacklistNonSdch', function() { | |
212 var taskQueue = new NetInternalsTest.TaskQueue(true); | |
213 taskQueue.addTask( | |
214 new NetInternalsTest.GetTestServerURLTask( | |
215 BASE_PATH + encodeURI('/sdch/non-sdch.html'))); | |
216 taskQueue.addTask( | |
217 new LoadPageWithDecodeErrorTask('PASSING_THROUGH_NON_SDCH')); | |
218 taskQueue.run(); | |
219 }); | |
220 | |
221 })(); // Anonymous namespace | 177 })(); // Anonymous namespace |
OLD | NEW |