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

Side by Side Diff: chrome/browser/ui/webui/settings/people_handler_unittest.cc

Issue 2068653003: Settings People Revamp: Add Payments integration to new Sync Settings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 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 unified diff | Download patch
OLDNEW
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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 // Add all of our data types. 89 // Add all of our data types.
90 result.SetBoolean("appsSynced", types.Has(syncer::APPS)); 90 result.SetBoolean("appsSynced", types.Has(syncer::APPS));
91 result.SetBoolean("autofillSynced", types.Has(syncer::AUTOFILL)); 91 result.SetBoolean("autofillSynced", types.Has(syncer::AUTOFILL));
92 result.SetBoolean("bookmarksSynced", types.Has(syncer::BOOKMARKS)); 92 result.SetBoolean("bookmarksSynced", types.Has(syncer::BOOKMARKS));
93 result.SetBoolean("extensionsSynced", types.Has(syncer::EXTENSIONS)); 93 result.SetBoolean("extensionsSynced", types.Has(syncer::EXTENSIONS));
94 result.SetBoolean("passwordsSynced", types.Has(syncer::PASSWORDS)); 94 result.SetBoolean("passwordsSynced", types.Has(syncer::PASSWORDS));
95 result.SetBoolean("preferencesSynced", types.Has(syncer::PREFERENCES)); 95 result.SetBoolean("preferencesSynced", types.Has(syncer::PREFERENCES));
96 result.SetBoolean("tabsSynced", types.Has(syncer::PROXY_TABS)); 96 result.SetBoolean("tabsSynced", types.Has(syncer::PROXY_TABS));
97 result.SetBoolean("themesSynced", types.Has(syncer::THEMES)); 97 result.SetBoolean("themesSynced", types.Has(syncer::THEMES));
98 result.SetBoolean("typedUrlsSynced", types.Has(syncer::TYPED_URLS)); 98 result.SetBoolean("typedUrlsSynced", types.Has(syncer::TYPED_URLS));
99 result.SetBoolean("paymentsIntegrationEnabled", false);
99 std::string args; 100 std::string args;
100 base::JSONWriter::Write(result, &args); 101 base::JSONWriter::Write(result, &args);
101 return args; 102 return args;
102 } 103 }
103 104
104 // Checks whether the passed |dictionary| contains a |key| with the given 105 // Checks whether the passed |dictionary| contains a |key| with the given
105 // |expected_value|. If |omit_if_false| is true, then the value should only 106 // |expected_value|. If |omit_if_false| is true, then the value should only
106 // be present if |expected_value| is true. 107 // be present if |expected_value| is true.
107 void CheckBool(const base::DictionaryValue* dictionary, 108 void CheckBool(const base::DictionaryValue* dictionary,
108 const std::string& key, 109 const std::string& key,
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 CheckBool(dictionary, "syncAllDataTypes", true); 762 CheckBool(dictionary, "syncAllDataTypes", true);
762 CheckBool(dictionary, "appsRegistered", true); 763 CheckBool(dictionary, "appsRegistered", true);
763 CheckBool(dictionary, "autofillRegistered", true); 764 CheckBool(dictionary, "autofillRegistered", true);
764 CheckBool(dictionary, "bookmarksRegistered", true); 765 CheckBool(dictionary, "bookmarksRegistered", true);
765 CheckBool(dictionary, "extensionsRegistered", true); 766 CheckBool(dictionary, "extensionsRegistered", true);
766 CheckBool(dictionary, "passwordsRegistered", true); 767 CheckBool(dictionary, "passwordsRegistered", true);
767 CheckBool(dictionary, "preferencesRegistered", true); 768 CheckBool(dictionary, "preferencesRegistered", true);
768 CheckBool(dictionary, "tabsRegistered", true); 769 CheckBool(dictionary, "tabsRegistered", true);
769 CheckBool(dictionary, "themesRegistered", true); 770 CheckBool(dictionary, "themesRegistered", true);
770 CheckBool(dictionary, "typedUrlsRegistered", true); 771 CheckBool(dictionary, "typedUrlsRegistered", true);
772 CheckBool(dictionary, "paymentsIntegrationEnabled", true);
771 CheckBool(dictionary, "passphraseRequired", false); 773 CheckBool(dictionary, "passphraseRequired", false);
772 CheckBool(dictionary, "passphraseTypeIsCustom", false); 774 CheckBool(dictionary, "passphraseTypeIsCustom", false);
773 CheckBool(dictionary, "encryptAllData", false); 775 CheckBool(dictionary, "encryptAllData", false);
774 CheckConfigDataTypeArguments(dictionary, SYNC_ALL_DATA, GetAllTypes()); 776 CheckConfigDataTypeArguments(dictionary, SYNC_ALL_DATA, GetAllTypes());
775 } 777 }
776 778
777 TEST_F(PeopleHandlerTest, ShowSetupManuallySyncAll) { 779 TEST_F(PeopleHandlerTest, ShowSetupManuallySyncAll) {
778 EXPECT_CALL(*mock_pss_, IsPassphraseRequired()) 780 EXPECT_CALL(*mock_pss_, IsPassphraseRequired())
779 .WillRepeatedly(Return(false)); 781 .WillRepeatedly(Return(false));
780 EXPECT_CALL(*mock_pss_, IsUsingSecondaryPassphrase()) 782 EXPECT_CALL(*mock_pss_, IsUsingSecondaryPassphrase())
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
902 SetupInitializedProfileSyncService(); 904 SetupInitializedProfileSyncService();
903 EXPECT_CALL(*mock_pss_, IsEncryptEverythingAllowed()) 905 EXPECT_CALL(*mock_pss_, IsEncryptEverythingAllowed())
904 .WillRepeatedly(Return(false)); 906 .WillRepeatedly(Return(false));
905 EXPECT_CALL(*mock_pss_, EnableEncryptEverything()).Times(0); 907 EXPECT_CALL(*mock_pss_, EnableEncryptEverything()).Times(0);
906 handler_->HandleSetEncryption(&list_args); 908 handler_->HandleSetEncryption(&list_args);
907 909
908 ExpectPageStatusResponse(PeopleHandler::kConfigurePageStatus); 910 ExpectPageStatusResponse(PeopleHandler::kConfigurePageStatus);
909 } 911 }
910 912
911 } // namespace settings 913 } // namespace settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698