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

Unified Diff: chrome/browser/signin/token_service_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/signin/token_service_factory.cc ('k') | chrome/browser/signin/ubertoken_fetcher_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/signin/token_service_unittest.cc
===================================================================
--- chrome/browser/signin/token_service_unittest.cc (revision 136877)
+++ chrome/browser/signin/token_service_unittest.cc (working copy)
@@ -13,6 +13,7 @@
#include "base/synchronization/waitable_event.h"
#include "chrome/browser/password_manager/encryptor.h"
#include "chrome/browser/signin/token_service_factory.h"
+#include "chrome/browser/webdata/web_data_service_factory.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/net/gaia/mock_url_fetcher_factory.h"
@@ -72,7 +73,8 @@
ASSERT_TRUE(db_thread_.Start());
profile_.reset(new TestingProfile());
- profile_->CreateWebDataService(false);
+ profile_->CreateWebDataService();
+
WaitForDBLoadCompletion();
service_ = TokenServiceFactory::GetForProfile(profile_.get());
@@ -89,6 +91,12 @@
if (profile_.get()) {
profile_.reset(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());
@@ -96,6 +104,10 @@
}
void TokenServiceTestHarness::WaitForDBLoadCompletion() {
+ // Force the loading of the WebDataService.
+ WebDataServiceFactory::GetForProfile(profile_.get(),
+ Profile::IMPLICIT_ACCESS);
+
// The WebDB does all work on the DB thread. This will add an event
// to the end of the DB thread, so when we reach this task, all DB
// operations should be complete.
« no previous file with comments | « chrome/browser/signin/token_service_factory.cc ('k') | chrome/browser/signin/ubertoken_fetcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698