| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 | 139 |
| 140 /** | 140 /** |
| 141 * Navigate to the prerendered page in the background tab. | 141 * Navigate to the prerendered page in the background tab. |
| 142 * @param {Object} prerenderInfo State of prerendering pages. | 142 * @param {Object} prerenderInfo State of prerendering pages. |
| 143 */ | 143 */ |
| 144 navigate_: function(prerenderInfo) { | 144 navigate_: function(prerenderInfo) { |
| 145 expectEquals(0, prerenderInfo.history.length); | 145 expectEquals(0, prerenderInfo.history.length); |
| 146 assertEquals(1, prerenderInfo.active.length); | 146 assertEquals(1, prerenderInfo.active.length); |
| 147 expectEquals(this.url_, prerenderInfo.active[0].url); | 147 expectEquals(this.url_, prerenderInfo.active[0].url); |
| 148 expectTrue(this.shouldSucceed_); | 148 expectTrue(this.shouldSucceed_); |
| 149 chrome.send('navigateToPrerender'); | 149 chrome.send('navigateToPrerender', [this.url_]); |
| 150 this.state_ = STATE.HISTORY_WAIT; | 150 this.state_ = STATE.HISTORY_WAIT; |
| 151 }, | 151 }, |
| 152 | 152 |
| 153 /** | 153 /** |
| 154 * We expect to either see the failure url as an active entry, or see it | 154 * We expect to either see the failure url as an active entry, or see it |
| 155 * in the history. In the latter case, the test completes. | 155 * in the history. In the latter case, the test completes. |
| 156 * @param {Object} prerenderInfo State of prerendering pages. | 156 * @param {Object} prerenderInfo State of prerendering pages. |
| 157 */ | 157 */ |
| 158 checkDone_: function(prerenderInfo) { | 158 checkDone_: function(prerenderInfo) { |
| 159 // If we see the url as active, continue running the test. | 159 // If we see the url as active, continue running the test. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 */ | 197 */ |
| 198 TEST_F('NetInternalsTest', 'netInternalsPrerenderViewFail', function() { | 198 TEST_F('NetInternalsTest', 'netInternalsPrerenderViewFail', function() { |
| 199 var taskQueue = new NetInternalsTest.TaskQueue(true); | 199 var taskQueue = new NetInternalsTest.TaskQueue(true); |
| 200 taskQueue.addTask( | 200 taskQueue.addTask( |
| 201 new NetInternalsTest.GetTestServerURLTask('files/download-test1.lib')); | 201 new NetInternalsTest.GetTestServerURLTask('files/download-test1.lib')); |
| 202 taskQueue.addTask(new PrerenderTask(false, 'Download')); | 202 taskQueue.addTask(new PrerenderTask(false, 'Download')); |
| 203 taskQueue.run(); | 203 taskQueue.run(); |
| 204 }); | 204 }); |
| 205 | 205 |
| 206 })(); // Anonymous namespace | 206 })(); // Anonymous namespace |
| OLD | NEW |