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

Unified Diff: chrome/browser/extensions/api/web_request/web_request_api_unittest.cc

Issue 10831008: Refactor and fix declarative webRequest API permissions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed license headers Created 8 years, 5 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
Index: chrome/browser/extensions/api/web_request/web_request_api_unittest.cc
diff --git a/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc b/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc
index 7797be5c96ea42695b98c65e316eddef3dba7a62..756566a6df9405f3889b9e6e39493f0073933056 100644
--- a/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc
+++ b/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc
@@ -1487,48 +1487,3 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnAuthRequiredResponses) {
EXPECT_EQ(3u, capturing_net_log.GetSize());
}
-TEST(ExtensionWebRequestHelpersTest, TestHideRequestForURL) {
- MessageLoopForIO message_loop;
- TestURLRequestContext context;
- const char* sensitive_urls[] = {
- "http://www.google.com/chrome",
- "https://www.google.com/chrome",
- "http://www.google.com/chrome/foobar",
- "https://www.google.com/chrome/foobar",
- "http://chrome.google.com",
- "https://chrome.google.com",
- "http://client2.google.com",
- "https://client2.google.com",
- // No http version of webstore.
- "https://chrome.google.com/webstore",
- "http://clients2.google.com/service/update2/crx",
- "https://clients2.google.com/service/update2/crx",
- "http://www.gstatic.com/chrome/extensions/blacklist",
- "https://www.gstatic.com/chrome/extensions/blacklist",
- "notregisteredscheme://www.foobar.com"
- };
- const char* non_sensitive_urls[] = {
- "http://www.google.com/"
- };
- // Check that requests are rejected based on the destination
- for (size_t i = 0; i < arraysize(sensitive_urls); ++i) {
- GURL sensitive_url(sensitive_urls[i]);
- TestURLRequest request(sensitive_url, NULL, &context);
- EXPECT_TRUE(helpers::HideRequest(&request)) << sensitive_urls[i];
- }
- // Check that requests are accepted if they don't touch sensitive urls.
- for (size_t i = 0; i < arraysize(non_sensitive_urls); ++i) {
- GURL non_sensitive_url(non_sensitive_urls[i]);
- TestURLRequest request(non_sensitive_url, NULL, &context);
- EXPECT_FALSE(helpers::HideRequest(&request)) << non_sensitive_urls[i];
- }
- // Check that requests are rejected if their first party url is sensitive.
- ASSERT_GE(arraysize(non_sensitive_urls), 1u);
- GURL non_sensitive_url(non_sensitive_urls[0]);
- for (size_t i = 0; i < arraysize(sensitive_urls); ++i) {
- TestURLRequest request(non_sensitive_url, NULL, &context);
- GURL sensitive_url(sensitive_urls[i]);
- request.set_first_party_for_cookies(sensitive_url);
- EXPECT_TRUE(helpers::HideRequest(&request)) << sensitive_urls[i];
- }
-}

Powered by Google App Engine
This is Rietveld 408576698