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

Side by Side Diff: chrome/common/extensions/api/extension_api_unittest.cc

Issue 8540012: Enable extension APIs for content scripts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 1 month 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
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/common/extensions/api/extension_api.h"
6
7 #include "testing/gtest/include/gtest/gtest.h"
8
9 using extensions::ExtensionAPI;
10
11 TEST(ExtensionAPI, IsPrivileged) {
12 ExtensionAPI* extension_api = ExtensionAPI::GetInstance();
13 EXPECT_FALSE(extension_api->IsPrivileged("extension.connect"));
14 EXPECT_FALSE(extension_api->IsPrivileged("extension.onConnect"));
15
16 // Properties are not supported yet.
17 EXPECT_TRUE(extension_api->IsPrivileged("extension.lastError"));
18
19 // Default unknown names to privileged for paranoia's sake.
20 EXPECT_TRUE(extension_api->IsPrivileged(""));
21 EXPECT_TRUE(extension_api->IsPrivileged("<unknown-namespace>"));
22 EXPECT_TRUE(extension_api->IsPrivileged("extension.<unknown-member>"));
23
24 // Exists, but privileged.
25 EXPECT_TRUE(extension_api->IsPrivileged("extension.getViews"));
26 EXPECT_TRUE(extension_api->IsPrivileged("history.search"));
27 }
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/extension_api.json ('k') | chrome/common/extensions/extension_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698