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

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

Issue 10582012: For unit tests, track additions to AtExitManager and warn. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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) 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 "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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 static_cast<TestRenderViewHost*>( 125 static_cast<TestRenderViewHost*>(
126 rvh())->SendNavigate(entry->GetPageID(), entry->GetURL()); 126 rvh())->SendNavigate(entry->GetPageID(), entry->GetURL());
127 } 127 }
128 128
129 void RenderViewHostTestHarness::SetUp() { 129 void RenderViewHostTestHarness::SetUp() {
130 #if defined(USE_AURA) 130 #if defined(USE_AURA)
131 aura_test_helper_.reset(new aura::test::AuraTestHelper(&message_loop_)); 131 aura_test_helper_.reset(new aura::test::AuraTestHelper(&message_loop_));
132 aura_test_helper_->SetUp(); 132 aura_test_helper_->SetUp();
133 #endif 133 #endif
134 SetContents(CreateTestWebContents()); 134 SetContents(CreateTestWebContents());
135
136 base::UnitTest::SetUp();
135 } 137 }
136 138
137 void RenderViewHostTestHarness::TearDown() { 139 void RenderViewHostTestHarness::TearDown() {
138 SetContents(NULL); 140 SetContents(NULL);
139 #if defined(USE_AURA) 141 #if defined(USE_AURA)
140 aura_test_helper_->TearDown(); 142 aura_test_helper_->TearDown();
141 #endif 143 #endif
142 // Make sure that we flush any messages related to WebContentsImpl destruction 144 // Make sure that we flush any messages related to WebContentsImpl destruction
143 // before we destroy the browser context. 145 // before we destroy the browser context.
144 MessageLoop::current()->RunAllPending(); 146 MessageLoop::current()->RunAllPending();
145 147
146 // Release the browser context on the UI thread. 148 // Release the browser context on the UI thread.
147 message_loop_.DeleteSoon(FROM_HERE, browser_context_.release()); 149 message_loop_.DeleteSoon(FROM_HERE, browser_context_.release());
148 message_loop_.RunAllPending(); 150 message_loop_.RunAllPending();
151
152 base::UnitTest::TearDown();
149 } 153 }
150 154
151 void RenderViewHostTestHarness::SetRenderProcessHostFactory( 155 void RenderViewHostTestHarness::SetRenderProcessHostFactory(
152 RenderProcessHostFactory* factory) { 156 RenderProcessHostFactory* factory) {
153 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); 157 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory);
154 } 158 }
155 159
156 } // namespace content 160 } // namespace content
OLDNEW
« content/public/test/test_renderer_host.h ('K') | « content/public/test/test_renderer_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698