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 "base/memory/ref_counted.h" | 5 #include "base/memory/ref_counted.h" |
6 #include "base/strings/string_util.h" | 6 #include "base/strings/string_util.h" |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "content/browser/download/download_manager_impl.h" | 9 #include "content/browser/download/download_manager_impl.h" |
10 #include "content/browser/web_contents/web_contents_impl.h" | 10 #include "content/browser/web_contents/web_contents_impl.h" |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 } // namespace | 459 } // namespace |
460 | 460 |
461 // Test that we update the cookie policy URLs correctly when transferring | 461 // Test that we update the cookie policy URLs correctly when transferring |
462 // navigations. | 462 // navigations. |
463 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, CookiePolicy) { | 463 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, CookiePolicy) { |
464 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 464 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
465 embedded_test_server()->RegisterRequestHandler( | 465 embedded_test_server()->RegisterRequestHandler( |
466 base::Bind(&HandleRedirectRequest, "/redirect?")); | 466 base::Bind(&HandleRedirectRequest, "/redirect?")); |
467 | 467 |
468 std::string set_cookie_url(base::StringPrintf( | 468 std::string set_cookie_url(base::StringPrintf( |
469 "http://localhost:%d/set_cookie.html", embedded_test_server()->port())); | 469 "http://localhost:%u/set_cookie.html", embedded_test_server()->port())); |
470 GURL url(embedded_test_server()->GetURL("/redirect?" + set_cookie_url)); | 470 GURL url(embedded_test_server()->GetURL("/redirect?" + set_cookie_url)); |
471 | 471 |
472 ShellContentBrowserClient::SetSwapProcessesForRedirect(true); | 472 ShellContentBrowserClient::SetSwapProcessesForRedirect(true); |
473 ShellNetworkDelegate::SetAcceptAllCookies(false); | 473 ShellNetworkDelegate::SetAcceptAllCookies(false); |
474 | 474 |
475 CheckTitleTest(url, "cookie set"); | 475 CheckTitleTest(url, "cookie set"); |
476 } | 476 } |
477 | 477 |
478 class PageTransitionResourceDispatcherHostDelegate | 478 class PageTransitionResourceDispatcherHostDelegate |
479 : public ResourceDispatcherHostDelegate { | 479 : public ResourceDispatcherHostDelegate { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 NavigateToURLBlockUntilNavigationsComplete( | 514 NavigateToURLBlockUntilNavigationsComplete( |
515 shell(), | 515 shell(), |
516 embedded_test_server()->GetURL("/client_redirect.html"), | 516 embedded_test_server()->GetURL("/client_redirect.html"), |
517 2); | 517 2); |
518 | 518 |
519 EXPECT_TRUE( | 519 EXPECT_TRUE( |
520 delegate.page_transition() & ui::PAGE_TRANSITION_CLIENT_REDIRECT); | 520 delegate.page_transition() & ui::PAGE_TRANSITION_CLIENT_REDIRECT); |
521 } | 521 } |
522 | 522 |
523 } // namespace content | 523 } // namespace content |
OLD | NEW |