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

Unified Diff: content/public/test/test_renderer_host.cc

Issue 14197014: Add TestBrowserThreadBundle into RenderViewHostTestHarness. Kill some unnecessary real threads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: platform specific dchecks should be platform specific Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: content/public/test/test_renderer_host.cc
diff --git a/content/public/test/test_renderer_host.cc b/content/public/test/test_renderer_host.cc
index 9a1cc856c58935bdf4b447e44d833e7b112eb315..060e97afd8def19722f398df2028cf7ee04da317 100644
--- a/content/public/test/test_renderer_host.cc
+++ b/content/public/test/test_renderer_host.cc
@@ -72,7 +72,9 @@ RenderViewHostTestEnabler::~RenderViewHostTestEnabler() {
// RenderViewHostTestHarness --------------------------------------------------
-RenderViewHostTestHarness::RenderViewHostTestHarness() : contents_(NULL) {
+RenderViewHostTestHarness::RenderViewHostTestHarness()
+ : contents_(NULL),
+ real_threads_mask_(TestBrowserThreadBundle::NO_REAL_THREAD) {
}
RenderViewHostTestHarness::~RenderViewHostTestHarness() {
@@ -155,11 +157,14 @@ void RenderViewHostTestHarness::FailedReload() {
}
void RenderViewHostTestHarness::SetUp() {
+ thread_bundle_.reset(new TestBrowserThreadBundle(real_threads_mask_));
+
#if defined(OS_WIN)
ole_initializer_.reset(new ui::ScopedOleInitializer());
#endif
#if defined(USE_AURA)
- aura_test_helper_.reset(new aura::test::AuraTestHelper(&message_loop_));
+ aura_test_helper_.reset(
+ new aura::test::AuraTestHelper(base::MessageLoopForUI::current()));
aura_test_helper_->SetUp();
#endif
SetContents(CreateTestWebContents());
@@ -179,12 +184,16 @@ void RenderViewHostTestHarness::TearDown() {
rvh_test_enabler_.rph_factory_.reset();
// Release the browser context on the UI thread.
- message_loop_.DeleteSoon(FROM_HERE, browser_context_.release());
+ BrowserThread::PostTask(content::BrowserThread::UI,
Jeffrey Yasskin 2013/05/22 22:24:58 BrowserThread::DeleteSoon exists.
awong 2013/05/24 23:39:28 Done.
+ FROM_HERE,
+ base::Bind(&base::DeletePointer<BrowserContext>,
+ browser_context_.release()));
base::RunLoop().RunUntilIdle();
Jeffrey Yasskin 2013/05/22 22:24:58 You can remove this line, I think.
awong 2013/05/24 23:39:28 I'm not certain I can. What if the browser_contex
Jeffrey Yasskin 2013/05/27 03:12:13 Ew. Good point. Would it be better to reset the th
awong 2013/05/30 21:46:09 Per IRC conversation with cpu@, requiring OLE duri
#if defined(OS_WIN)
ole_initializer_.reset();
#endif
+ thread_bundle_.reset();
}
void RenderViewHostTestHarness::SetRenderProcessHostFactory(

Powered by Google App Engine
This is Rietveld 408576698