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

Side by Side Diff: chrome/common/extensions/extension_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, 5 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 "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"
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 // Some negative tests. 675 // Some negative tests.
676 { "bookmarks", false }, 676 { "bookmarks", false },
677 { "cookies", false }, 677 { "cookies", false },
678 { "history", false }, 678 { "history", false },
679 { "tabs.onUpdated", false }, 679 { "tabs.onUpdated", false },
680 // Make sure we find the module name after stripping '.' and '/'. 680 // Make sure we find the module name after stripping '.' and '/'.
681 { "browserAction/abcd/onClick", true }, 681 { "browserAction/abcd/onClick", true },
682 { "browserAction.abcd.onClick", true }, 682 { "browserAction.abcd.onClick", true },
683 // Test Tabs functions. 683 // Test Tabs functions.
684 { "tabs.create", true}, 684 { "tabs.create", true},
685 { "tabs.duplicate", true},
685 { "tabs.update", true}, 686 { "tabs.update", true},
686 { "tabs.getSelected", false}, 687 { "tabs.getSelected", false},
687 }; 688 };
688 689
689 scoped_refptr<ExtensionPermissionSet> empty = new ExtensionPermissionSet(); 690 scoped_refptr<ExtensionPermissionSet> empty = new ExtensionPermissionSet();
690 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTests); ++i) { 691 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTests); ++i) {
691 EXPECT_EQ(kTests[i].expect_success, 692 EXPECT_EQ(kTests[i].expect_success,
692 empty->HasAccessToFunction(kTests[i].permission_name)); 693 empty->HasAccessToFunction(kTests[i].permission_name));
693 } 694 }
694 } 695 }
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 AddPattern(&non_empty_extent, "http://www.google.com/*"); 1151 AddPattern(&non_empty_extent, "http://www.google.com/*");
1151 1152
1152 perm_set = new ExtensionPermissionSet( 1153 perm_set = new ExtensionPermissionSet(
1153 empty_apis, non_empty_extent, empty_extent); 1154 empty_apis, non_empty_extent, empty_extent);
1154 EXPECT_FALSE(perm_set->IsEmpty()); 1155 EXPECT_FALSE(perm_set->IsEmpty());
1155 1156
1156 perm_set = new ExtensionPermissionSet( 1157 perm_set = new ExtensionPermissionSet(
1157 empty_apis, empty_extent, non_empty_extent); 1158 empty_apis, empty_extent, non_empty_extent);
1158 EXPECT_FALSE(perm_set->IsEmpty()); 1159 EXPECT_FALSE(perm_set->IsEmpty());
1159 } 1160 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698