| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/settings/people_handler.h" | 5 #include "chrome/browser/ui/webui/settings/people_handler.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 780 CheckBool(dictionary, "encryptAllData", false); | 780 CheckBool(dictionary, "encryptAllData", false); |
| 781 CheckConfigDataTypeArguments(dictionary, SYNC_ALL_DATA, GetAllTypes()); | 781 CheckConfigDataTypeArguments(dictionary, SYNC_ALL_DATA, GetAllTypes()); |
| 782 } | 782 } |
| 783 | 783 |
| 784 TEST_F(PeopleHandlerTest, ShowSetupManuallySyncAll) { | 784 TEST_F(PeopleHandlerTest, ShowSetupManuallySyncAll) { |
| 785 EXPECT_CALL(*mock_pss_, IsPassphraseRequired()) | 785 EXPECT_CALL(*mock_pss_, IsPassphraseRequired()) |
| 786 .WillRepeatedly(Return(false)); | 786 .WillRepeatedly(Return(false)); |
| 787 EXPECT_CALL(*mock_pss_, IsUsingSecondaryPassphrase()) | 787 EXPECT_CALL(*mock_pss_, IsUsingSecondaryPassphrase()) |
| 788 .WillRepeatedly(Return(false)); | 788 .WillRepeatedly(Return(false)); |
| 789 SetupInitializedProfileSyncService(); | 789 SetupInitializedProfileSyncService(); |
| 790 sync_driver::SyncPrefs sync_prefs(profile_->GetPrefs()); | 790 syncer::SyncPrefs sync_prefs(profile_->GetPrefs()); |
| 791 sync_prefs.SetKeepEverythingSynced(false); | 791 sync_prefs.SetKeepEverythingSynced(false); |
| 792 SetDefaultExpectationsForConfigPage(); | 792 SetDefaultExpectationsForConfigPage(); |
| 793 // This should display the sync setup dialog (not login). | 793 // This should display the sync setup dialog (not login). |
| 794 handler_->OpenSyncSetup(false /* creating_supervised_user */); | 794 handler_->OpenSyncSetup(false /* creating_supervised_user */); |
| 795 | 795 |
| 796 const base::DictionaryValue* dictionary = ExpectSyncPrefsChanged(); | 796 const base::DictionaryValue* dictionary = ExpectSyncPrefsChanged(); |
| 797 CheckConfigDataTypeArguments(dictionary, CHOOSE_WHAT_TO_SYNC, GetAllTypes()); | 797 CheckConfigDataTypeArguments(dictionary, CHOOSE_WHAT_TO_SYNC, GetAllTypes()); |
| 798 } | 798 } |
| 799 | 799 |
| 800 TEST_F(PeopleHandlerTest, ShowSetupSyncForAllTypesIndividually) { | 800 TEST_F(PeopleHandlerTest, ShowSetupSyncForAllTypesIndividually) { |
| 801 syncer::ModelTypeSet user_selectable_types = GetAllTypes(); | 801 syncer::ModelTypeSet user_selectable_types = GetAllTypes(); |
| 802 syncer::ModelTypeSet::Iterator it; | 802 syncer::ModelTypeSet::Iterator it; |
| 803 for (it = user_selectable_types.First(); it.Good(); it.Inc()) { | 803 for (it = user_selectable_types.First(); it.Good(); it.Inc()) { |
| 804 EXPECT_CALL(*mock_pss_, IsPassphraseRequired()) | 804 EXPECT_CALL(*mock_pss_, IsPassphraseRequired()) |
| 805 .WillRepeatedly(Return(false)); | 805 .WillRepeatedly(Return(false)); |
| 806 EXPECT_CALL(*mock_pss_, IsUsingSecondaryPassphrase()) | 806 EXPECT_CALL(*mock_pss_, IsUsingSecondaryPassphrase()) |
| 807 .WillRepeatedly(Return(false)); | 807 .WillRepeatedly(Return(false)); |
| 808 SetupInitializedProfileSyncService(); | 808 SetupInitializedProfileSyncService(); |
| 809 sync_driver::SyncPrefs sync_prefs(profile_->GetPrefs()); | 809 syncer::SyncPrefs sync_prefs(profile_->GetPrefs()); |
| 810 sync_prefs.SetKeepEverythingSynced(false); | 810 sync_prefs.SetKeepEverythingSynced(false); |
| 811 SetDefaultExpectationsForConfigPage(); | 811 SetDefaultExpectationsForConfigPage(); |
| 812 syncer::ModelTypeSet types; | 812 syncer::ModelTypeSet types; |
| 813 types.Put(it.Get()); | 813 types.Put(it.Get()); |
| 814 EXPECT_CALL(*mock_pss_, GetPreferredDataTypes()). | 814 EXPECT_CALL(*mock_pss_, GetPreferredDataTypes()). |
| 815 WillRepeatedly(Return(types)); | 815 WillRepeatedly(Return(types)); |
| 816 | 816 |
| 817 // This should display the sync setup dialog (not login). | 817 // This should display the sync setup dialog (not login). |
| 818 handler_->OpenSyncSetup(false /* creating_supervised_user */); | 818 handler_->OpenSyncSetup(false /* creating_supervised_user */); |
| 819 | 819 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 910 SetupInitializedProfileSyncService(); | 910 SetupInitializedProfileSyncService(); |
| 911 EXPECT_CALL(*mock_pss_, IsEncryptEverythingAllowed()) | 911 EXPECT_CALL(*mock_pss_, IsEncryptEverythingAllowed()) |
| 912 .WillRepeatedly(Return(false)); | 912 .WillRepeatedly(Return(false)); |
| 913 EXPECT_CALL(*mock_pss_, EnableEncryptEverything()).Times(0); | 913 EXPECT_CALL(*mock_pss_, EnableEncryptEverything()).Times(0); |
| 914 handler_->HandleSetEncryption(&list_args); | 914 handler_->HandleSetEncryption(&list_args); |
| 915 | 915 |
| 916 ExpectPageStatusResponse(PeopleHandler::kConfigurePageStatus); | 916 ExpectPageStatusResponse(PeopleHandler::kConfigurePageStatus); |
| 917 } | 917 } |
| 918 | 918 |
| 919 } // namespace settings | 919 } // namespace settings |
| OLD | NEW |