| 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 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 // Some negative tests. | 646 // Some negative tests. |
| 647 { "bookmarks", false }, | 647 { "bookmarks", false }, |
| 648 { "cookies", false }, | 648 { "cookies", false }, |
| 649 { "history", false }, | 649 { "history", false }, |
| 650 { "tabs.onUpdated", false }, | 650 { "tabs.onUpdated", false }, |
| 651 // Make sure we find the module name after stripping '.' and '/'. | 651 // Make sure we find the module name after stripping '.' and '/'. |
| 652 { "browserAction/abcd/onClick", true }, | 652 { "browserAction/abcd/onClick", true }, |
| 653 { "browserAction.abcd.onClick", true }, | 653 { "browserAction.abcd.onClick", true }, |
| 654 // Test Tabs functions. | 654 // Test Tabs functions. |
| 655 { "tabs.create", true}, | 655 { "tabs.create", true}, |
| 656 { "tabs.duplicate", true}, |
| 656 { "tabs.update", true}, | 657 { "tabs.update", true}, |
| 657 { "tabs.getSelected", false}, | 658 { "tabs.getSelected", false}, |
| 658 }; | 659 }; |
| 659 | 660 |
| 660 scoped_refptr<PermissionSet> empty = new PermissionSet(); | 661 scoped_refptr<PermissionSet> empty = new PermissionSet(); |
| 661 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTests); ++i) { | 662 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTests); ++i) { |
| 662 EXPECT_EQ(kTests[i].expect_success, | 663 EXPECT_EQ(kTests[i].expect_success, |
| 663 empty->HasAccessToFunction(kTests[i].permission_name)); | 664 empty->HasAccessToFunction(kTests[i].permission_name)); |
| 664 } | 665 } |
| 665 } | 666 } |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1147 apis.insert(APIPermission::kWebRequest); | 1148 apis.insert(APIPermission::kWebRequest); |
| 1148 apis.insert(APIPermission::kFileBrowserHandler); | 1149 apis.insert(APIPermission::kFileBrowserHandler); |
| 1149 EXPECT_EQ(2U, apis.size()); | 1150 EXPECT_EQ(2U, apis.size()); |
| 1150 | 1151 |
| 1151 scoped_refptr<PermissionSet> perm_set; | 1152 scoped_refptr<PermissionSet> perm_set; |
| 1152 perm_set = new PermissionSet(apis, empty_extent, empty_extent); | 1153 perm_set = new PermissionSet(apis, empty_extent, empty_extent); |
| 1153 EXPECT_EQ(4U, perm_set->apis().size()); | 1154 EXPECT_EQ(4U, perm_set->apis().size()); |
| 1154 } | 1155 } |
| 1155 | 1156 |
| 1156 } // namespace extensions | 1157 } // namespace extensions |
| OLD | NEW |