| 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 "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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |