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

Side by Side Diff: content/browser/loader/resource_dispatcher_host_browsertest.cc

Issue 2125523003: Rename setAlwaysAcceptCookies to setBlockThirdPartyCookies (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 5 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
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 "content/public/browser/resource_dispatcher_host.h" 5 #include "content/public/browser/resource_dispatcher_host.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, CookiePolicy) { 482 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, CookiePolicy) {
483 ASSERT_TRUE(embedded_test_server()->Start()); 483 ASSERT_TRUE(embedded_test_server()->Start());
484 embedded_test_server()->RegisterRequestHandler( 484 embedded_test_server()->RegisterRequestHandler(
485 base::Bind(&HandleRedirectRequest, "/redirect?")); 485 base::Bind(&HandleRedirectRequest, "/redirect?"));
486 486
487 std::string set_cookie_url(base::StringPrintf( 487 std::string set_cookie_url(base::StringPrintf(
488 "http://localhost:%u/set_cookie.html", embedded_test_server()->port())); 488 "http://localhost:%u/set_cookie.html", embedded_test_server()->port()));
489 GURL url(embedded_test_server()->GetURL("/redirect?" + set_cookie_url)); 489 GURL url(embedded_test_server()->GetURL("/redirect?" + set_cookie_url));
490 490
491 ShellContentBrowserClient::SetSwapProcessesForRedirect(true); 491 ShellContentBrowserClient::SetSwapProcessesForRedirect(true);
492 ShellNetworkDelegate::SetAcceptAllCookies(false); 492 ShellNetworkDelegate::SetBlockThirdPartyCookies(true);
493 493
494 CheckTitleTest(url, "cookie set"); 494 CheckTitleTest(url, "cookie set");
495 } 495 }
496 496
497 class PageTransitionResourceDispatcherHostDelegate 497 class PageTransitionResourceDispatcherHostDelegate
498 : public ResourceDispatcherHostDelegate { 498 : public ResourceDispatcherHostDelegate {
499 public: 499 public:
500 PageTransitionResourceDispatcherHostDelegate(GURL watch_url) 500 PageTransitionResourceDispatcherHostDelegate(GURL watch_url)
501 : watch_url_(watch_url) {} 501 : watch_url_(watch_url) {}
502 502
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 EXPECT_EQ(top_origin, delegate_->data()[2]->initiator); 989 EXPECT_EQ(top_origin, delegate_->data()[2]->initiator);
990 990
991 // Cross-origin subresource requests have a unique first-party, and an 991 // Cross-origin subresource requests have a unique first-party, and an
992 // initiator that matches the document in which they're embedded. 992 // initiator that matches the document in which they're embedded.
993 EXPECT_EQ(nested_js_url, delegate_->data()[3]->url); 993 EXPECT_EQ(nested_js_url, delegate_->data()[3]->url);
994 EXPECT_EQ(kURLWithUniqueOrigin, delegate_->data()[3]->first_party); 994 EXPECT_EQ(kURLWithUniqueOrigin, delegate_->data()[3]->first_party);
995 EXPECT_EQ(nested_origin, delegate_->data()[3]->initiator); 995 EXPECT_EQ(nested_origin, delegate_->data()[3]->initiator);
996 } 996 }
997 997
998 } // namespace content 998 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/download_browsertest.cc ('k') | content/shell/browser/layout_test/layout_test_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698