Chromium Code Reviews| 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/extensions/extension_prefs_unittest.h" | 5 #include "chrome/browser/extensions/extension_prefs_unittest.h" |
| 6 | 6 |
| 7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 844 class ExtensionPrefsBlacklistState : public ExtensionPrefsTest { | 844 class ExtensionPrefsBlacklistState : public ExtensionPrefsTest { |
| 845 public: | 845 public: |
| 846 ~ExtensionPrefsBlacklistState() override {} | 846 ~ExtensionPrefsBlacklistState() override {} |
| 847 | 847 |
| 848 void Initialize() override { extension_a_ = prefs_.AddExtension("a"); } | 848 void Initialize() override { extension_a_ = prefs_.AddExtension("a"); } |
| 849 | 849 |
| 850 void Verify() override { | 850 void Verify() override { |
| 851 ExtensionIdSet empty_ids; | 851 ExtensionIdSet empty_ids; |
| 852 EXPECT_EQ(empty_ids, prefs()->GetBlacklistedExtensions()); | 852 EXPECT_EQ(empty_ids, prefs()->GetBlacklistedExtensions()); |
| 853 | 853 |
| 854 prefs()->SetExtensionBlacklisted(extension_a_->id(), true); | 854 prefs()->SetExtensionBlacklistState(extension_a_->id(), |
| 855 extensions::BLACKLISTED_MALWARE); | |
|
Devlin
2016/07/19 16:02:44
here, too
atuchin
2016/07/20 06:02:45
Done.
| |
| 855 EXPECT_EQ(BLACKLISTED_MALWARE, | 856 EXPECT_EQ(BLACKLISTED_MALWARE, |
| 856 prefs()->GetExtensionBlacklistState(extension_a_->id())); | 857 prefs()->GetExtensionBlacklistState(extension_a_->id())); |
| 857 | 858 |
| 858 prefs()->SetExtensionBlacklistState(extension_a_->id(), | 859 prefs()->SetExtensionBlacklistState(extension_a_->id(), |
| 859 BLACKLISTED_POTENTIALLY_UNWANTED); | 860 BLACKLISTED_POTENTIALLY_UNWANTED); |
| 860 EXPECT_EQ(BLACKLISTED_POTENTIALLY_UNWANTED, | 861 EXPECT_EQ(BLACKLISTED_POTENTIALLY_UNWANTED, |
| 861 prefs()->GetExtensionBlacklistState(extension_a_->id())); | 862 prefs()->GetExtensionBlacklistState(extension_a_->id())); |
| 862 EXPECT_FALSE(prefs()->IsExtensionBlacklisted(extension_a_->id())); | 863 EXPECT_FALSE(prefs()->IsExtensionBlacklisted(extension_a_->id())); |
| 863 EXPECT_EQ(empty_ids, prefs()->GetBlacklistedExtensions()); | 864 EXPECT_EQ(empty_ids, prefs()->GetBlacklistedExtensions()); |
| 864 | 865 |
| 865 prefs()->SetExtensionBlacklisted(extension_a_->id(), true); | 866 prefs()->SetExtensionBlacklistState(extension_a_->id(), |
| 867 extensions::BLACKLISTED_MALWARE); | |
| 866 EXPECT_TRUE(prefs()->IsExtensionBlacklisted(extension_a_->id())); | 868 EXPECT_TRUE(prefs()->IsExtensionBlacklisted(extension_a_->id())); |
| 867 EXPECT_EQ(BLACKLISTED_MALWARE, | 869 EXPECT_EQ(BLACKLISTED_MALWARE, |
| 868 prefs()->GetExtensionBlacklistState(extension_a_->id())); | 870 prefs()->GetExtensionBlacklistState(extension_a_->id())); |
| 869 EXPECT_EQ(1u, prefs()->GetBlacklistedExtensions().size()); | 871 EXPECT_EQ(1u, prefs()->GetBlacklistedExtensions().size()); |
| 870 | 872 |
| 871 prefs()->SetExtensionBlacklistState(extension_a_->id(), | 873 prefs()->SetExtensionBlacklistState(extension_a_->id(), |
| 872 NOT_BLACKLISTED); | 874 NOT_BLACKLISTED); |
| 873 EXPECT_EQ(NOT_BLACKLISTED, | 875 EXPECT_EQ(NOT_BLACKLISTED, |
| 874 prefs()->GetExtensionBlacklistState(extension_a_->id())); | 876 prefs()->GetExtensionBlacklistState(extension_a_->id())); |
| 875 EXPECT_FALSE(prefs()->IsExtensionBlacklisted(extension_a_->id())); | 877 EXPECT_FALSE(prefs()->IsExtensionBlacklisted(extension_a_->id())); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 990 | 992 |
| 991 private: | 993 private: |
| 992 std::unique_ptr<const PermissionSet> active_perms_; | 994 std::unique_ptr<const PermissionSet> active_perms_; |
| 993 scoped_refptr<Extension> component_extension_; | 995 scoped_refptr<Extension> component_extension_; |
| 994 scoped_refptr<Extension> no_component_extension_; | 996 scoped_refptr<Extension> no_component_extension_; |
| 995 }; | 997 }; |
| 996 TEST_F(ExtensionPrefsComponentExtension, ExtensionPrefsComponentExtension) { | 998 TEST_F(ExtensionPrefsComponentExtension, ExtensionPrefsComponentExtension) { |
| 997 } | 999 } |
| 998 | 1000 |
| 999 } // namespace extensions | 1001 } // namespace extensions |
| OLD | NEW |