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

Unified Diff: chrome/common/extensions/api/extension_api_unittest.cc

Issue 13604005: Prevent chrome.app JSON schema from loading on every page (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/api/app.json ('k') | chrome/renderer/extensions/chrome_v8_context.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/api/extension_api_unittest.cc
diff --git a/chrome/common/extensions/api/extension_api_unittest.cc b/chrome/common/extensions/api/extension_api_unittest.cc
index f980b576921734fc981cb60086bae8f150a61aa3..f32d451e95275fc1a2cd7254bf4636aac8f73549 100644
--- a/chrome/common/extensions/api/extension_api_unittest.cc
+++ b/chrome/common/extensions/api/extension_api_unittest.cc
@@ -172,10 +172,14 @@ TEST(ExtensionAPI, APIFeatures) {
{ "test2.foo", true, Feature::CONTENT_SCRIPT_CONTEXT, GURL() },
{ "test3", false, Feature::WEB_PAGE_CONTEXT, GURL("http://google.com") },
{ "test3.foo", true, Feature::WEB_PAGE_CONTEXT, GURL("http://google.com") },
- { "test3.foo", true, Feature::BLESSED_EXTENSION_CONTEXT, GURL() },
- { "test4", true, Feature::BLESSED_EXTENSION_CONTEXT, GURL() },
- { "test4.foo", false, Feature::BLESSED_EXTENSION_CONTEXT, GURL() },
- { "test4.foo", false, Feature::UNBLESSED_EXTENSION_CONTEXT, GURL() },
+ { "test3.foo", true, Feature::BLESSED_EXTENSION_CONTEXT,
+ GURL("http://bad.com") },
+ { "test4", true, Feature::BLESSED_EXTENSION_CONTEXT,
+ GURL("http://bad.com") },
+ { "test4.foo", false, Feature::BLESSED_EXTENSION_CONTEXT,
+ GURL("http://bad.com") },
+ { "test4.foo", false, Feature::UNBLESSED_EXTENSION_CONTEXT,
+ GURL("http://bad.com") },
{ "test4.foo.foo", true, Feature::CONTENT_SCRIPT_CONTEXT, GURL() },
{ "test5", true, Feature::WEB_PAGE_CONTEXT, GURL("http://foo.com") },
{ "test5", false, Feature::WEB_PAGE_CONTEXT, GURL("http://bar.com") },
@@ -380,11 +384,12 @@ TEST_F(ExtensionAPITest, URLMatching) {
EXPECT_TRUE(MatchesURL(api.get(), "app", "https://blah.net"));
EXPECT_TRUE(MatchesURL(api.get(), "app", "file://somefile.html"));
- // But not internal URLs (for chrome-extension:// the app API is injected by
- // GetSchemasForExtension).
+ // But not internal URLs.
EXPECT_FALSE(MatchesURL(api.get(), "app", "about:flags"));
EXPECT_FALSE(MatchesURL(api.get(), "app", "chrome://flags"));
- EXPECT_FALSE(MatchesURL(api.get(), "app",
+
+ // "app" should be available to chrome-extension URLs.
+ EXPECT_TRUE(MatchesURL(api.get(), "app",
"chrome-extension://fakeextension"));
// "storage" API (for example) isn't available to any URLs.
« no previous file with comments | « chrome/common/extensions/api/app.json ('k') | chrome/renderer/extensions/chrome_v8_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698