OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/webui/options/sync_setup_handler.h" | 5 #include "chrome/browser/ui/webui/options/sync_setup_handler.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
861 // We do not display signin on chromeos in the case of auth error. | 861 // We do not display signin on chromeos in the case of auth error. |
862 TEST_F(SyncSetupHandlerTest, ShowSigninOnAuthError) { | 862 TEST_F(SyncSetupHandlerTest, ShowSigninOnAuthError) { |
863 // Initialize the system to a signed in state, but with an auth error. | 863 // Initialize the system to a signed in state, but with an auth error. |
864 error_ = GoogleServiceAuthError( | 864 error_ = GoogleServiceAuthError( |
865 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS); | 865 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS); |
866 | 866 |
867 SetupInitializedProfileSyncService(); | 867 SetupInitializedProfileSyncService(); |
868 mock_signin_->SetAuthenticatedAccountInfo(kTestUser, kTestUser); | 868 mock_signin_->SetAuthenticatedAccountInfo(kTestUser, kTestUser); |
869 FakeAuthStatusProvider provider( | 869 FakeAuthStatusProvider provider( |
870 SigninErrorControllerFactory::GetForProfile(profile_.get())); | 870 SigninErrorControllerFactory::GetForProfile(profile_.get())); |
871 provider.SetAuthError(kTestUser, kTestUser, error_); | 871 provider.SetAuthError(kTestUser, error_); |
872 EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn()) | 872 EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn()) |
873 .WillRepeatedly(Return(true)); | 873 .WillRepeatedly(Return(true)); |
874 EXPECT_CALL(*mock_pss_, IsOAuthRefreshTokenAvailable()) | 874 EXPECT_CALL(*mock_pss_, IsOAuthRefreshTokenAvailable()) |
875 .WillRepeatedly(Return(true)); | 875 .WillRepeatedly(Return(true)); |
876 EXPECT_CALL(*mock_pss_, IsPassphraseRequired()) | 876 EXPECT_CALL(*mock_pss_, IsPassphraseRequired()) |
877 .WillRepeatedly(Return(false)); | 877 .WillRepeatedly(Return(false)); |
878 EXPECT_CALL(*mock_pss_, IsUsingSecondaryPassphrase()) | 878 EXPECT_CALL(*mock_pss_, IsUsingSecondaryPassphrase()) |
879 .WillRepeatedly(Return(false)); | 879 .WillRepeatedly(Return(false)); |
880 EXPECT_CALL(*mock_pss_, backend_initialized()).WillRepeatedly(Return(false)); | 880 EXPECT_CALL(*mock_pss_, backend_initialized()).WillRepeatedly(Return(false)); |
881 | 881 |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1084 WillRepeatedly(Return(false)); | 1084 WillRepeatedly(Return(false)); |
1085 EXPECT_CALL(*mock_pss_, EnableEncryptEverything()).Times(0); | 1085 EXPECT_CALL(*mock_pss_, EnableEncryptEverything()).Times(0); |
1086 EXPECT_CALL(*mock_pss_, OnUserChoseDatatypes(true, _)); | 1086 EXPECT_CALL(*mock_pss_, OnUserChoseDatatypes(true, _)); |
1087 handler_->HandleConfigure(&list_args); | 1087 handler_->HandleConfigure(&list_args); |
1088 | 1088 |
1089 // Ensure that we navigated to the "done" state since we don't need a | 1089 // Ensure that we navigated to the "done" state since we don't need a |
1090 // passphrase. | 1090 // passphrase. |
1091 ExpectDone(); | 1091 ExpectDone(); |
1092 } | 1092 } |
1093 | 1093 |
OLD | NEW |