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

Side by Side Diff: chrome/browser/renderer_host/test/test_render_view_host.cc

Issue 3346005: Don't create pending entries when a navigation is initiated by the page. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 3 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/renderer_host/test/test_render_view_host.h" 5 #include "chrome/browser/renderer_host/test/test_render_view_host.h"
6 6
7 #include "chrome/browser/browser_url_handler.h" 7 #include "chrome/browser/browser_url_handler.h"
8 #include "chrome/browser/renderer_host/site_instance.h" 8 #include "chrome/browser/renderer_host/site_instance.h"
9 #include "chrome/browser/renderer_host/test/test_backing_store.h" 9 #include "chrome/browser/renderer_host/test/test_backing_store.h"
10 #include "chrome/browser/tab_contents/navigation_controller.h" 10 #include "chrome/browser/tab_contents/navigation_controller.h"
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 229
230 TestRenderViewHost* RenderViewHostTestHarness::active_rvh() { 230 TestRenderViewHost* RenderViewHostTestHarness::active_rvh() {
231 return pending_rvh() ? pending_rvh() : rvh(); 231 return pending_rvh() ? pending_rvh() : rvh();
232 } 232 }
233 233
234 TestingProfile* RenderViewHostTestHarness::profile() { 234 TestingProfile* RenderViewHostTestHarness::profile() {
235 return profile_.get(); 235 return profile_.get();
236 } 236 }
237 237
238 MockRenderProcessHost* RenderViewHostTestHarness::process() { 238 MockRenderProcessHost* RenderViewHostTestHarness::process() {
239 if (pending_rvh())
240 return static_cast<MockRenderProcessHost*>(pending_rvh()->process());
239 return static_cast<MockRenderProcessHost*>(rvh()->process()); 241 return static_cast<MockRenderProcessHost*>(rvh()->process());
240 } 242 }
241 243
242 void RenderViewHostTestHarness::DeleteContents() { 244 void RenderViewHostTestHarness::DeleteContents() {
243 contents_.reset(); 245 contents_.reset();
244 } 246 }
245 247
246 TestTabContents* RenderViewHostTestHarness::CreateTestTabContents() { 248 TestTabContents* RenderViewHostTestHarness::CreateTestTabContents() {
247 // See comment above profile_ decl for why we check for NULL here. 249 // See comment above profile_ decl for why we check for NULL here.
248 if (!profile_.get()) 250 if (!profile_.get())
(...skipping 24 matching lines...) Expand all
273 contents_.reset(); 275 contents_.reset();
274 276
275 // Make sure that we flush any messages related to TabContents destruction 277 // Make sure that we flush any messages related to TabContents destruction
276 // before we destroy the profile. 278 // before we destroy the profile.
277 MessageLoop::current()->RunAllPending(); 279 MessageLoop::current()->RunAllPending();
278 280
279 // Release the profile on the UI thread. 281 // Release the profile on the UI thread.
280 message_loop_.DeleteSoon(FROM_HERE, profile_.release()); 282 message_loop_.DeleteSoon(FROM_HERE, profile_.release());
281 message_loop_.RunAllPending(); 283 message_loop_.RunAllPending();
282 } 284 }
OLDNEW
« no previous file with comments | « chrome/browser/back_forward_menu_model_unittest.cc ('k') | chrome/browser/sessions/tab_restore_service_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698