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

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

Issue 2007133004: Disallow navigation to documents not explicitly listed as web accessible. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix issues from code review. Created 4 years, 7 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_resource_request_policy_apitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_protocols_unittest.cc
diff --git a/chrome/browser/extensions/extension_protocols_unittest.cc b/chrome/browser/extensions/extension_protocols_unittest.cc
index 511e8b0138503f4220983ab7f198d487ccdee896..96cd5f4867749c423348f61e009944ee0381d7b6 100644
--- a/chrome/browser/extensions/extension_protocols_unittest.cc
+++ b/chrome/browser/extensions/extension_protocols_unittest.cc
@@ -198,8 +198,8 @@ TEST_F(ExtensionProtocolTest, IncognitoRequest) {
} cases[] = {
{"spanning disabled", false, false, false, false},
{"split disabled", true, false, false, false},
- {"spanning enabled", false, true, false, true},
- {"split enabled", true, true, true, true},
+ {"spanning enabled", false, true, false, false},
+ {"split enabled", true, true, true, false},
};
for (size_t i = 0; i < arraysize(cases); ++i) {
@@ -346,7 +346,9 @@ TEST_F(ExtensionProtocolTest, AllowFrameRequests) {
false,
false);
- // All MAIN_FRAME and SUB_FRAME requests should succeed.
+ // All MAIN_FRAME requests should succeed. SUB_FRAME requests that are not
+ // explicitly listed in web_accesible_resources or same-origin to the parent
+ // should not succeed.
{
std::unique_ptr<net::URLRequest> request(
resource_context_.GetRequestContext()->CreateRequest(
@@ -361,7 +363,7 @@ TEST_F(ExtensionProtocolTest, AllowFrameRequests) {
extension->GetResourceURL("test.dat"), net::DEFAULT_PRIORITY,
&test_delegate_));
StartRequest(request.get(), content::RESOURCE_TYPE_SUB_FRAME);
- EXPECT_EQ(net::URLRequestStatus::SUCCESS, request->status().status());
+ EXPECT_EQ(net::URLRequestStatus::FAILED, request->status().status());
}
// And subresource types, such as media, should fail.
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_resource_request_policy_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698