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

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

Issue 3585002: Revert 60963 - Merge 58701 - Relanding this:... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/517/src/
Patch Set: Created 10 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 unified diff | Download patch | Annotate | Revision Log
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());
241 return static_cast<MockRenderProcessHost*>(rvh()->process()); 239 return static_cast<MockRenderProcessHost*>(rvh()->process());
242 } 240 }
243 241
244 void RenderViewHostTestHarness::DeleteContents() { 242 void RenderViewHostTestHarness::DeleteContents() {
245 contents_.reset(); 243 contents_.reset();
246 } 244 }
247 245
248 TestTabContents* RenderViewHostTestHarness::CreateTestTabContents() { 246 TestTabContents* RenderViewHostTestHarness::CreateTestTabContents() {
249 // See comment above profile_ decl for why we check for NULL here. 247 // See comment above profile_ decl for why we check for NULL here.
250 if (!profile_.get()) 248 if (!profile_.get())
(...skipping 24 matching lines...) Expand all
275 contents_.reset(); 273 contents_.reset();
276 274
277 // Make sure that we flush any messages related to TabContents destruction 275 // Make sure that we flush any messages related to TabContents destruction
278 // before we destroy the profile. 276 // before we destroy the profile.
279 MessageLoop::current()->RunAllPending(); 277 MessageLoop::current()->RunAllPending();
280 278
281 // Release the profile on the UI thread. 279 // Release the profile on the UI thread.
282 message_loop_.DeleteSoon(FROM_HERE, profile_.release()); 280 message_loop_.DeleteSoon(FROM_HERE, profile_.release());
283 message_loop_.RunAllPending(); 281 message_loop_.RunAllPending();
284 } 282 }
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