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

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

Issue 11745015: Update references to the extension messaging APIs to point to the "runtime" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 11 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/api/extension_api.h" 5 #include "chrome/common/extensions/api/extension_api.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 &feature_name); 90 &feature_name);
91 EXPECT_EQ(test_data[i].expected_feature_type, feature_type) << i; 91 EXPECT_EQ(test_data[i].expected_feature_type, feature_type) << i;
92 EXPECT_EQ(test_data[i].expected_feature_name, feature_name) << i; 92 EXPECT_EQ(test_data[i].expected_feature_name, feature_name) << i;
93 } 93 }
94 } 94 }
95 95
96 TEST(ExtensionAPI, IsPrivileged) { 96 TEST(ExtensionAPI, IsPrivileged) {
97 scoped_ptr<ExtensionAPI> extension_api( 97 scoped_ptr<ExtensionAPI> extension_api(
98 ExtensionAPI::CreateWithDefaultConfiguration()); 98 ExtensionAPI::CreateWithDefaultConfiguration());
99 99
100 EXPECT_FALSE(extension_api->IsPrivileged("extension.connect")); 100 EXPECT_FALSE(extension_api->IsPrivileged("runtime.connect"));
101 EXPECT_FALSE(extension_api->IsPrivileged("extension.onConnect")); 101 EXPECT_FALSE(extension_api->IsPrivileged("runtime.onConnect"));
102 102
103 // Properties are not supported yet. 103 // Properties are not supported yet.
104 EXPECT_TRUE(extension_api->IsPrivileged("extension.lastError")); 104 EXPECT_TRUE(extension_api->IsPrivileged("runtime.lastError"));
105 105
106 // Default unknown names to privileged for paranoia's sake. 106 // Default unknown names to privileged for paranoia's sake.
107 EXPECT_TRUE(extension_api->IsPrivileged("")); 107 EXPECT_TRUE(extension_api->IsPrivileged(""));
108 EXPECT_TRUE(extension_api->IsPrivileged("<unknown-namespace>")); 108 EXPECT_TRUE(extension_api->IsPrivileged("<unknown-namespace>"));
109 EXPECT_TRUE(extension_api->IsPrivileged("extension.<unknown-member>")); 109 EXPECT_TRUE(extension_api->IsPrivileged("extension.<unknown-member>"));
110 110
111 // Exists, but privileged. 111 // Exists, but privileged.
112 EXPECT_TRUE(extension_api->IsPrivileged("extension.getViews")); 112 EXPECT_TRUE(extension_api->IsPrivileged("extension.getViews"));
113 EXPECT_TRUE(extension_api->IsPrivileged("history.search")); 113 EXPECT_TRUE(extension_api->IsPrivileged("history.search"));
114 114
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 GetDictionaryFromList(dict, "parameters", 0, &sub_dict); 482 GetDictionaryFromList(dict, "parameters", 0, &sub_dict);
483 EXPECT_TRUE(sub_dict->GetString("$ref", &type)); 483 EXPECT_TRUE(sub_dict->GetString("$ref", &type));
484 EXPECT_EQ("test.foo.TestType", type); 484 EXPECT_EQ("test.foo.TestType", type);
485 GetDictionaryFromList(dict, "parameters", 1, &sub_dict); 485 GetDictionaryFromList(dict, "parameters", 1, &sub_dict);
486 EXPECT_TRUE(sub_dict->GetString("$ref", &type)); 486 EXPECT_TRUE(sub_dict->GetString("$ref", &type));
487 EXPECT_EQ("fully.qualified.Type", type); 487 EXPECT_EQ("fully.qualified.Type", type);
488 } 488 }
489 489
490 } // namespace 490 } // namespace
491 } // namespace extensions 491 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/extension.json ('k') | chrome/common/extensions/api/file_browser_private.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698