Index: chrome/browser/intents/web_intents_registry_unittest.cc |
diff --git a/chrome/browser/intents/web_intents_registry_unittest.cc b/chrome/browser/intents/web_intents_registry_unittest.cc |
index 6cfa289ffdb9a3adee1754fa2971ee5c29521958..c66bb406db5855cc7b57bc8cc3f043af4f957a79 100644 |
--- a/chrome/browser/intents/web_intents_registry_unittest.cc |
+++ b/chrome/browser/intents/web_intents_registry_unittest.cc |
@@ -7,6 +7,7 @@ |
#include "base/message_loop.h" |
#include "base/path_service.h" |
#include "base/scoped_temp_dir.h" |
+#include "base/synchronization/waitable_event.h" |
#include "base/utf_string_conversions.h" |
#include "chrome/browser/extensions/test_extension_service.h" |
#include "chrome/browser/intents/default_web_intent_service.h" |
@@ -101,9 +102,14 @@ class WebIntentsRegistryTest : public testing::Test { |
} |
virtual void TearDown() { |
- if (wds_.get()) |
- wds_->Shutdown(); |
- |
+ wds_ = NULL; |
+ |
+ // 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(); |
MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
MessageLoop::current()->Run(); |