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 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "chrome/browser/prerender/prerender_manager.h" | 9 #include "chrome/browser/prerender/prerender_manager.h" |
10 #include "chrome/browser/prerender/prerender_tracker.h" | 10 #include "chrome/browser/prerender/prerender_tracker.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 FinalStatus final_status; | 61 FinalStatus final_status; |
62 if (!prerender_tracker()->GetFinalStatus(child_id, route_id, | 62 if (!prerender_tracker()->GetFinalStatus(child_id, route_id, |
63 &final_status)) { | 63 &final_status)) { |
64 return -1; | 64 return -1; |
65 } | 65 } |
66 return final_status; | 66 return final_status; |
67 } | 67 } |
68 | 68 |
69 // Runs any tasks queued on either thread. | 69 // Runs any tasks queued on either thread. |
70 void RunEvents() { | 70 void RunEvents() { |
71 message_loop_.RunAllPending(); | 71 message_loop_.RunUntilIdle(); |
72 } | 72 } |
73 | 73 |
74 private: | 74 private: |
75 MessageLoop message_loop_; | 75 MessageLoop message_loop_; |
76 content::TestBrowserThread ui_thread_; | 76 content::TestBrowserThread ui_thread_; |
77 content::TestBrowserThread io_thread_; | 77 content::TestBrowserThread io_thread_; |
78 | 78 |
79 scoped_ptr<TestPrerenderManager> prerender_manager_; | 79 scoped_ptr<TestPrerenderManager> prerender_manager_; |
80 }; | 80 }; |
81 | 81 |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 | 289 |
290 FinalStatus final_status; | 290 FinalStatus final_status; |
291 EXPECT_FALSE(prerender_tracker()->GetFinalStatus(0, 0, &final_status)); | 291 EXPECT_FALSE(prerender_tracker()->GetFinalStatus(0, 0, &final_status)); |
292 EXPECT_FALSE(prerender_tracker()->IsPrerenderingOnIOThread(0, 0)); | 292 EXPECT_FALSE(prerender_tracker()->IsPrerenderingOnIOThread(0, 0)); |
293 | 293 |
294 EXPECT_FALSE(prerender_tracker()->GetFinalStatus(1, 2, &final_status)); | 294 EXPECT_FALSE(prerender_tracker()->GetFinalStatus(1, 2, &final_status)); |
295 EXPECT_FALSE(prerender_tracker()->IsPrerenderingOnIOThread(1, 2)); | 295 EXPECT_FALSE(prerender_tracker()->IsPrerenderingOnIOThread(1, 2)); |
296 } | 296 } |
297 | 297 |
298 } // namespace prerender | 298 } // namespace prerender |
OLD | NEW |