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_permission_set.h" | 5 #include "chrome/common/extensions/extension_permission_set.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/json/json_file_value_serializer.h" | 8 #include "base/json/json_file_value_serializer.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
12 #include "chrome/common/chrome_paths.h" | 12 #include "chrome/common/chrome_paths.h" |
13 #include "chrome/common/chrome_switches.h" | 13 #include "chrome/common/chrome_switches.h" |
14 #include "chrome/common/extensions/extension.h" | 14 #include "chrome/common/extensions/extension.h" |
15 #include "chrome/common/extensions/extension_manifest_constants.h" | 15 #include "chrome/common/extensions/extension_manifest_constants.h" |
16 #include "chrome/common/extensions/extension_error_utils.h" | 16 #include "chrome/common/extensions/extension_error_utils.h" |
17 #include "chrome/common/extensions/extension_permission_set.h" | 17 #include "chrome/common/extensions/extension_permission_set.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
19 | 19 |
| 20 using extensions::Extension; |
| 21 |
20 namespace errors = extension_manifest_errors; | 22 namespace errors = extension_manifest_errors; |
21 namespace keys = extension_manifest_keys; | 23 namespace keys = extension_manifest_keys; |
22 namespace values = extension_manifest_values; | 24 namespace values = extension_manifest_values; |
23 namespace { | 25 namespace { |
24 | 26 |
25 static scoped_refptr<Extension> LoadManifest(const std::string& dir, | 27 static scoped_refptr<Extension> LoadManifest(const std::string& dir, |
26 const std::string& test_file, | 28 const std::string& test_file, |
27 int extra_flags) { | 29 int extra_flags) { |
28 FilePath path; | 30 FilePath path; |
29 PathService::Get(chrome::DIR_TEST_DATA, &path); | 31 PathService::Get(chrome::DIR_TEST_DATA, &path); |
(...skipping 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1097 AddPattern(&non_empty_extent, "http://www.google.com/*"); | 1099 AddPattern(&non_empty_extent, "http://www.google.com/*"); |
1098 | 1100 |
1099 perm_set = new ExtensionPermissionSet( | 1101 perm_set = new ExtensionPermissionSet( |
1100 empty_apis, non_empty_extent, empty_extent); | 1102 empty_apis, non_empty_extent, empty_extent); |
1101 EXPECT_FALSE(perm_set->IsEmpty()); | 1103 EXPECT_FALSE(perm_set->IsEmpty()); |
1102 | 1104 |
1103 perm_set = new ExtensionPermissionSet( | 1105 perm_set = new ExtensionPermissionSet( |
1104 empty_apis, empty_extent, non_empty_extent); | 1106 empty_apis, empty_extent, non_empty_extent); |
1105 EXPECT_FALSE(perm_set->IsEmpty()); | 1107 EXPECT_FALSE(perm_set->IsEmpty()); |
1106 } | 1108 } |
OLD | NEW |