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

Side by Side Diff: content/public/test/test_renderer_host.cc

Issue 1002803002: Classify navigations without page id in parallel to the existing classifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unit tests Created 5 years, 9 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 unified diff | Download patch
OLDNEW
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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
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())->SendNavigateWithTransition(
167 entry->GetPageID(), entry->GetURL(), ui::PAGE_TRANSITION_RELOAD); 167 entry->GetPageID(), entry->GetUniqueID(), false, entry->GetURL(),
168 ui::PAGE_TRANSITION_RELOAD);
168 } 169 }
169 170
170 void RenderViewHostTestHarness::FailedReload() { 171 void RenderViewHostTestHarness::FailedReload() {
171 NavigationEntry* entry = controller().GetLastCommittedEntry(); 172 NavigationEntry* entry = controller().GetLastCommittedEntry();
172 DCHECK(entry); 173 DCHECK(entry);
173 controller().Reload(false); 174 controller().Reload(false);
174 RenderFrameHostTester::For(main_rfh())->SendFailedNavigate(entry->GetPageID(), 175 RenderFrameHostTester::For(main_rfh())->SendFailedNavigate(
175 entry->GetURL()); 176 entry->GetPageID(), entry->GetUniqueID(), false, entry->GetURL());
176 } 177 }
177 178
178 void RenderViewHostTestHarness::SetUp() { 179 void RenderViewHostTestHarness::SetUp() {
179 thread_bundle_.reset(new TestBrowserThreadBundle(thread_bundle_options_)); 180 thread_bundle_.reset(new TestBrowserThreadBundle(thread_bundle_options_));
180 181
181 #if defined(OS_WIN) 182 #if defined(OS_WIN)
182 ole_initializer_.reset(new ui::ScopedOleInitializer()); 183 ole_initializer_.reset(new ui::ScopedOleInitializer());
183 #endif 184 #endif
184 #if defined(USE_AURA) 185 #if defined(USE_AURA)
185 // The ContextFactory must exist before any Compositors are created. 186 // The ContextFactory must exist before any Compositors are created.
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 BrowserContext* RenderViewHostTestHarness::CreateBrowserContext() { 243 BrowserContext* RenderViewHostTestHarness::CreateBrowserContext() {
243 return new TestBrowserContext(); 244 return new TestBrowserContext();
244 } 245 }
245 246
246 void RenderViewHostTestHarness::SetRenderProcessHostFactory( 247 void RenderViewHostTestHarness::SetRenderProcessHostFactory(
247 RenderProcessHostFactory* factory) { 248 RenderProcessHostFactory* factory) {
248 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); 249 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory);
249 } 250 }
250 251
251 } // namespace content 252 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698