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

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

Issue 10693073: Revert 145136 - Merge 144529 - Use the first_party_for_cookies URL to filter which requests the Web… (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1180/src/
Patch Set: Created 8 years, 6 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 | « chrome/browser/extensions/api/web_request/web_request_api_helpers.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/web_request/web_request_api_unittest.cc
===================================================================
--- chrome/browser/extensions/api/web_request/web_request_api_unittest.cc (revision 145167)
+++ chrome/browser/extensions/api/web_request/web_request_api_unittest.cc (working copy)
@@ -1485,8 +1485,6 @@
}
TEST(ExtensionWebRequestHelpersTest, TestHideRequestForURL) {
- MessageLoopForIO message_loop;
- TestURLRequestContext context;
const char* sensitive_urls[] = {
"http://www.google.com/chrome",
"https://www.google.com/chrome",
@@ -1507,25 +1505,12 @@
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];
+ EXPECT_TRUE(helpers::HideRequestForURL(GURL(sensitive_urls[i])))
+ << 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];
+ EXPECT_FALSE(helpers::HideRequestForURL(GURL(non_sensitive_urls[i])))
+ << 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];
- }
}
« no previous file with comments | « chrome/browser/extensions/api/web_request/web_request_api_helpers.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698