| 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 <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 // navigations. | 536 // navigations. |
| 537 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, CookiePolicy) { | 537 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, CookiePolicy) { |
| 538 embedded_test_server()->RegisterRequestHandler( | 538 embedded_test_server()->RegisterRequestHandler( |
| 539 base::Bind(&HandleRedirectRequest, "/redirect?")); | 539 base::Bind(&HandleRedirectRequest, "/redirect?")); |
| 540 ASSERT_TRUE(embedded_test_server()->Start()); | 540 ASSERT_TRUE(embedded_test_server()->Start()); |
| 541 | 541 |
| 542 std::string set_cookie_url(base::StringPrintf( | 542 std::string set_cookie_url(base::StringPrintf( |
| 543 "http://localhost:%u/set_cookie.html", embedded_test_server()->port())); | 543 "http://localhost:%u/set_cookie.html", embedded_test_server()->port())); |
| 544 GURL url(embedded_test_server()->GetURL("/redirect?" + set_cookie_url)); | 544 GURL url(embedded_test_server()->GetURL("/redirect?" + set_cookie_url)); |
| 545 | 545 |
| 546 ShellContentBrowserClient::SetSwapProcessesForRedirect(true); | 546 ShellContentBrowserClient::SetTransferAllNavigations(true); |
| 547 ShellNetworkDelegate::SetBlockThirdPartyCookies(true); | 547 ShellNetworkDelegate::SetBlockThirdPartyCookies(true); |
| 548 | 548 |
| 549 CheckTitleTest(url, "cookie set"); | 549 CheckTitleTest(url, "cookie set"); |
| 550 } | 550 } |
| 551 | 551 |
| 552 class PageTransitionResourceDispatcherHostDelegate | 552 class PageTransitionResourceDispatcherHostDelegate |
| 553 : public ResourceDispatcherHostDelegate { | 553 : public ResourceDispatcherHostDelegate { |
| 554 public: | 554 public: |
| 555 PageTransitionResourceDispatcherHostDelegate(GURL watch_url) | 555 PageTransitionResourceDispatcherHostDelegate(GURL watch_url) |
| 556 : watch_url_(watch_url) {} | 556 : watch_url_(watch_url) {} |
| (...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1137 EXPECT_EQ(top_origin, delegate_->data()[2]->initiator); | 1137 EXPECT_EQ(top_origin, delegate_->data()[2]->initiator); |
| 1138 | 1138 |
| 1139 // Cross-origin subresource requests have a unique first-party, and an | 1139 // Cross-origin subresource requests have a unique first-party, and an |
| 1140 // initiator that matches the document in which they're embedded. | 1140 // initiator that matches the document in which they're embedded. |
| 1141 EXPECT_EQ(nested_js_url, delegate_->data()[3]->url); | 1141 EXPECT_EQ(nested_js_url, delegate_->data()[3]->url); |
| 1142 EXPECT_EQ(kURLWithUniqueOrigin, delegate_->data()[3]->first_party); | 1142 EXPECT_EQ(kURLWithUniqueOrigin, delegate_->data()[3]->first_party); |
| 1143 EXPECT_EQ(nested_origin, delegate_->data()[3]->initiator); | 1143 EXPECT_EQ(nested_origin, delegate_->data()[3]->initiator); |
| 1144 } | 1144 } |
| 1145 | 1145 |
| 1146 } // namespace content | 1146 } // namespace content |
| OLD | NEW |