Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(782)

Side by Side Diff: chrome/common/extensions/permissions/permission_set_unittest.cc

Issue 10697017: Tabs Extension: Implementation of tabs.duplicate api. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698