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

Unified Diff: content/public/test/test_renderer_host.cc

Issue 636673002: Remove navigation from TestRenderViewHost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes from self-review Created 6 years, 2 months 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: content/public/test/test_renderer_host.cc
diff --git a/content/public/test/test_renderer_host.cc b/content/public/test/test_renderer_host.cc
index 6a36fe2743fc4890dfea1be7d63a037c52084983..295dae1f2a176ed810c4815e618428ca1c23f8ec 100644
--- a/content/public/test/test_renderer_host.cc
+++ b/content/public/test/test_renderer_host.cc
@@ -38,6 +38,14 @@ RenderFrameHostTester* RenderFrameHostTester::For(RenderFrameHost* host) {
return static_cast<TestRenderFrameHost*>(host);
}
+// static
+RenderFrameHost* RenderFrameHostTester::GetPendingForController(
+ NavigationController* controller) {
+ WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(
+ controller->GetWebContents());
+ return web_contents->GetRenderManagerForTesting()->pending_frame_host();
+}
+
// RenderViewHostTester -------------------------------------------------------
// static
@@ -46,14 +54,6 @@ RenderViewHostTester* RenderViewHostTester::For(RenderViewHost* host) {
}
// static
-RenderViewHost* RenderViewHostTester::GetPendingForController(
- NavigationController* controller) {
- WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(
- controller->GetWebContents());
- return web_contents->GetRenderManagerForTesting()->pending_render_view_host();
-}
-
-// static
bool RenderViewHostTester::IsRenderViewHostSwappedOut(RenderViewHost* rvh) {
return static_cast<RenderFrameHostImpl*>(rvh->GetMainFrame())->rfh_state() ==
RenderFrameHostImpl::STATE_SWAPPED_OUT;
@@ -160,17 +160,16 @@ void RenderViewHostTestHarness::Reload() {
NavigationEntry* entry = controller().GetLastCommittedEntry();
DCHECK(entry);
controller().Reload(false);
- static_cast<TestRenderViewHost*>(
- rvh())->SendNavigateWithTransition(
- entry->GetPageID(), entry->GetURL(), ui::PAGE_TRANSITION_RELOAD);
+ RenderFrameHostTester::For(main_rfh())->SendNavigateWithTransition(
+ entry->GetPageID(), entry->GetURL(), ui::PAGE_TRANSITION_RELOAD);
}
void RenderViewHostTestHarness::FailedReload() {
NavigationEntry* entry = controller().GetLastCommittedEntry();
DCHECK(entry);
controller().Reload(false);
- static_cast<TestRenderViewHost*>(
- rvh())->SendFailedNavigate(entry->GetPageID(), entry->GetURL());
+ RenderFrameHostTester::For(main_rfh())->SendFailedNavigate(entry->GetPageID(),
+ entry->GetURL());
}
void RenderViewHostTestHarness::SetUp() {

Powered by Google App Engine
This is Rietveld 408576698