| 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/sync_setup_handler.h" | 5 #include "chrome/browser/ui/webui/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 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 860 TEST_F(SyncSetupHandlerTest, ShowSigninOnAuthError) { | 860 TEST_F(SyncSetupHandlerTest, ShowSigninOnAuthError) { |
| 861 // Initialize the system to a signed in state, but with an auth error. | 861 // Initialize the system to a signed in state, but with an auth error. |
| 862 error_ = GoogleServiceAuthError( | 862 error_ = GoogleServiceAuthError( |
| 863 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS); | 863 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS); |
| 864 | 864 |
| 865 SetupInitializedProfileSyncService(); | 865 SetupInitializedProfileSyncService(); |
| 866 mock_signin_->SetAuthenticatedUsername(kTestUser); | 866 mock_signin_->SetAuthenticatedUsername(kTestUser); |
| 867 FakeAuthStatusProvider provider( | 867 FakeAuthStatusProvider provider( |
| 868 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_.get())-> | 868 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_.get())-> |
| 869 signin_error_controller()); | 869 signin_error_controller()); |
| 870 provider.SetAuthError(kTestUser, error_); | 870 provider.SetAuthError(kTestUser, kTestUser, error_); |
| 871 EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn()) | 871 EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn()) |
| 872 .WillRepeatedly(Return(true)); | 872 .WillRepeatedly(Return(true)); |
| 873 EXPECT_CALL(*mock_pss_, IsOAuthRefreshTokenAvailable()) | 873 EXPECT_CALL(*mock_pss_, IsOAuthRefreshTokenAvailable()) |
| 874 .WillRepeatedly(Return(true)); | 874 .WillRepeatedly(Return(true)); |
| 875 EXPECT_CALL(*mock_pss_, IsPassphraseRequired()) | 875 EXPECT_CALL(*mock_pss_, IsPassphraseRequired()) |
| 876 .WillRepeatedly(Return(false)); | 876 .WillRepeatedly(Return(false)); |
| 877 EXPECT_CALL(*mock_pss_, IsUsingSecondaryPassphrase()) | 877 EXPECT_CALL(*mock_pss_, IsUsingSecondaryPassphrase()) |
| 878 .WillRepeatedly(Return(false)); | 878 .WillRepeatedly(Return(false)); |
| 879 EXPECT_CALL(*mock_pss_, sync_initialized()).WillRepeatedly(Return(false)); | 879 EXPECT_CALL(*mock_pss_, sync_initialized()).WillRepeatedly(Return(false)); |
| 880 | 880 |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1040 | 1040 |
| 1041 // This should display the sync setup dialog (not login). | 1041 // This should display the sync setup dialog (not login). |
| 1042 handler_->OpenSyncSetup(); | 1042 handler_->OpenSyncSetup(); |
| 1043 | 1043 |
| 1044 ExpectConfig(); | 1044 ExpectConfig(); |
| 1045 const TestWebUI::CallData& data = web_ui_.call_data()[0]; | 1045 const TestWebUI::CallData& data = web_ui_.call_data()[0]; |
| 1046 base::DictionaryValue* dictionary; | 1046 base::DictionaryValue* dictionary; |
| 1047 ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary)); | 1047 ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary)); |
| 1048 CheckBool(dictionary, "encryptAllData", true); | 1048 CheckBool(dictionary, "encryptAllData", true); |
| 1049 } | 1049 } |
| OLD | NEW |