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

Unified Diff: chrome/browser/intents/web_intents_registry_unittest.cc

Issue 10185008: Taking over issue 10006037: Moved WebDataService to ProfileKeyedService (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 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
« no previous file with comments | « chrome/browser/intents/web_intents_registry_factory.cc ('k') | chrome/browser/memory_purger.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/intents/web_intents_registry_unittest.cc
===================================================================
--- chrome/browser/intents/web_intents_registry_unittest.cc (revision 136877)
+++ chrome/browser/intents/web_intents_registry_unittest.cc (working copy)
@@ -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 @@
}
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();
« no previous file with comments | « chrome/browser/intents/web_intents_registry_factory.cc ('k') | chrome/browser/memory_purger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698