Index: chrome/browser/intents/register_intent_handler_infobar_delegate_unittest.cc |
diff --git a/chrome/browser/intents/register_intent_handler_infobar_delegate_unittest.cc b/chrome/browser/intents/register_intent_handler_infobar_delegate_unittest.cc |
index 559a09ec14bd07822bc73268e05ae6d1c48a0ed3..008996c333afad503b2a2cacf3b26a7cdf8c7330 100644 |
--- a/chrome/browser/intents/register_intent_handler_infobar_delegate_unittest.cc |
+++ b/chrome/browser/intents/register_intent_handler_infobar_delegate_unittest.cc |
@@ -2,6 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
+#include "base/synchronization/waitable_event.h" |
#include "base/utf_string_conversions.h" |
#include "chrome/browser/intents/register_intent_handler_infobar_delegate.h" |
#include "chrome/browser/intents/web_intents_registry.h" |
@@ -38,12 +39,13 @@ class RegisterIntentHandlerInfoBarDelegateTest |
: public TabContentsWrapperTestHarness { |
protected: |
RegisterIntentHandlerInfoBarDelegateTest() |
- : ui_thread_(BrowserThread::UI, MessageLoopForUI::current()) {} |
+ : ui_thread_(BrowserThread::UI, MessageLoopForUI::current()), |
+ db_thread_(BrowserThread::DB) {} |
virtual void SetUp() { |
+ db_thread_.Start(); |
TabContentsWrapperTestHarness::SetUp(); |
- profile()->CreateWebDataService(false); |
web_intents_registry_ = BuildForProfile(profile()); |
} |
@@ -51,12 +53,20 @@ class RegisterIntentHandlerInfoBarDelegateTest |
web_intents_registry_ = NULL; |
TabContentsWrapperTestHarness::TearDown(); |
+ // Schedule another task on the DB thread to notify us that it's safe to |
+ // carry on with the test. |
+ base::WaitableEvent done(false, false); |
+ BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, |
+ base::Bind(&base::WaitableEvent::Signal, base::Unretained(&done))); |
+ done.Wait(); |
+ db_thread_.Stop(); |
} |
MockWebIntentsRegistry* web_intents_registry_; |
private: |
content::TestBrowserThread ui_thread_; |
+ content::TestBrowserThread db_thread_; |
DISALLOW_COPY_AND_ASSIGN(RegisterIntentHandlerInfoBarDelegateTest); |
}; |