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

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, 3 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 751 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 { "test", true }, 762 { "test", true },
763 // Some negative tests. 763 // Some negative tests.
764 { "bookmarks", false }, 764 { "bookmarks", false },
765 { "cookies", false }, 765 { "cookies", false },
766 { "history", false }, 766 { "history", false },
767 // Make sure we find the module name after stripping '.' and '/'. 767 // Make sure we find the module name after stripping '.' and '/'.
768 { "browserAction/abcd/onClick", true }, 768 { "browserAction/abcd/onClick", true },
769 { "browserAction.abcd.onClick", true }, 769 { "browserAction.abcd.onClick", true },
770 // Test Tabs functions. 770 // Test Tabs functions.
771 { "tabs.create", true}, 771 { "tabs.create", true},
772 { "tabs.duplicate", true},
772 { "tabs.update", true}, 773 { "tabs.update", true},
773 { "tabs.getSelected", true}, 774 { "tabs.getSelected", true},
774 { "tabs.onUpdated", true }, 775 { "tabs.onUpdated", true },
775 }; 776 };
776 777
777 scoped_refptr<PermissionSet> empty = new PermissionSet(); 778 scoped_refptr<PermissionSet> empty = new PermissionSet();
778 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTests); ++i) { 779 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTests); ++i) {
779 EXPECT_EQ(kTests[i].expect_success, 780 EXPECT_EQ(kTests[i].expect_success,
780 empty->HasAccessToFunction(kTests[i].permission_name)) 781 empty->HasAccessToFunction(kTests[i].permission_name))
781 << "Permission being tested: " << kTests[i].permission_name; 782 << "Permission being tested: " << kTests[i].permission_name;
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
1265 apis.insert(APIPermission::kWebRequest); 1266 apis.insert(APIPermission::kWebRequest);
1266 apis.insert(APIPermission::kFileBrowserHandler); 1267 apis.insert(APIPermission::kFileBrowserHandler);
1267 EXPECT_EQ(2U, apis.size()); 1268 EXPECT_EQ(2U, apis.size());
1268 1269
1269 scoped_refptr<PermissionSet> perm_set; 1270 scoped_refptr<PermissionSet> perm_set;
1270 perm_set = new PermissionSet(apis, empty_extent, empty_extent); 1271 perm_set = new PermissionSet(apis, empty_extent, empty_extent);
1271 EXPECT_EQ(4U, perm_set->apis().size()); 1272 EXPECT_EQ(4U, perm_set->apis().size());
1272 } 1273 }
1273 1274
1274 } // namespace extensions 1275 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension_unittest.cc ('k') | chrome/test/data/extensions/api_test/tabs/basics/duplicate.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698