Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Unified Diff: chrome/browser/prerender/prerender_unittest.cc

Issue 11348357: Add observer interface to PrerenderContents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remediate to review Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..a023d06a20924f295eed0b41d8ec1764296b7c20 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 g_next_route_id_;
+ int route_id_;
+
UnitTestPrerenderManager* test_prerender_manager_;
FinalStatus expected_final_status_;
};
+int DummyPrerenderContents::g_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_(g_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 {

Powered by Google App Engine
This is Rietveld 408576698