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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "content/browser/frame_host/navigation_entry_impl.h" | 9 #include "content/browser/frame_host/navigation_entry_impl.h" |
10 #include "content/browser/renderer_host/render_view_host_factory.h" | 10 #include "content/browser/renderer_host/render_view_host_factory.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 } | 156 } |
157 | 157 |
158 void RenderViewHostTestHarness::NavigateAndCommit(const GURL& url) { | 158 void RenderViewHostTestHarness::NavigateAndCommit(const GURL& url) { |
159 static_cast<TestWebContents*>(web_contents())->NavigateAndCommit(url); | 159 static_cast<TestWebContents*>(web_contents())->NavigateAndCommit(url); |
160 } | 160 } |
161 | 161 |
162 void RenderViewHostTestHarness::Reload() { | 162 void RenderViewHostTestHarness::Reload() { |
163 NavigationEntry* entry = controller().GetLastCommittedEntry(); | 163 NavigationEntry* entry = controller().GetLastCommittedEntry(); |
164 DCHECK(entry); | 164 DCHECK(entry); |
165 controller().Reload(false); | 165 controller().Reload(false); |
166 RenderFrameHostTester::For(main_rfh())->SendNavigateWithTransition( | 166 RenderFrameHostTester::For(main_rfh()) |
167 entry->GetPageID(), entry->GetURL(), ui::PAGE_TRANSITION_RELOAD); | 167 ->SendNavigateWithTransition(entry->GetPageID(), entry->GetUniqueID(), |
| 168 false, entry->GetURL(), |
| 169 ui::PAGE_TRANSITION_RELOAD); |
168 } | 170 } |
169 | 171 |
170 void RenderViewHostTestHarness::FailedReload() { | 172 void RenderViewHostTestHarness::FailedReload() { |
171 NavigationEntry* entry = controller().GetLastCommittedEntry(); | 173 NavigationEntry* entry = controller().GetLastCommittedEntry(); |
172 DCHECK(entry); | 174 DCHECK(entry); |
173 controller().Reload(false); | 175 controller().Reload(false); |
174 RenderFrameHostTester::For(main_rfh())->SendFailedNavigate(entry->GetPageID(), | 176 RenderFrameHostTester::For(main_rfh()) |
175 entry->GetURL()); | 177 ->SendFailedNavigate(entry->GetPageID(), entry->GetUniqueID(), false, |
| 178 entry->GetURL()); |
176 } | 179 } |
177 | 180 |
178 void RenderViewHostTestHarness::SetUp() { | 181 void RenderViewHostTestHarness::SetUp() { |
179 thread_bundle_.reset(new TestBrowserThreadBundle(thread_bundle_options_)); | 182 thread_bundle_.reset(new TestBrowserThreadBundle(thread_bundle_options_)); |
180 | 183 |
181 #if defined(OS_WIN) | 184 #if defined(OS_WIN) |
182 ole_initializer_.reset(new ui::ScopedOleInitializer()); | 185 ole_initializer_.reset(new ui::ScopedOleInitializer()); |
183 #endif | 186 #endif |
184 #if defined(USE_AURA) | 187 #if defined(USE_AURA) |
185 // The ContextFactory must exist before any Compositors are created. | 188 // The ContextFactory must exist before any Compositors are created. |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 BrowserContext* RenderViewHostTestHarness::CreateBrowserContext() { | 245 BrowserContext* RenderViewHostTestHarness::CreateBrowserContext() { |
243 return new TestBrowserContext(); | 246 return new TestBrowserContext(); |
244 } | 247 } |
245 | 248 |
246 void RenderViewHostTestHarness::SetRenderProcessHostFactory( | 249 void RenderViewHostTestHarness::SetRenderProcessHostFactory( |
247 RenderProcessHostFactory* factory) { | 250 RenderProcessHostFactory* factory) { |
248 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); | 251 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); |
249 } | 252 } |
250 | 253 |
251 } // namespace content | 254 } // namespace content |
OLD | NEW |