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/test/test_renderer_host.h" | 5 #include "content/test/test_renderer_host.h" |
6 | 6 |
7 #include "content/browser/renderer_host/render_view_host_factory.h" | 7 #include "content/browser/renderer_host/render_view_host_factory.h" |
8 #include "content/browser/renderer_host/test_render_view_host.h" | 8 #include "content/browser/renderer_host/test_render_view_host.h" |
9 #include "content/browser/site_instance_impl.h" | 9 #include "content/browser/site_instance_impl.h" |
10 #include "content/browser/web_contents/navigation_entry_impl.h" | 10 #include "content/browser/web_contents/navigation_entry_impl.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 new aura::test::TestStackingClient(root_window_.get())); | 141 new aura::test::TestStackingClient(root_window_.get())); |
142 #endif // USE_AURA | 142 #endif // USE_AURA |
143 SetContents(CreateTestWebContents()); | 143 SetContents(CreateTestWebContents()); |
144 } | 144 } |
145 | 145 |
146 void RenderViewHostTestHarness::TearDown() { | 146 void RenderViewHostTestHarness::TearDown() { |
147 SetContents(NULL); | 147 SetContents(NULL); |
148 #if defined(USE_AURA) | 148 #if defined(USE_AURA) |
149 test_stacking_client_.reset(); | 149 test_stacking_client_.reset(); |
150 root_window_.reset(); | 150 root_window_.reset(); |
| 151 aura::Env::DeleteInstance(); |
151 #endif | 152 #endif |
152 | 153 |
153 // Make sure that we flush any messages related to WebContentsImpl destruction | 154 // Make sure that we flush any messages related to WebContentsImpl destruction |
154 // before we destroy the browser context. | 155 // before we destroy the browser context. |
155 MessageLoop::current()->RunAllPending(); | 156 MessageLoop::current()->RunAllPending(); |
156 | 157 |
157 // Release the browser context on the UI thread. | 158 // Release the browser context on the UI thread. |
158 message_loop_.DeleteSoon(FROM_HERE, browser_context_.release()); | 159 message_loop_.DeleteSoon(FROM_HERE, browser_context_.release()); |
159 message_loop_.RunAllPending(); | 160 message_loop_.RunAllPending(); |
160 } | 161 } |
161 | 162 |
162 void RenderViewHostTestHarness::SetRenderProcessHostFactory( | 163 void RenderViewHostTestHarness::SetRenderProcessHostFactory( |
163 RenderProcessHostFactory* factory) { | 164 RenderProcessHostFactory* factory) { |
164 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); | 165 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); |
165 } | 166 } |
166 | 167 |
167 } // namespace content | 168 } // namespace content |
OLD | NEW |