OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <shlobj.h> | 8 #include <shlobj.h> |
9 #include <windows.h> | 9 #include <windows.h> |
10 #endif | 10 #endif |
(...skipping 2425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2436 | 2436 |
2437 EXPECT_EQ(0, d.blocked_get_cookies_count()); | 2437 EXPECT_EQ(0, d.blocked_get_cookies_count()); |
2438 EXPECT_EQ(0, d.blocked_set_cookie_count()); | 2438 EXPECT_EQ(0, d.blocked_set_cookie_count()); |
2439 } | 2439 } |
2440 } | 2440 } |
2441 | 2441 |
2442 void CheckCookiePolicyCallback(bool* was_run, const CookieList& cookies) { | 2442 void CheckCookiePolicyCallback(bool* was_run, const CookieList& cookies) { |
2443 EXPECT_EQ(1U, cookies.size()); | 2443 EXPECT_EQ(1U, cookies.size()); |
2444 EXPECT_FALSE(cookies[0].IsPersistent()); | 2444 EXPECT_FALSE(cookies[0].IsPersistent()); |
2445 *was_run = true; | 2445 *was_run = true; |
2446 MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask()); | 2446 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
2447 } | 2447 } |
2448 | 2448 |
2449 TEST_F(URLRequestTest, CookiePolicy_ForceSession) { | 2449 TEST_F(URLRequestTest, CookiePolicy_ForceSession) { |
2450 TestServer test_server(TestServer::TYPE_HTTP, FilePath()); | 2450 TestServer test_server(TestServer::TYPE_HTTP, FilePath()); |
2451 ASSERT_TRUE(test_server.Start()); | 2451 ASSERT_TRUE(test_server.Start()); |
2452 | 2452 |
2453 // Set up a cookie. | 2453 // Set up a cookie. |
2454 { | 2454 { |
2455 TestDelegate d; | 2455 TestDelegate d; |
2456 d.set_cookie_options(TestDelegate::FORCE_SESSION); | 2456 d.set_cookie_options(TestDelegate::FORCE_SESSION); |
(...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3670 req.SetExtraRequestHeaders(headers); | 3670 req.SetExtraRequestHeaders(headers); |
3671 req.Start(); | 3671 req.Start(); |
3672 MessageLoop::current()->Run(); | 3672 MessageLoop::current()->Run(); |
3673 // If the net tests are being run with ChromeFrame then we need to allow for | 3673 // If the net tests are being run with ChromeFrame then we need to allow for |
3674 // the 'chromeframe' suffix which is added to the user agent before the | 3674 // the 'chromeframe' suffix which is added to the user agent before the |
3675 // closing parentheses. | 3675 // closing parentheses. |
3676 EXPECT_TRUE(StartsWithASCII(d.data_received(), "Lynx (textmode", true)); | 3676 EXPECT_TRUE(StartsWithASCII(d.data_received(), "Lynx (textmode", true)); |
3677 } | 3677 } |
3678 | 3678 |
3679 } // namespace net | 3679 } // namespace net |
OLD | NEW |