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

Unified Diff: chrome/browser/extensions/extension_resource_request_policy_apitest.cc

Issue 8849010: Add 'web_accessible_resource" keyword for version 2 extension manifests. This makes extension res... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years 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 | « no previous file | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_resource_request_policy_apitest.cc
===================================================================
--- chrome/browser/extensions/extension_resource_request_policy_apitest.cc (revision 115399)
+++ chrome/browser/extensions/extension_resource_request_policy_apitest.cc (working copy)
@@ -122,3 +122,46 @@
"extension_resource_request_policy/extension2",
"video.html"));
}
+
+IN_PROC_BROWSER_TEST_F(ExtensionResourceRequestPolicyTest,
+ WebAccessibleResources) {
+ std::string result;
+ ASSERT_TRUE(test_server()->Start());
+ ASSERT_TRUE(LoadExtension(test_data_dir_
+ .AppendASCII("extension_resource_request_policy")
+ .AppendASCII("web_accessible")));
+
+ GURL accessible_resource(
+ test_server()->GetURL(
+ "files/extensions/api_test/extension_resource_request_policy/"
+ "web_accessible/accessible_resource.html"));
+ ui_test_utils::NavigateToURL(browser(), accessible_resource);
+ ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString(
+ browser()->GetSelectedTabContents()->render_view_host(), L"",
+ L"window.domAutomationController.send(document.title)",
+ &result));
+ EXPECT_EQ("Loaded", result);
+
+ GURL nonaccessible_resource(
+ test_server()->GetURL(
+ "files/extensions/api_test/extension_resource_request_policy/"
+ "web_accessible/nonaccessible_resource.html"));
+ ui_test_utils::NavigateToURL(browser(), nonaccessible_resource);
+ ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString(
+ browser()->GetSelectedTabContents()->render_view_host(), L"",
+ L"window.domAutomationController.send(document.title)",
+ &result));
+ EXPECT_EQ("Image failed to load", result);
+
+ GURL nonexistent_resource(
+ test_server()->GetURL(
+ "files/extensions/api_test/extension_resource_request_policy/"
+ "web_accessible/nonexistent_resource.html"));
+ ui_test_utils::NavigateToURL(browser(), nonexistent_resource);
+ ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString(
+ browser()->GetSelectedTabContents()->render_view_host(), L"",
+ L"window.domAutomationController.send(document.title)",
+ &result));
+ EXPECT_EQ("Image failed to load", result);
+}
+
« no previous file with comments | « no previous file | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698