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

Unified Diff: chrome/browser/extensions/api/identity/account_tracker_unittest.cc

Issue 33173005: Correctly deal with tokens for supervised users in ProfileOAuth2TokenService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 years, 1 month 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/extensions/api/identity/account_tracker_unittest.cc
diff --git a/chrome/browser/extensions/api/identity/account_tracker_unittest.cc b/chrome/browser/extensions/api/identity/account_tracker_unittest.cc
index 2ac55aded65dc527a0e90965ebc6847281551cac..da41348a2647780c3d1222e9886cbc7cef7b6274 100644
--- a/chrome/browser/extensions/api/identity/account_tracker_unittest.cc
+++ b/chrome/browser/extensions/api/identity/account_tracker_unittest.cc
@@ -9,8 +9,10 @@
#include "base/strings/stringprintf.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/signin/fake_profile_oauth2_token_service.h"
+#include "chrome/browser/signin/fake_signin_manager.h"
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
#include "chrome/browser/signin/signin_manager_base.h"
+#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/test/base/testing_profile.h"
#include "content/public/browser/notification_service.h"
#include "content/public/test/test_browser_thread_bundle.h"
@@ -210,12 +212,19 @@ class IdentityAccountTrackerTest : public testing::Test {
TestingProfile::Builder builder;
builder.AddTestingFactory(ProfileOAuth2TokenServiceFactory::GetInstance(),
FakeProfileOAuth2TokenService::Build);
+ builder.AddTestingFactory(SigninManagerFactory::GetInstance(),
+ FakeSigninManagerBase::Build);
test_profile_ = builder.Build();
fake_oauth2_token_service_ = static_cast<FakeProfileOAuth2TokenService*>(
ProfileOAuth2TokenServiceFactory::GetForProfile(test_profile_.get()));
+ SigninManagerBase* signin_manager =
+ SigninManagerFactory::GetForProfile(test_profile_.get());
+ signin_manager->Initialize(test_profile_.get(), NULL);
+ signin_manager->SetAuthenticatedUsername("foo@example.com");
+
account_tracker_.reset(new AccountTracker(test_profile_.get()));
account_tracker_->AddObserver(&observer_);
}

Powered by Google App Engine
This is Rietveld 408576698