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 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
873 TEST_F(SyncSetupHandlerTest, ShowSigninOnAuthError) { | 873 TEST_F(SyncSetupHandlerTest, ShowSigninOnAuthError) { |
874 // Initialize the system to a signed in state, but with an auth error. | 874 // Initialize the system to a signed in state, but with an auth error. |
875 error_ = GoogleServiceAuthError( | 875 error_ = GoogleServiceAuthError( |
876 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS); | 876 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS); |
877 | 877 |
878 SetupInitializedProfileSyncService(); | 878 SetupInitializedProfileSyncService(); |
879 mock_signin_->SetAuthenticatedUsername(kTestUser); | 879 mock_signin_->SetAuthenticatedUsername(kTestUser); |
880 FakeAuthStatusProvider provider( | 880 FakeAuthStatusProvider provider( |
881 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_.get())-> | 881 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_.get())-> |
882 signin_error_controller()); | 882 signin_error_controller()); |
883 provider.SetAuthError(kTestUser, error_); | 883 provider.SetAuthError(kTestUser, kTestUser, error_); |
884 EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn()) | 884 EXPECT_CALL(*mock_pss_, IsSyncEnabledAndLoggedIn()) |
885 .WillRepeatedly(Return(true)); | 885 .WillRepeatedly(Return(true)); |
886 EXPECT_CALL(*mock_pss_, IsOAuthRefreshTokenAvailable()) | 886 EXPECT_CALL(*mock_pss_, IsOAuthRefreshTokenAvailable()) |
887 .WillRepeatedly(Return(true)); | 887 .WillRepeatedly(Return(true)); |
888 EXPECT_CALL(*mock_pss_, IsPassphraseRequired()) | 888 EXPECT_CALL(*mock_pss_, IsPassphraseRequired()) |
889 .WillRepeatedly(Return(false)); | 889 .WillRepeatedly(Return(false)); |
890 EXPECT_CALL(*mock_pss_, IsUsingSecondaryPassphrase()) | 890 EXPECT_CALL(*mock_pss_, IsUsingSecondaryPassphrase()) |
891 .WillRepeatedly(Return(false)); | 891 .WillRepeatedly(Return(false)); |
892 EXPECT_CALL(*mock_pss_, sync_initialized()).WillRepeatedly(Return(false)); | 892 EXPECT_CALL(*mock_pss_, sync_initialized()).WillRepeatedly(Return(false)); |
893 | 893 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1053 | 1053 |
1054 // This should display the sync setup dialog (not login). | 1054 // This should display the sync setup dialog (not login). |
1055 handler_->OpenSyncSetup(); | 1055 handler_->OpenSyncSetup(); |
1056 | 1056 |
1057 ExpectConfig(); | 1057 ExpectConfig(); |
1058 const TestWebUI::CallData& data = web_ui_.call_data()[0]; | 1058 const TestWebUI::CallData& data = web_ui_.call_data()[0]; |
1059 base::DictionaryValue* dictionary; | 1059 base::DictionaryValue* dictionary; |
1060 ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary)); | 1060 ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary)); |
1061 CheckBool(dictionary, "encryptAllData", true); | 1061 CheckBool(dictionary, "encryptAllData", true); |
1062 } | 1062 } |
OLD | NEW |