| 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/common/extensions/extension.h" | 5 #include "chrome/common/extensions/extension.h" |
| 6 | 6 |
| 7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/json/json_file_value_serializer.h" | 10 #include "base/json/json_file_value_serializer.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 using extensions::PermissionSet; | 39 using extensions::PermissionSet; |
| 40 using extensions::SocketPermission; | 40 using extensions::SocketPermission; |
| 41 using extensions::SocketPermissionData; | 41 using extensions::SocketPermissionData; |
| 42 | 42 |
| 43 namespace keys = extension_manifest_keys; | 43 namespace keys = extension_manifest_keys; |
| 44 namespace values = extension_manifest_values; | 44 namespace values = extension_manifest_values; |
| 45 namespace errors = extension_manifest_errors; | 45 namespace errors = extension_manifest_errors; |
| 46 | 46 |
| 47 namespace { | 47 namespace { |
| 48 | 48 |
| 49 void CompareLists(const std::vector<std::string>& expected, | 49 scoped_refptr<Extension> LoadManifestUnchecked( |
| 50 const std::vector<std::string>& actual) { | |
| 51 ASSERT_EQ(expected.size(), actual.size()); | |
| 52 | |
| 53 for (size_t i = 0; i < expected.size(); ++i) { | |
| 54 EXPECT_EQ(expected[i], actual[i]); | |
| 55 } | |
| 56 } | |
| 57 | |
| 58 static scoped_refptr<Extension> LoadManifestUnchecked( | |
| 59 const std::string& dir, | 50 const std::string& dir, |
| 60 const std::string& test_file, | 51 const std::string& test_file, |
| 61 Extension::Location location, | 52 Extension::Location location, |
| 62 int extra_flags, | 53 int extra_flags, |
| 63 std::string* error) { | 54 std::string* error) { |
| 64 FilePath path; | 55 FilePath path; |
| 65 PathService::Get(chrome::DIR_TEST_DATA, &path); | 56 PathService::Get(chrome::DIR_TEST_DATA, &path); |
| 66 path = path.AppendASCII("extensions") | 57 path = path.AppendASCII("extensions") |
| 67 .AppendASCII(dir) | 58 .AppendASCII(dir) |
| 68 .AppendASCII(test_file); | 59 .AppendASCII(test_file); |
| (...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1207 | 1198 |
| 1208 TEST(ExtensionTest, GetSyncTypeExtensionWithTwoPlugins) { | 1199 TEST(ExtensionTest, GetSyncTypeExtensionWithTwoPlugins) { |
| 1209 scoped_refptr<Extension> extension( | 1200 scoped_refptr<Extension> extension( |
| 1210 MakeSyncTestExtension(EXTENSION, GURL(), GURL(), | 1201 MakeSyncTestExtension(EXTENSION, GURL(), GURL(), |
| 1211 Extension::INTERNAL, 2, FilePath(), | 1202 Extension::INTERNAL, 2, FilePath(), |
| 1212 Extension::NO_FLAGS)); | 1203 Extension::NO_FLAGS)); |
| 1213 if (extension) | 1204 if (extension) |
| 1214 EXPECT_EQ(extension->GetSyncType(), Extension::SYNC_TYPE_NONE); | 1205 EXPECT_EQ(extension->GetSyncType(), Extension::SYNC_TYPE_NONE); |
| 1215 } | 1206 } |
| 1216 #endif // !defined(OS_CHROMEOS) | 1207 #endif // !defined(OS_CHROMEOS) |
| OLD | NEW |