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 <set> | 5 #include <set> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 | 183 |
184 TestPrerenderManager* prerender_manager() { | 184 TestPrerenderManager* prerender_manager() { |
185 return &prerender_manager_; | 185 return &prerender_manager_; |
186 } | 186 } |
187 | 187 |
188 TestPrerenderContents* test_contents() { | 188 TestPrerenderContents* test_contents() { |
189 return &test_contents_; | 189 return &test_contents_; |
190 } | 190 } |
191 | 191 |
192 // Runs any tasks queued on either thread. | 192 // Runs any tasks queued on either thread. |
193 void RunEvents() { | 193 void RunEvents() { base::RunLoop().RunUntilIdle(); } |
194 message_loop_.RunUntilIdle(); | |
195 } | |
196 | 194 |
197 private: | 195 private: |
198 base::MessageLoopForIO message_loop_; | 196 base::MessageLoopForIO message_loop_; |
199 content::TestBrowserThread ui_thread_; | 197 content::TestBrowserThread ui_thread_; |
200 content::TestBrowserThread io_thread_; | 198 content::TestBrowserThread io_thread_; |
201 | 199 |
202 TestPrerenderManager prerender_manager_; | 200 TestPrerenderManager prerender_manager_; |
203 TestPrerenderContents test_contents_; | 201 TestPrerenderContents test_contents_; |
204 }; | 202 }; |
205 | 203 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 // We should have cancelled the prerender. | 322 // We should have cancelled the prerender. |
325 EXPECT_EQ(FINAL_STATUS_BAD_DEFERRED_REDIRECT, | 323 EXPECT_EQ(FINAL_STATUS_BAD_DEFERRED_REDIRECT, |
326 test_contents()->final_status()); | 324 test_contents()->final_status()); |
327 | 325 |
328 // Cleanup work so the prerender is gone. | 326 // Cleanup work so the prerender is gone. |
329 test_contents()->Cancel(); | 327 test_contents()->Cancel(); |
330 RunEvents(); | 328 RunEvents(); |
331 } | 329 } |
332 | 330 |
333 } // namespace prerender | 331 } // namespace prerender |
OLD | NEW |