| 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 05540299ba1c7d61925ca50bb1d1c66f94b30ebe..fb4eaf5c43e3a8970b8df4e15a990e8568acbd77 100644
|
| --- a/chrome/browser/intents/web_intents_registry_unittest.cc
|
| +++ b/chrome/browser/intents/web_intents_registry_unittest.cc
|
| @@ -8,6 +8,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"
|
| @@ -102,9 +103,16 @@ class WebIntentsRegistryTest : public testing::Test {
|
| }
|
|
|
| virtual void TearDown() {
|
| - if (wds_.get())
|
| - wds_->Shutdown();
|
| -
|
| + // Clear all references to wds to force it destruction.
|
| + wds_->ShutdownOnUIThread();
|
| + 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();
|
|
|