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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 1674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1685 // Simulate a custodian approval for enabling the extension coming in | 1685 // Simulate a custodian approval for enabling the extension coming in |
1686 // through Sync by adding the approved version to the map of approved | 1686 // through Sync by adding the approved version to the map of approved |
1687 // extensions. It doesn't simulate a change in the disable reasons. | 1687 // extensions. It doesn't simulate a change in the disable reasons. |
1688 void SimulateCustodianApprovalChangeViaSync(const std::string& extension_id, | 1688 void SimulateCustodianApprovalChangeViaSync(const std::string& extension_id, |
1689 const std::string& version, | 1689 const std::string& version, |
1690 SyncChange::SyncChangeType type) { | 1690 SyncChange::SyncChangeType type) { |
1691 std::string key = SupervisedUserSettingsService::MakeSplitSettingKey( | 1691 std::string key = SupervisedUserSettingsService::MakeSplitSettingKey( |
1692 supervised_users::kApprovedExtensions, extension_id); | 1692 supervised_users::kApprovedExtensions, extension_id); |
1693 syncer::SyncData sync_data = | 1693 syncer::SyncData sync_data = |
1694 SupervisedUserSettingsService::CreateSyncDataForSetting( | 1694 SupervisedUserSettingsService::CreateSyncDataForSetting( |
1695 key, base::StringValue(version)); | 1695 key, base::Value(version)); |
1696 | 1696 |
1697 SyncChangeList list(1, SyncChange(FROM_HERE, type, sync_data)); | 1697 SyncChangeList list(1, SyncChange(FROM_HERE, type, sync_data)); |
1698 | 1698 |
1699 SupervisedUserSettingsService* supervised_user_settings_service = | 1699 SupervisedUserSettingsService* supervised_user_settings_service = |
1700 SupervisedUserSettingsServiceFactory::GetForProfile(profile()); | 1700 SupervisedUserSettingsServiceFactory::GetForProfile(profile()); |
1701 supervised_user_settings_service->ProcessSyncChanges(FROM_HERE, list); | 1701 supervised_user_settings_service->ProcessSyncChanges(FROM_HERE, list); |
1702 } | 1702 } |
1703 | 1703 |
1704 void CheckDisabledForCustodianApproval(const std::string& extension_id) { | 1704 void CheckDisabledForCustodianApproval(const std::string& extension_id) { |
1705 EXPECT_TRUE(registry()->disabled_extensions().Contains(extension_id)); | 1705 EXPECT_TRUE(registry()->disabled_extensions().Contains(extension_id)); |
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2465 break; | 2465 break; |
2466 } | 2466 } |
2467 } | 2467 } |
2468 } | 2468 } |
2469 EXPECT_TRUE(found_delete); | 2469 EXPECT_TRUE(found_delete); |
2470 | 2470 |
2471 // Make sure there is one extension, and there are no more apps. | 2471 // Make sure there is one extension, and there are no more apps. |
2472 EXPECT_EQ(1u, extensions_processor.data().size()); | 2472 EXPECT_EQ(1u, extensions_processor.data().size()); |
2473 EXPECT_TRUE(apps_processor.data().empty()); | 2473 EXPECT_TRUE(apps_processor.data().empty()); |
2474 } | 2474 } |
OLD | NEW |