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

Unified Diff: net/url_request/url_request_unittest.cc

Issue 572273002: Move handling of invalid referrer to the network delegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates Created 6 years, 3 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 | « net/url_request/url_request_test_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_unittest.cc
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index 4efba54ed903a301ef65e0183fac52322de0ec12..06e05b9e3025d31b7eb274a2c4da87bd85d77727 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -1021,6 +1021,21 @@ TEST_F(URLRequestTest, InvalidUrlTest) {
}
}
+TEST_F(URLRequestTest, InvalidReferrerTest) {
+ TestURLRequestContext context;
+ TestNetworkDelegate network_delegate;
+ network_delegate.set_cancel_request_with_policy_violating_referrer(true);
+ context.set_network_delegate(&network_delegate);
+ TestDelegate d;
+ scoped_ptr<URLRequest> req(context.CreateRequest(
+ GURL("http://localhost/"), DEFAULT_PRIORITY, &d, NULL));
+ req->SetReferrer("https://somewhere.com/");
+
+ req->Start();
+ base::RunLoop().Run();
+ EXPECT_TRUE(d.request_failed());
+}
+
#if defined(OS_WIN)
TEST_F(URLRequestTest, ResolveShortcutTest) {
base::FilePath app_path;
« no previous file with comments | « net/url_request/url_request_test_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698