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 "content/public/test/test_renderer_host.h" | 5 #include "content/public/test/test_renderer_host.h" |
6 | 6 |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "content/browser/frame_host/navigation_entry_impl.h" | 8 #include "content/browser/frame_host/navigation_entry_impl.h" |
9 #include "content/browser/renderer_host/render_view_host_factory.h" | 9 #include "content/browser/renderer_host/render_view_host_factory.h" |
10 #include "content/browser/renderer_host/render_widget_host_impl.h" | 10 #include "content/browser/renderer_host/render_widget_host_impl.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 143 |
144 void RenderViewHostTestHarness::NavigateAndCommit(const GURL& url) { | 144 void RenderViewHostTestHarness::NavigateAndCommit(const GURL& url) { |
145 static_cast<TestWebContents*>(web_contents())->NavigateAndCommit(url); | 145 static_cast<TestWebContents*>(web_contents())->NavigateAndCommit(url); |
146 } | 146 } |
147 | 147 |
148 void RenderViewHostTestHarness::Reload() { | 148 void RenderViewHostTestHarness::Reload() { |
149 NavigationEntry* entry = controller().GetLastCommittedEntry(); | 149 NavigationEntry* entry = controller().GetLastCommittedEntry(); |
150 DCHECK(entry); | 150 DCHECK(entry); |
151 controller().Reload(false); | 151 controller().Reload(false); |
152 static_cast<TestRenderViewHost*>( | 152 static_cast<TestRenderViewHost*>( |
153 rvh())->SendNavigate(entry->GetPageID(), entry->GetURL()); | 153 rvh())->SendNavigateWithTransition( |
| 154 entry->GetPageID(), entry->GetURL(), PAGE_TRANSITION_RELOAD); |
154 } | 155 } |
155 | 156 |
156 void RenderViewHostTestHarness::FailedReload() { | 157 void RenderViewHostTestHarness::FailedReload() { |
157 NavigationEntry* entry = controller().GetLastCommittedEntry(); | 158 NavigationEntry* entry = controller().GetLastCommittedEntry(); |
158 DCHECK(entry); | 159 DCHECK(entry); |
159 controller().Reload(false); | 160 controller().Reload(false); |
160 static_cast<TestRenderViewHost*>( | 161 static_cast<TestRenderViewHost*>( |
161 rvh())->SendFailedNavigate(entry->GetPageID(), entry->GetURL()); | 162 rvh())->SendFailedNavigate(entry->GetPageID(), entry->GetURL()); |
162 } | 163 } |
163 | 164 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 BrowserContext* RenderViewHostTestHarness::CreateBrowserContext() { | 217 BrowserContext* RenderViewHostTestHarness::CreateBrowserContext() { |
217 return new TestBrowserContext(); | 218 return new TestBrowserContext(); |
218 } | 219 } |
219 | 220 |
220 void RenderViewHostTestHarness::SetRenderProcessHostFactory( | 221 void RenderViewHostTestHarness::SetRenderProcessHostFactory( |
221 RenderProcessHostFactory* factory) { | 222 RenderProcessHostFactory* factory) { |
222 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); | 223 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); |
223 } | 224 } |
224 | 225 |
225 } // namespace content | 226 } // namespace content |
OLD | NEW |