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/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
915 }; | 915 }; |
916 TEST_F(ExtensionPrefsClearLastLaunched, ExtensionPrefsClearLastLaunched) {} | 916 TEST_F(ExtensionPrefsClearLastLaunched, ExtensionPrefsClearLastLaunched) {} |
917 | 917 |
918 class ExtensionPrefsComponentExtension : public ExtensionPrefsTest { | 918 class ExtensionPrefsComponentExtension : public ExtensionPrefsTest { |
919 public: | 919 public: |
920 ~ExtensionPrefsComponentExtension() override {} | 920 ~ExtensionPrefsComponentExtension() override {} |
921 void Initialize() override { | 921 void Initialize() override { |
922 // Adding a component extension. | 922 // Adding a component extension. |
923 component_extension_ = | 923 component_extension_ = |
924 ExtensionBuilder() | 924 ExtensionBuilder() |
925 .SetManifest(std::move(DictionaryBuilder() | 925 .SetManifest(DictionaryBuilder() |
926 .Set(manifest_keys::kName, "a") | 926 .Set(manifest_keys::kName, "a") |
927 .Set(manifest_keys::kVersion, "0.1"))) | 927 .Set(manifest_keys::kVersion, "0.1") |
| 928 .Build()) |
928 .SetLocation(Manifest::COMPONENT) | 929 .SetLocation(Manifest::COMPONENT) |
929 .SetPath(prefs_.extensions_dir().AppendASCII("a")) | 930 .SetPath(prefs_.extensions_dir().AppendASCII("a")) |
930 .Build(); | 931 .Build(); |
931 prefs_.AddExtension(component_extension_.get()); | 932 prefs_.AddExtension(component_extension_.get()); |
932 | 933 |
933 // Adding a non component extension. | 934 // Adding a non component extension. |
934 no_component_extension_ = | 935 no_component_extension_ = |
935 ExtensionBuilder() | 936 ExtensionBuilder() |
936 .SetManifest(std::move(DictionaryBuilder() | 937 .SetManifest(DictionaryBuilder() |
937 .Set(manifest_keys::kName, "b") | 938 .Set(manifest_keys::kName, "b") |
938 .Set(manifest_keys::kVersion, "0.1"))) | 939 .Set(manifest_keys::kVersion, "0.1") |
| 940 .Build()) |
939 .SetLocation(Manifest::INTERNAL) | 941 .SetLocation(Manifest::INTERNAL) |
940 .SetPath(prefs_.extensions_dir().AppendASCII("b")) | 942 .SetPath(prefs_.extensions_dir().AppendASCII("b")) |
941 .Build(); | 943 .Build(); |
942 prefs_.AddExtension(no_component_extension_.get()); | 944 prefs_.AddExtension(no_component_extension_.get()); |
943 | 945 |
944 APIPermissionSet api_perms; | 946 APIPermissionSet api_perms; |
945 api_perms.insert(APIPermission::kTab); | 947 api_perms.insert(APIPermission::kTab); |
946 api_perms.insert(APIPermission::kBookmark); | 948 api_perms.insert(APIPermission::kBookmark); |
947 api_perms.insert(APIPermission::kHistory); | 949 api_perms.insert(APIPermission::kHistory); |
948 | 950 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
987 | 989 |
988 private: | 990 private: |
989 scoped_ptr<const PermissionSet> active_perms_; | 991 scoped_ptr<const PermissionSet> active_perms_; |
990 scoped_refptr<Extension> component_extension_; | 992 scoped_refptr<Extension> component_extension_; |
991 scoped_refptr<Extension> no_component_extension_; | 993 scoped_refptr<Extension> no_component_extension_; |
992 }; | 994 }; |
993 TEST_F(ExtensionPrefsComponentExtension, ExtensionPrefsComponentExtension) { | 995 TEST_F(ExtensionPrefsComponentExtension, ExtensionPrefsComponentExtension) { |
994 } | 996 } |
995 | 997 |
996 } // namespace extensions | 998 } // namespace extensions |
OLD | NEW |