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

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

Issue 3121003: Allow chrome:// pages to load extension resources (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: fyi, added test Created 10 years, 4 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 | « no previous file | chrome/browser/extensions/extension_protocols.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_browsertests_misc.cc
diff --git a/chrome/browser/extensions/extension_browsertests_misc.cc b/chrome/browser/extensions/extension_browsertests_misc.cc
index 200e39d46d64434b970195eed53249614c7f3bc0..e25dfb48028b88a1772d833792258b09f7489db8 100644
--- a/chrome/browser/extensions/extension_browsertests_misc.cc
+++ b/chrome/browser/extensions/extension_browsertests_misc.cc
@@ -184,6 +184,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, OriginPrivileges) {
ASSERT_TRUE(LoadExtension(test_data_dir_
.AppendASCII("origin_privileges").AppendASCII("extension")));
+ // A web host that has permission.
ui_test_utils::NavigateToURL(browser(),
GURL("http://a.com:1337/files/extensions/origin_privileges/index.html"));
std::string result;
@@ -193,6 +194,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, OriginPrivileges) {
&result);
EXPECT_EQ(result, "Loaded");
+ // A web host that does not have permission.
ui_test_utils::NavigateToURL(browser(),
GURL("http://b.com:1337/files/extensions/origin_privileges/index.html"));
ui_test_utils::ExecuteJavaScriptAndExtractString(
@@ -200,6 +202,19 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, OriginPrivileges) {
L"window.domAutomationController.send(document.title)",
&result);
EXPECT_EQ(result, "Image failed to load");
+
+ // A different extension. Extensions should always be able to load each
+ // other's resources.
+ ASSERT_TRUE(LoadExtension(test_data_dir_
+ .AppendASCII("origin_privileges").AppendASCII("extension2")));
+ ui_test_utils::NavigateToURL(
+ browser(),
+ GURL("chrome-extension://pbkkcbgdkliohhfaeefcijaghglkahja/index.html"));
+ ui_test_utils::ExecuteJavaScriptAndExtractString(
+ browser()->GetSelectedTabContents()->render_view_host(), L"",
+ L"window.domAutomationController.send(document.title)",
+ &result);
+ EXPECT_EQ(result, "Loaded");
}
// Tests that we can load extension pages into the tab area and they can call
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_protocols.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698