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

Unified Diff: extensions/browser/api/web_request/web_request_permissions_unittest.cc

Issue 2886573003: Limit protection of clients[0-9]*.google.com to requests from browser. (Closed)
Patch Set: Created 3 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 | « extensions/browser/api/web_request/web_request_permissions.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/web_request/web_request_permissions_unittest.cc
diff --git a/extensions/browser/api/web_request/web_request_permissions_unittest.cc b/extensions/browser/api/web_request/web_request_permissions_unittest.cc
index d8b212d17ff48adcd410c5ceb408467133032d5d..c872e90f3a7d0c7f3d08fe9df1b19c9bb348ebdf 100644
--- a/extensions/browser/api/web_request/web_request_permissions_unittest.cc
+++ b/extensions/browser/api/web_request/web_request_permissions_unittest.cc
@@ -12,28 +12,38 @@ namespace extensions {
TEST(ExtensionWebRequestPermissions, IsSensitiveURL) {
struct TestCase {
const char* url;
- bool is_sensitive;
+ bool is_sensitive_if_request_from_common_renderer;
+ bool is_sensitive_if_request_from_browser_or_webui_renderer;
} cases[] = {
- {"http://www.google.com", false},
- {"http://www.example.com", false},
- {"http://clients.google.com", true},
- {"http://clients4.google.com", true},
- {"http://clients9999.google.com", true},
- {"http://clients9999..google.com", false},
- {"http://clients9999.example.google.com", false},
- {"http://clients.google.com.", true},
- {"http://.clients.google.com.", true},
- {"http://google.example.com", false},
- {"http://www.example.com", false},
- {"http://clients.google.com", true},
- {"http://sb-ssl.google.com", true},
- {"http://sb-ssl.random.google.com", false},
- {"http://chrome.google.com", false},
- {"http://chrome.google.com/webstore", true},
- {"http://chrome.google.com/webstore?query", true},
+ {"http://www.google.com", false, false},
+ {"http://www.example.com", false, false},
+ {"http://clients.google.com", false, true},
+ {"http://clients4.google.com", false, true},
+ {"http://clients9999.google.com", false, true},
+ {"http://clients9999..google.com", false, false},
+ {"http://clients9999.example.google.com", false, false},
+ {"http://clients.google.com.", false, true},
+ {"http://.clients.google.com.", false, true},
+ {"http://google.example.com", false, false},
+ {"http://www.example.com", false, false},
+ {"http://clients.google.com", false, true},
+ {"http://sb-ssl.google.com", true, true},
+ {"http://sb-ssl.random.google.com", false, false},
+ {"http://chrome.google.com", false, false},
+ {"http://chrome.google.com/webstore", true, true},
+ {"http://chrome.google.com/webstore?query", true, true},
};
for (const TestCase& test : cases) {
- EXPECT_EQ(test.is_sensitive, IsSensitiveURL(GURL(test.url))) << test.url;
+ EXPECT_EQ(
+ test.is_sensitive_if_request_from_common_renderer,
+ IsSensitiveURL(GURL(test.url),
+ false /* is_request_from_browser_or_webui_renderer */))
+ << test.url;
+ EXPECT_EQ(
+ test.is_sensitive_if_request_from_browser_or_webui_renderer,
+ IsSensitiveURL(GURL(test.url),
+ true /* is_request_from_browser_or_webui_renderer */))
+ << test.url;
}
}
« no previous file with comments | « extensions/browser/api/web_request/web_request_permissions.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698