OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <utility> | 5 #include <utility> |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
10 #include <windows.h> | 10 #include <windows.h> |
(...skipping 2233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2244 LocalHttpTestServer() { AddDefaultHandlers(base::FilePath()); } | 2244 LocalHttpTestServer() { AddDefaultHandlers(base::FilePath()); } |
2245 }; | 2245 }; |
2246 | 2246 |
2247 } // namespace | 2247 } // namespace |
2248 | 2248 |
2249 TEST_F(URLRequestTest, DelayedCookieCallback) { | 2249 TEST_F(URLRequestTest, DelayedCookieCallback) { |
2250 LocalHttpTestServer test_server; | 2250 LocalHttpTestServer test_server; |
2251 ASSERT_TRUE(test_server.Start()); | 2251 ASSERT_TRUE(test_server.Start()); |
2252 | 2252 |
2253 TestURLRequestContext context; | 2253 TestURLRequestContext context; |
2254 scoped_refptr<DelayedCookieMonster> delayed_cm = | 2254 scoped_ptr<DelayedCookieMonster> delayed_cm(new DelayedCookieMonster()); |
2255 new DelayedCookieMonster(); | |
2256 scoped_refptr<CookieStore> cookie_store = delayed_cm; | |
2257 context.set_cookie_store(delayed_cm.get()); | 2255 context.set_cookie_store(delayed_cm.get()); |
2258 | 2256 |
2259 // Set up a cookie. | 2257 // Set up a cookie. |
2260 { | 2258 { |
2261 TestNetworkDelegate network_delegate; | 2259 TestNetworkDelegate network_delegate; |
2262 context.set_network_delegate(&network_delegate); | 2260 context.set_network_delegate(&network_delegate); |
2263 TestDelegate d; | 2261 TestDelegate d; |
2264 scoped_ptr<URLRequest> req(context.CreateRequest( | 2262 scoped_ptr<URLRequest> req(context.CreateRequest( |
2265 test_server.GetURL("/set-cookie?CookieToNotSend=1"), DEFAULT_PRIORITY, | 2263 test_server.GetURL("/set-cookie?CookieToNotSend=1"), DEFAULT_PRIORITY, |
2266 &d)); | 2264 &d)); |
(...skipping 7628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9895 AddTestInterceptor()->set_main_intercept_job(std::move(job)); | 9893 AddTestInterceptor()->set_main_intercept_job(std::move(job)); |
9896 | 9894 |
9897 req->Start(); | 9895 req->Start(); |
9898 req->Cancel(); | 9896 req->Cancel(); |
9899 base::RunLoop().RunUntilIdle(); | 9897 base::RunLoop().RunUntilIdle(); |
9900 EXPECT_EQ(URLRequestStatus::CANCELED, req->status().status()); | 9898 EXPECT_EQ(URLRequestStatus::CANCELED, req->status().status()); |
9901 EXPECT_EQ(0, d.received_redirect_count()); | 9899 EXPECT_EQ(0, d.received_redirect_count()); |
9902 } | 9900 } |
9903 | 9901 |
9904 } // namespace net | 9902 } // namespace net |
OLD | NEW |