Index: chrome/common/extensions/extension_manifests_unittest.cc |
=================================================================== |
--- chrome/common/extensions/extension_manifests_unittest.cc (revision 113054) |
+++ chrome/common/extensions/extension_manifests_unittest.cc (working copy) |
@@ -876,6 +876,40 @@ |
Extension::INTERNAL, Extension::STRICT_ERROR_CHECKS); |
} |
+TEST_F(ExtensionManifestTest, WebAccessibleResources) { |
+ // Manifest version 2 with web accessible resources specified. |
+ scoped_refptr<Extension> extension1( |
+ LoadAndExpectSuccess("web_accessible_resources_1.json")); |
+ |
+ // Manifest version 2 with no web accessible resources. |
+ scoped_refptr<Extension> extension2( |
+ LoadAndExpectSuccess("web_accessible_resources_2.json")); |
+ |
+ // Default manifest version with web accessible resources specified. |
+ scoped_refptr<Extension> extension3( |
+ LoadAndExpectSuccess("web_accessible_resources_3.json")); |
+ |
+ // Default manifest version with no web accessible resources. |
+ scoped_refptr<Extension> extension4( |
+ LoadAndExpectSuccess("web_accessible_resources_4.json")); |
+ |
+ EXPECT_TRUE(extension1->HasWebAccessibleResources()); |
+ EXPECT_FALSE(extension2->HasWebAccessibleResources()); |
+ EXPECT_TRUE(extension3->HasWebAccessibleResources()); |
+ EXPECT_FALSE(extension4->HasWebAccessibleResources()); |
+ |
+ EXPECT_TRUE(extension1->IsResourceWebAccessible("/test")); |
+ EXPECT_FALSE(extension1->IsResourceWebAccessible("/none")); |
+ |
+ EXPECT_FALSE(extension2->IsResourceWebAccessible("/test")); |
+ |
+ EXPECT_TRUE(extension3->IsResourceWebAccessible("/test")); |
+ EXPECT_FALSE(extension3->IsResourceWebAccessible("/none")); |
+ |
+ EXPECT_TRUE(extension4->IsResourceWebAccessible("/test")); |
+ EXPECT_TRUE(extension4->IsResourceWebAccessible("/none")); |
+} |
+ |
TEST_F(ExtensionManifestTest, IsolatedApps) { |
// Requires --enable-experimental-extension-apis |
LoadAndExpectError("isolated_app_valid.json", |