| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_render_view_host.h" | 5 #include "chrome/browser/renderer_host/test_render_view_host.h" |
| 6 | 6 |
| 7 #include "chrome/browser/renderer_host/backing_store.h" | 7 #include "chrome/browser/renderer_host/backing_store.h" |
| 8 #include "chrome/browser/tab_contents/test_web_contents.h" | 8 #include "chrome/browser/tab_contents/test_web_contents.h" |
| 9 #include "chrome/common/render_messages.h" | 9 #include "chrome/common/render_messages.h" |
| 10 | 10 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 } | 75 } |
| 76 | 76 |
| 77 void RenderViewHostTestHarness::SetUp() { | 77 void RenderViewHostTestHarness::SetUp() { |
| 78 // See comment above profile_ decl for why we check for NULL here. | 78 // See comment above profile_ decl for why we check for NULL here. |
| 79 if (!profile_.get()) | 79 if (!profile_.get()) |
| 80 profile_.reset(new TestingProfile()); | 80 profile_.reset(new TestingProfile()); |
| 81 | 81 |
| 82 // This will be deleted when the WebContents goes away. | 82 // This will be deleted when the WebContents goes away. |
| 83 SiteInstance* instance = SiteInstance::CreateSiteInstance(profile_.get()); | 83 SiteInstance* instance = SiteInstance::CreateSiteInstance(profile_.get()); |
| 84 | 84 |
| 85 contents_ = new TestWebContents(profile_.get(), instance, &rvh_factory_); | 85 contents_ = new TestWebContents(profile_.get(), instance); |
| 86 controller_ = new NavigationController(contents_, profile_.get()); | 86 controller_ = new NavigationController(contents_, profile_.get()); |
| 87 } | 87 } |
| 88 | 88 |
| 89 void RenderViewHostTestHarness::TearDown() { | 89 void RenderViewHostTestHarness::TearDown() { |
| 90 if (contents_) { | 90 if (contents_) { |
| 91 contents_->CloseContents(); | 91 contents_->CloseContents(); |
| 92 contents_ = NULL; | 92 contents_ = NULL; |
| 93 } | 93 } |
| 94 controller_ = NULL; | 94 controller_ = NULL; |
| 95 | 95 |
| 96 // Make sure that we flush any messages related to WebContents destruction | 96 // Make sure that we flush any messages related to WebContents destruction |
| 97 // before we destroy the profile. | 97 // before we destroy the profile. |
| 98 MessageLoop::current()->RunAllPending(); | 98 MessageLoop::current()->RunAllPending(); |
| 99 } | 99 } |
| OLD | NEW |