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

Side by Side Diff: net/url_request/url_request_unittest.cc

Issue 1773133002: SameSite: Implement 'Strict'/'Lax' attribute parsing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mmenke@ Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « net/extras/sqlite/sqlite_persistent_cookie_store_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2646 matching lines...) Expand 10 before | Expand all | Expand 10 after
2657 2657
2658 TestNetworkDelegate network_delegate; 2658 TestNetworkDelegate network_delegate;
2659 network_delegate.set_experimental_cookie_features_enabled(true); 2659 network_delegate.set_experimental_cookie_features_enabled(true);
2660 default_context_.set_network_delegate(&network_delegate); 2660 default_context_.set_network_delegate(&network_delegate);
2661 2661
2662 // Set up a 'SameSite' cookie (on '127.0.0.1', as that's where 2662 // Set up a 'SameSite' cookie (on '127.0.0.1', as that's where
2663 // LocalHttpTestServer points). 2663 // LocalHttpTestServer points).
2664 { 2664 {
2665 TestDelegate d; 2665 TestDelegate d;
2666 scoped_ptr<URLRequest> req(default_context_.CreateRequest( 2666 scoped_ptr<URLRequest> req(default_context_.CreateRequest(
2667 test_server.GetURL("/set-cookie?SameSiteCookieToSet=1;SameSite"), 2667 test_server.GetURL("/set-cookie?SameSiteCookieToSet=1;SameSite=Strict"),
2668 DEFAULT_PRIORITY, &d)); 2668 DEFAULT_PRIORITY, &d));
2669 req->Start(); 2669 req->Start();
2670 base::RunLoop().Run(); 2670 base::RunLoop().Run();
2671 EXPECT_EQ(0, network_delegate.blocked_get_cookies_count()); 2671 EXPECT_EQ(0, network_delegate.blocked_get_cookies_count());
2672 EXPECT_EQ(0, network_delegate.blocked_set_cookie_count()); 2672 EXPECT_EQ(0, network_delegate.blocked_set_cookie_count());
2673 EXPECT_EQ(1, network_delegate.set_cookie_count()); 2673 EXPECT_EQ(1, network_delegate.set_cookie_count());
2674 } 2674 }
2675 2675
2676 // Verify that the cookie is sent for same-site requests. 2676 // Verify that the cookie is sent for same-site requests.
2677 { 2677 {
(...skipping 7337 matching lines...) Expand 10 before | Expand all | Expand 10 after
10015 AddTestInterceptor()->set_main_intercept_job(std::move(job)); 10015 AddTestInterceptor()->set_main_intercept_job(std::move(job));
10016 10016
10017 req->Start(); 10017 req->Start();
10018 req->Cancel(); 10018 req->Cancel();
10019 base::RunLoop().RunUntilIdle(); 10019 base::RunLoop().RunUntilIdle();
10020 EXPECT_EQ(URLRequestStatus::CANCELED, req->status().status()); 10020 EXPECT_EQ(URLRequestStatus::CANCELED, req->status().status());
10021 EXPECT_EQ(0, d.received_redirect_count()); 10021 EXPECT_EQ(0, d.received_redirect_count());
10022 } 10022 }
10023 10023
10024 } // namespace net 10024 } // namespace net
OLDNEW
« no previous file with comments | « net/extras/sqlite/sqlite_persistent_cookie_store_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698