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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
91 | 91 |
92 // Check number of rows in both tables. | 92 // Check number of rows in both tables. |
93 NetInternalsTest.checkTbodyRows(PrerenderView.HISTORY_TABLE_ID, | 93 NetInternalsTest.checkTbodyRows(PrerenderView.HISTORY_TABLE_ID, |
94 prerenderInfo.history.length); | 94 prerenderInfo.history.length); |
95 NetInternalsTest.checkTbodyRows(PrerenderView.ACTIVE_TABLE_ID, | 95 NetInternalsTest.checkTbodyRows(PrerenderView.ACTIVE_TABLE_ID, |
96 prerenderInfo.active.length); | 96 prerenderInfo.active.length); |
97 | 97 |
98 if (this.state_ == STATE.START_PRERENDERING) { | 98 if (this.state_ == STATE.START_PRERENDERING) { |
99 this.startPrerendering_(prerenderInfo); | 99 this.startPrerendering_(prerenderInfo); |
100 } else if (this.state_ == STATE.NEED_NAVIGATE) { | 100 } else if (this.state_ == STATE.NEED_NAVIGATE) { |
101 this.navigate_(prerenderInfo); | 101 this.navigate_(prerenderInfo); |
cbentzel
2013/05/28 18:49:11
This is probably the location where we need to hol
mmenke
2013/05/28 19:06:36
It seems like the simplest thing to do is to wait
mmenke
2013/05/28 19:20:04
Just realized this may not be waiting long enough,
Charlie Reis
2013/05/28 23:22:00
I follow you conceptually, but I'm not familiar wi
mmenke
2013/05/28 23:38:20
Yea, I think it's best I just do it myself. Think
| |
102 } else if (this.state_ == STATE.HISTORY_WAIT) { | 102 } else if (this.state_ == STATE.HISTORY_WAIT) { |
103 // TODO(creis): How can we wait for commit before checkDone_? | |
103 this.checkDone_(prerenderInfo); | 104 this.checkDone_(prerenderInfo); |
104 } else { | 105 } else { |
105 assertNotReached(); | 106 assertNotReached(); |
106 } | 107 } |
107 }, | 108 }, |
108 | 109 |
109 /** | 110 /** |
110 * Start by triggering a prerender of |url_| in a background tab. | 111 * Start by triggering a prerender of |url_| in a background tab. |
111 * At this point, we expect no active or historical prerender entries. | 112 * At this point, we expect no active or historical prerender entries. |
112 * @param {Object} prerenderInfo State of prerendering pages. | 113 * @param {Object} prerenderInfo State of prerendering pages. |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
193 */ | 194 */ |
194 TEST_F('NetInternalsTest', 'netInternalsPrerenderViewFail', function() { | 195 TEST_F('NetInternalsTest', 'netInternalsPrerenderViewFail', function() { |
195 var taskQueue = new NetInternalsTest.TaskQueue(true); | 196 var taskQueue = new NetInternalsTest.TaskQueue(true); |
196 taskQueue.addTask( | 197 taskQueue.addTask( |
197 new NetInternalsTest.GetTestServerURLTask('files/download-test1.lib')); | 198 new NetInternalsTest.GetTestServerURLTask('files/download-test1.lib')); |
198 taskQueue.addTask(new PrerenderTask(false, 'Download')); | 199 taskQueue.addTask(new PrerenderTask(false, 'Download')); |
199 taskQueue.run(); | 200 taskQueue.run(); |
200 }); | 201 }); |
201 | 202 |
202 })(); // Anonymous namespace | 203 })(); // Anonymous namespace |
OLD | NEW |