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

Unified Diff: chrome/browser/sync/sync_ui_util_unittest.cc

Issue 14630003: signin: move SigninManagerBase::Signout to SigninManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: apocalypse Created 7 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/sync/sync_ui_util_unittest.cc
diff --git a/chrome/browser/sync/sync_ui_util_unittest.cc b/chrome/browser/sync/sync_ui_util_unittest.cc
index 50bdf2e8f08825181fbbfb76d83c9385dd9e6468..e5ef554865a67bf4332fc0b0ab6ae4206f339cbd 100644
--- a/chrome/browser/sync/sync_ui_util_unittest.cc
+++ b/chrome/browser/sync/sync_ui_util_unittest.cc
@@ -74,7 +74,7 @@ TEST(SyncUIUtilTest, PassphraseGlobalError) {
scoped_ptr<Profile> profile(
ProfileSyncServiceMock::MakeSignedInTestingProfile());
NiceMock<ProfileSyncServiceMock> service(profile.get());
- FakeSigninManagerBase signin(profile.get());
+ FakeSigninManagerBase signin;
browser_sync::SyncBackendHost::Status status;
EXPECT_CALL(service, QueryDetailedSyncStatus(_))
.WillRepeatedly(Return(false));
@@ -94,7 +94,7 @@ TEST(SyncUIUtilTest, AuthAndPassphraseGlobalError) {
scoped_ptr<Profile> profile(
ProfileSyncServiceMock::MakeSignedInTestingProfile());
NiceMock<ProfileSyncServiceMock> service(profile.get());
- FakeSigninManagerBase signin(profile.get());
+ FakeSigninManagerBase signin;
browser_sync::SyncBackendHost::Status status;
EXPECT_CALL(service, QueryDetailedSyncStatus(_))
.WillRepeatedly(Return(false));
@@ -145,7 +145,7 @@ TEST(SyncUIUtilTest, AuthStateGlobalError) {
GoogleServiceAuthError::HOSTED_NOT_ALLOWED
};
- FakeSigninManagerBase signin(profile.get());
+ FakeSigninManagerBase signin;
for (size_t i = 0; i < arraysize(table); ++i) {
VerifySyncGlobalErrorResult(&service, signin, table[i], true, false);
VerifySyncGlobalErrorResult(&service, signin, table[i], false, false);
@@ -163,7 +163,8 @@ TEST(SyncUIUtilTest, AuthStateGlobalError) {
class FakeSigninManagerForSyncUIUtilTest : public FakeSigninManagerBase {
public:
explicit FakeSigninManagerForSyncUIUtilTest(Profile* profile)
- : FakeSigninManagerBase(profile), auth_in_progress_(false) {
+ : auth_in_progress_(false) {
+ Initialize(profile);
}
virtual ~FakeSigninManagerForSyncUIUtilTest() {
@@ -321,13 +322,13 @@ void GetDistinctCase(ProfileSyncServiceMock& service,
TEST(SyncUIUtilTest, DistinctCasesReportUniqueMessageSets) {
std::set<string16> messages;
for (int idx = 0; idx != NUMBER_OF_STATUS_CASES; idx++) {
- scoped_ptr<Profile> profile(
- ProfileSyncServiceMock::MakeSignedInTestingProfile());
+ scoped_ptr<Profile> profile(new TestingProfile());
ProfileSyncServiceMock service(profile.get());
FakeSigninManagerForSyncUIUtilTest signin(profile.get());
signin.SetAuthenticatedUsername("test_user@test.com");
- FakeAuthStatusProvider provider(signin.signin_global_error());
- GetDistinctCase(service, &signin, &provider, idx);
+ scoped_ptr<FakeAuthStatusProvider> provider(
+ new FakeAuthStatusProvider(signin.signin_global_error()));
+ GetDistinctCase(service, &signin, provider.get(), idx);
string16 status_label;
string16 link_label;
sync_ui_util::GetStatusLabels(&service,
@@ -347,6 +348,8 @@ TEST(SyncUIUtilTest, DistinctCasesReportUniqueMessageSets) {
messages.insert(combined_label);
testing::Mock::VerifyAndClearExpectations(&service);
testing::Mock::VerifyAndClearExpectations(&signin);
+ provider.reset();
+ signin.Shutdown();
}
}
@@ -359,8 +362,9 @@ TEST(SyncUIUtilTest, HtmlNotIncludedInStatusIfNotRequested) {
ProfileSyncServiceMock service(profile.get());
FakeSigninManagerForSyncUIUtilTest signin(profile.get());
signin.SetAuthenticatedUsername("test_user@test.com");
- FakeAuthStatusProvider provider(signin.signin_global_error());
- GetDistinctCase(service, &signin, &provider, idx);
+ scoped_ptr<FakeAuthStatusProvider> provider(
+ new FakeAuthStatusProvider(signin.signin_global_error()));
+ GetDistinctCase(service, &signin, provider.get(), idx);
string16 status_label;
string16 link_label;
sync_ui_util::GetStatusLabels(&service,
@@ -377,5 +381,7 @@ TEST(SyncUIUtilTest, HtmlNotIncludedInStatusIfNotRequested) {
string16::npos);
testing::Mock::VerifyAndClearExpectations(&service);
testing::Mock::VerifyAndClearExpectations(&signin);
+ provider.reset();
+ signin.Shutdown();
}
}
« no previous file with comments | « chrome/browser/sync/profile_sync_service_unittest.cc ('k') | chrome/browser/ui/sync/one_click_signin_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698