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/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "chrome/browser/prerender/prerender_contents.h" | 10 #include "chrome/browser/prerender/prerender_contents.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 } | 127 } |
128 return final_status; | 128 return final_status; |
129 } | 129 } |
130 | 130 |
131 // Runs any tasks queued on either thread. | 131 // Runs any tasks queued on either thread. |
132 void RunEvents() { | 132 void RunEvents() { |
133 message_loop_.RunUntilIdle(); | 133 message_loop_.RunUntilIdle(); |
134 } | 134 } |
135 | 135 |
136 private: | 136 private: |
137 MessageLoop message_loop_; | 137 base::MessageLoop message_loop_; |
138 content::TestBrowserThread ui_thread_; | 138 content::TestBrowserThread ui_thread_; |
139 content::TestBrowserThread io_thread_; | 139 content::TestBrowserThread io_thread_; |
140 | 140 |
141 TestPrerenderManager prerender_manager_; | 141 TestPrerenderManager prerender_manager_; |
142 TestPrerenderContents test_contents_; | 142 TestPrerenderContents test_contents_; |
143 }; | 143 }; |
144 | 144 |
145 // Check that a non-existant RenderView is handled correctly. | 145 // Check that a non-existant RenderView is handled correctly. |
146 TEST_F(PrerenderTrackerTest, PrerenderTrackerNull) { | 146 TEST_F(PrerenderTrackerTest, PrerenderTrackerNull) { |
147 EXPECT_FALSE(prerender_tracker()->TryUse(kDefaultChildId, kDefaultRouteId)); | 147 EXPECT_FALSE(prerender_tracker()->TryUse(kDefaultChildId, kDefaultRouteId)); |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 EXPECT_FALSE(prerender_tracker()->IsPrerenderingOnIOThread( | 417 EXPECT_FALSE(prerender_tracker()->IsPrerenderingOnIOThread( |
418 kDefaultChildId, kDefaultRouteId)); | 418 kDefaultChildId, kDefaultRouteId)); |
419 | 419 |
420 EXPECT_FALSE(prerender_tracker()->GetFinalStatus( | 420 EXPECT_FALSE(prerender_tracker()->GetFinalStatus( |
421 kDefaultChildId + 1, kDefaultRouteId + 1, &final_status)); | 421 kDefaultChildId + 1, kDefaultRouteId + 1, &final_status)); |
422 EXPECT_FALSE(prerender_tracker()->IsPrerenderingOnIOThread( | 422 EXPECT_FALSE(prerender_tracker()->IsPrerenderingOnIOThread( |
423 kDefaultChildId + 1, kDefaultRouteId + 1)); | 423 kDefaultChildId + 1, kDefaultRouteId + 1)); |
424 } | 424 } |
425 | 425 |
426 } // namespace prerender | 426 } // namespace prerender |
OLD | NEW |