Index: chrome/browser/prerender/prerender_unittest.cc |
diff --git a/chrome/browser/prerender/prerender_unittest.cc b/chrome/browser/prerender/prerender_unittest.cc |
index cacce16e97f0e6cbac65bea44d3ccb0848a5594a..745011c8e2a8aef75ea09f20be523dafbf80076f 100644 |
--- a/chrome/browser/prerender/prerender_unittest.cc |
+++ b/chrome/browser/prerender/prerender_unittest.cc |
@@ -59,7 +59,7 @@ class DummyPrerenderContents : public PrerenderContents { |
} |
virtual bool GetRouteId(int* route_id) const OVERRIDE { |
- *route_id = 0; |
+ *route_id = route_id_; |
return true; |
} |
@@ -70,10 +70,15 @@ class DummyPrerenderContents : public PrerenderContents { |
} |
private: |
+ static int s_next_route_id_; |
mmenke
2012/12/03 20:02:47
I don't think I've seen a single static variable p
gavinp
2012/12/04 18:04:48
Done.
|
+ int route_id_; |
+ |
UnitTestPrerenderManager* test_prerender_manager_; |
FinalStatus expected_final_status_; |
}; |
+int DummyPrerenderContents::s_next_route_id_ = 0; |
+ |
const gfx::Size kSize(640, 480); |
} // namespace |
@@ -244,9 +249,10 @@ DummyPrerenderContents::DummyPrerenderContents( |
const GURL& url, |
Origin origin, |
FinalStatus expected_final_status) |
- : PrerenderContents(test_prerender_manager, prerender_tracker, |
+ : PrerenderContents(test_prerender_manager, |
NULL, url, Referrer(), origin, |
PrerenderManager::kNoExperiment), |
+ route_id_(s_next_route_id_++), |
test_prerender_manager_(test_prerender_manager), |
expected_final_status_(expected_final_status) { |
} |
@@ -263,6 +269,7 @@ void DummyPrerenderContents::StartPrerendering( |
if (!is_control_group) |
prerendering_has_started_ = true; |
load_start_time_ = test_prerender_manager_->GetCurrentTimeTicks(); |
+ NotifyPrerenderStart(); |
} |
class PrerenderTest : public testing::Test { |
@@ -357,12 +364,10 @@ TEST_F(PrerenderTest, DuplicateTest) { |
kDefaultChildId, kDefaultRenderViewRouteId, url, |
Referrer(url, WebKit::WebReferrerPolicyDefault), kSize)); |
- EXPECT_TRUE(duplicate_prerender_handle->IsValid()); |
EXPECT_TRUE(duplicate_prerender_handle->IsPrerendering()); |
ASSERT_EQ(prerender_contents, prerender_manager()->FindAndUseEntry(url)); |
- EXPECT_FALSE(duplicate_prerender_handle->IsValid()); |
mmenke
2012/12/03 20:02:47
Why remove these?
gavinp
2012/12/04 18:04:48
No good reason. Fixed.
|
EXPECT_FALSE(duplicate_prerender_handle->IsPrerendering()); |
} |