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

Unified Diff: chrome/browser/ui/webui/options/sync_setup_handler_unittest.cc

Issue 1175243009: [Sync] Rename SyncEnabledAndLoggedIn() to CanStartSync(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missed a const transition. Created 5 years, 6 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/ui/webui/options/sync_setup_handler_unittest.cc
diff --git a/chrome/browser/ui/webui/options/sync_setup_handler_unittest.cc b/chrome/browser/ui/webui/options/sync_setup_handler_unittest.cc
index a0c5de40413dc5095bdd10b2d3969f505e3573cb..2b08179e40bfaeb1e78ac6c6753dd037900ba196 100644
--- a/chrome/browser/ui/webui/options/sync_setup_handler_unittest.cc
+++ b/chrome/browser/ui/webui/options/sync_setup_handler_unittest.cc
@@ -299,8 +299,7 @@ class SyncSetupHandlerTest : public testing::Test {
// Setup the expectations for calls made when displaying the config page.
void SetDefaultExpectationsForConfigPage() {
- EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn()).
- WillRepeatedly(Return(true));
+ EXPECT_CALL(*mock_pss_, CanSyncStart()).WillRepeatedly(Return(true));
EXPECT_CALL(*mock_pss_, GetRegisteredDataTypes()).
WillRepeatedly(Return(GetAllTypes()));
EXPECT_CALL(*mock_pss_, GetPreferredDataTypes()).
@@ -384,8 +383,7 @@ TEST_F(SyncSetupHandlerTest, Basic) {
#if !defined(OS_CHROMEOS)
TEST_F(SyncSetupHandlerFirstSigninTest, DisplayBasicLogin) {
- EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn())
- .WillRepeatedly(Return(false));
+ EXPECT_CALL(*mock_pss_, CanSyncStart()).WillRepeatedly(Return(false));
EXPECT_CALL(*mock_pss_, IsOAuthRefreshTokenAvailable())
.WillRepeatedly(Return(false));
EXPECT_CALL(*mock_pss_, HasSyncSetupCompleted())
@@ -409,8 +407,7 @@ TEST_F(SyncSetupHandlerFirstSigninTest, DisplayBasicLogin) {
}
TEST_F(SyncSetupHandlerTest, ShowSyncSetupWhenNotSignedIn) {
- EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn())
- .WillRepeatedly(Return(false));
+ EXPECT_CALL(*mock_pss_, CanSyncStart()).WillRepeatedly(Return(false));
EXPECT_CALL(*mock_pss_, IsOAuthRefreshTokenAvailable())
.WillRepeatedly(Return(false));
EXPECT_CALL(*mock_pss_, HasSyncSetupCompleted())
@@ -445,8 +442,7 @@ TEST_F(SyncSetupHandlerTest, HandleSetupUIWhenSyncDisabled) {
// Verifies that the handler correctly handles a cancellation when
// it is displaying the spinner to the user.
TEST_F(SyncSetupHandlerTest, DisplayConfigureWithBackendDisabledAndCancel) {
- EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn())
- .WillRepeatedly(Return(true));
+ EXPECT_CALL(*mock_pss_, CanSyncStart()).WillRepeatedly(Return(true));
EXPECT_CALL(*mock_pss_, IsOAuthRefreshTokenAvailable())
.WillRepeatedly(Return(true));
EXPECT_CALL(*mock_pss_, HasSyncSetupCompleted())
@@ -472,8 +468,7 @@ TEST_F(SyncSetupHandlerTest, DisplayConfigureWithBackendDisabledAndCancel) {
// to showing a configuration page when sync setup completes successfully.
TEST_F(SyncSetupHandlerTest,
DisplayConfigureWithBackendDisabledAndSyncStartupCompleted) {
- EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn())
- .WillRepeatedly(Return(true));
+ EXPECT_CALL(*mock_pss_, CanSyncStart()).WillRepeatedly(Return(true));
EXPECT_CALL(*mock_pss_, IsOAuthRefreshTokenAvailable())
.WillRepeatedly(Return(true));
EXPECT_CALL(*mock_pss_, HasSyncSetupCompleted())
@@ -526,8 +521,7 @@ TEST_F(SyncSetupHandlerTest,
// before the user has continued on.
TEST_F(SyncSetupHandlerTest,
DisplayConfigureWithBackendDisabledAndCancelAfterSigninSuccess) {
- EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn())
- .WillRepeatedly(Return(true));
+ EXPECT_CALL(*mock_pss_, CanSyncStart()).WillRepeatedly(Return(true));
EXPECT_CALL(*mock_pss_, IsOAuthRefreshTokenAvailable())
.WillRepeatedly(Return(true));
EXPECT_CALL(*mock_pss_, HasSyncSetupCompleted())
@@ -553,8 +547,7 @@ TEST_F(SyncSetupHandlerTest,
TEST_F(SyncSetupHandlerTest,
DisplayConfigureWithBackendDisabledAndSigninFailed) {
- EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn())
- .WillRepeatedly(Return(true));
+ EXPECT_CALL(*mock_pss_, CanSyncStart()).WillRepeatedly(Return(true));
EXPECT_CALL(*mock_pss_, IsOAuthRefreshTokenAvailable())
.WillRepeatedly(Return(true));
EXPECT_CALL(*mock_pss_, HasSyncSetupCompleted())
@@ -588,8 +581,7 @@ class SyncSetupHandlerNonCrosTest : public SyncSetupHandlerTest {
};
TEST_F(SyncSetupHandlerNonCrosTest, HandleGaiaAuthFailure) {
- EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn())
- .WillRepeatedly(Return(false));
+ EXPECT_CALL(*mock_pss_, CanSyncStart()).WillRepeatedly(Return(false));
EXPECT_CALL(*mock_pss_, IsOAuthRefreshTokenAvailable())
.WillRepeatedly(Return(false));
EXPECT_CALL(*mock_pss_, HasUnrecoverableError())
@@ -604,8 +596,7 @@ TEST_F(SyncSetupHandlerNonCrosTest, HandleGaiaAuthFailure) {
// TODO(kochi): We need equivalent tests for ChromeOS.
TEST_F(SyncSetupHandlerNonCrosTest, UnrecoverableErrorInitializingSync) {
- EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn())
- .WillRepeatedly(Return(false));
+ EXPECT_CALL(*mock_pss_, CanSyncStart()).WillRepeatedly(Return(false));
EXPECT_CALL(*mock_pss_, IsOAuthRefreshTokenAvailable())
.WillRepeatedly(Return(false));
EXPECT_CALL(*mock_pss_, HasSyncSetupCompleted())
@@ -617,8 +608,7 @@ TEST_F(SyncSetupHandlerNonCrosTest, UnrecoverableErrorInitializingSync) {
}
TEST_F(SyncSetupHandlerNonCrosTest, GaiaErrorInitializingSync) {
- EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn())
- .WillRepeatedly(Return(false));
+ EXPECT_CALL(*mock_pss_, CanSyncStart()).WillRepeatedly(Return(false));
EXPECT_CALL(*mock_pss_, IsOAuthRefreshTokenAvailable())
.WillRepeatedly(Return(false));
EXPECT_CALL(*mock_pss_, HasSyncSetupCompleted())
@@ -869,8 +859,7 @@ TEST_F(SyncSetupHandlerTest, ShowSigninOnAuthError) {
FakeAuthStatusProvider provider(
SigninErrorControllerFactory::GetForProfile(profile_.get()));
provider.SetAuthError(kTestUser, error_);
- EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn())
- .WillRepeatedly(Return(true));
+ EXPECT_CALL(*mock_pss_, CanSyncStart()).WillRepeatedly(Return(true));
EXPECT_CALL(*mock_pss_, IsOAuthRefreshTokenAvailable())
.WillRepeatedly(Return(true));
EXPECT_CALL(*mock_pss_, IsPassphraseRequired())

Powered by Google App Engine
This is Rietveld 408576698