| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/json/json_file_value_serializer.h" | 6 #include "base/json/json_file_value_serializer.h" |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/common/chrome_paths.h" | 10 #include "chrome/common/chrome_paths.h" |
| (...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 // Platform apps. | 728 // Platform apps. |
| 729 skip.insert(APIPermission::kFileSystem); | 729 skip.insert(APIPermission::kFileSystem); |
| 730 skip.insert(APIPermission::kSocket); | 730 skip.insert(APIPermission::kSocket); |
| 731 | 731 |
| 732 PermissionsInfo* info = PermissionsInfo::GetInstance(); | 732 PermissionsInfo* info = PermissionsInfo::GetInstance(); |
| 733 APIPermissionSet permissions = info->GetAll(); | 733 APIPermissionSet permissions = info->GetAll(); |
| 734 for (APIPermissionSet::const_iterator i = permissions.begin(); | 734 for (APIPermissionSet::const_iterator i = permissions.begin(); |
| 735 i != permissions.end(); ++i) { | 735 i != permissions.end(); ++i) { |
| 736 const APIPermissionInfo* permission_info = i->info(); | 736 const APIPermissionInfo* permission_info = i->info(); |
| 737 EXPECT_TRUE(permission_info != NULL); | 737 EXPECT_TRUE(permission_info != NULL); |
| 738 |
| 739 // Always skip permissions that cannot be in the manifest. |
| 740 scoped_ptr<const APIPermission> permission( |
| 741 permission_info->CreateAPIPermission()); |
| 742 if (permission->ManifestEntryForbidden()) |
| 743 continue; |
| 744 |
| 738 if (skip.count(i->id())) { | 745 if (skip.count(i->id())) { |
| 739 EXPECT_EQ(PermissionMessage::kNone, permission_info->message_id()) | 746 EXPECT_EQ(PermissionMessage::kNone, permission_info->message_id()) |
| 740 << "unexpected message_id for " << permission_info->name(); | 747 << "unexpected message_id for " << permission_info->name(); |
| 741 } else { | 748 } else { |
| 742 EXPECT_NE(PermissionMessage::kNone, permission_info->message_id()) | 749 EXPECT_NE(PermissionMessage::kNone, permission_info->message_id()) |
| 743 << "missing message_id for " << permission_info->name(); | 750 << "missing message_id for " << permission_info->name(); |
| 744 } | 751 } |
| 745 } | 752 } |
| 746 } | 753 } |
| 747 | 754 |
| (...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1343 apis.insert(APIPermission::kWebRequest); | 1350 apis.insert(APIPermission::kWebRequest); |
| 1344 apis.insert(APIPermission::kFileBrowserHandler); | 1351 apis.insert(APIPermission::kFileBrowserHandler); |
| 1345 EXPECT_EQ(2U, apis.size()); | 1352 EXPECT_EQ(2U, apis.size()); |
| 1346 | 1353 |
| 1347 scoped_refptr<PermissionSet> perm_set; | 1354 scoped_refptr<PermissionSet> perm_set; |
| 1348 perm_set = new PermissionSet(apis, empty_extent, empty_extent); | 1355 perm_set = new PermissionSet(apis, empty_extent, empty_extent); |
| 1349 EXPECT_EQ(4U, perm_set->apis().size()); | 1356 EXPECT_EQ(4U, perm_set->apis().size()); |
| 1350 } | 1357 } |
| 1351 | 1358 |
| 1352 } // namespace extensions | 1359 } // namespace extensions |
| OLD | NEW |