OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_management.h" | 5 #include "chrome/browser/extensions/extension_management.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 APIPermissionSet GetBlockedAPIPermissionsByUpdateUrl( | 146 APIPermissionSet GetBlockedAPIPermissionsByUpdateUrl( |
147 const std::string& update_url) { | 147 const std::string& update_url) { |
148 return GetBlockedAPIPermissions(kNonExistingExtension, update_url); | 148 return GetBlockedAPIPermissions(kNonExistingExtension, update_url); |
149 } | 149 } |
150 | 150 |
151 void SetExampleDictPref() { | 151 void SetExampleDictPref() { |
152 std::string error_msg; | 152 std::string error_msg; |
153 std::unique_ptr<base::Value> parsed = base::JSONReader::ReadAndReturnError( | 153 std::unique_ptr<base::Value> parsed = base::JSONReader::ReadAndReturnError( |
154 kExampleDictPreference, | 154 kExampleDictPreference, |
155 base::JSONParserOptions::JSON_ALLOW_TRAILING_COMMAS, NULL, &error_msg); | 155 base::JSONParserOptions::JSON_ALLOW_TRAILING_COMMAS, NULL, &error_msg); |
156 ASSERT_TRUE(parsed && parsed->IsType(base::Value::TYPE_DICTIONARY)) | 156 ASSERT_TRUE(parsed && parsed->IsType(base::Value::Type::DICTIONARY)) |
157 << error_msg; | 157 << error_msg; |
158 SetPref(true, pref_names::kExtensionManagement, parsed.release()); | 158 SetPref(true, pref_names::kExtensionManagement, parsed.release()); |
159 } | 159 } |
160 | 160 |
161 // Wrapper of ExtensionManagement::GetInstallationMode, |id| and | 161 // Wrapper of ExtensionManagement::GetInstallationMode, |id| and |
162 // |update_url| are used to construct an Extension for testing. | 162 // |update_url| are used to construct an Extension for testing. |
163 ExtensionManagement::InstallationMode GetInstallationMode( | 163 ExtensionManagement::InstallationMode GetInstallationMode( |
164 const std::string& id, | 164 const std::string& id, |
165 const std::string& update_url) { | 165 const std::string& update_url) { |
166 scoped_refptr<const Extension> extension = | 166 scoped_refptr<const Extension> extension = |
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 EXPECT_FALSE(error.empty()); | 874 EXPECT_FALSE(error.empty()); |
875 | 875 |
876 CreateExtension(Manifest::INTERNAL); | 876 CreateExtension(Manifest::INTERNAL); |
877 error.clear(); | 877 error.clear(); |
878 EXPECT_FALSE(MustRemainEnabled(extension_.get(), NULL)); | 878 EXPECT_FALSE(MustRemainEnabled(extension_.get(), NULL)); |
879 EXPECT_FALSE(MustRemainEnabled(extension_.get(), &error)); | 879 EXPECT_FALSE(MustRemainEnabled(extension_.get(), &error)); |
880 EXPECT_TRUE(error.empty()); | 880 EXPECT_TRUE(error.empty()); |
881 } | 881 } |
882 | 882 |
883 } // namespace extensions | 883 } // namespace extensions |
OLD | NEW |