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

Unified Diff: chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc

Issue 2907493002: ChromeOS: Per-user time zone: refactor tests first. (Closed)
Patch Set: Update after review. Created 3 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
Index: chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc
diff --git a/chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc b/chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc
index 660055c2066d2d3e676826712d55846182c3ef94..ff8da1826f1ac305e2e86926e808ba1c6007746f 100644
--- a/chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc
+++ b/chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc
@@ -178,7 +178,9 @@ ChromeUserManagerImpl::CreateChromeUserManager() {
}
ChromeUserManagerImpl::ChromeUserManagerImpl()
- : ChromeUserManager(base::ThreadTaskRunnerHandle::Get()),
+ : ChromeUserManager(base::ThreadTaskRunnerHandle::IsSet()
+ ? base::ThreadTaskRunnerHandle::Get()
+ : scoped_refptr<base::TaskRunner>()),
cros_settings_(CrosSettings::Get()),
device_local_account_policy_service_(NULL),
supervised_user_manager_(new SupervisedUserManagerImpl(this)),
@@ -187,7 +189,10 @@ ChromeUserManagerImpl::ChromeUserManagerImpl()
UpdateNumberOfUsers();
// UserManager instance should be used only on UI thread.
- DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ // (or in unit tests)
+ if (base::ThreadTaskRunnerHandle::IsSet())
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+
registrar_.Add(this,
chrome::NOTIFICATION_OWNERSHIP_STATUS_CHANGED,
content::NotificationService::AllSources());

Powered by Google App Engine
This is Rietveld 408576698