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

Unified Diff: net/url_request/url_request_unittest.cc

Issue 3453021: Immediately reject empty cookie headers. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: updates Created 10 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_http_job.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 c8eaad4f3e3f4706e282cb320cf3d3280d088eb9..9070ef1e20b46aaa7978e17dd4665404c927b7a1 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -1560,6 +1560,26 @@ TEST_F(URLRequestTest, DoNotSaveCookies_ViaPolicy) {
}
}
+TEST_F(URLRequestTest, DoNotSaveEmptyCookies) {
+ net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath());
+ ASSERT_TRUE(test_server.Start());
+
+ scoped_refptr<TestURLRequestContext> context = new TestURLRequestContext();
+
+ // Set up an empty cookie.
+ {
+ TestDelegate d;
+ URLRequest req(test_server.GetURL("set-cookie"), &d);
+ req.set_context(context);
+ req.Start();
+ MessageLoop::current()->Run();
+
+ EXPECT_EQ(0, d.blocked_get_cookies_count());
+ EXPECT_EQ(0, d.blocked_set_cookie_count());
+ EXPECT_EQ(0, d.set_cookie_count());
+ }
+}
+
TEST_F(URLRequestTest, DoNotSendCookies_ViaPolicy_Async) {
net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath());
ASSERT_TRUE(test_server.Start());
« no previous file with comments | « net/url_request/url_request_http_job.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698