| 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/browser/site_per_process_browsertest.h" | 5 #include "content/browser/site_per_process_browsertest.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "content/browser/frame_host/cross_process_frame_connector.h" | 10 #include "content/browser/frame_host/cross_process_frame_connector.h" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 SitePerProcessBrowserTest::SitePerProcessBrowserTest() { | 209 SitePerProcessBrowserTest::SitePerProcessBrowserTest() { |
| 210 }; | 210 }; |
| 211 | 211 |
| 212 void SitePerProcessBrowserTest::StartFrameAtDataURL() { | 212 void SitePerProcessBrowserTest::StartFrameAtDataURL() { |
| 213 std::string data_url_script = | 213 std::string data_url_script = |
| 214 "var iframes = document.getElementById('test');iframes.src=" | 214 "var iframes = document.getElementById('test');iframes.src=" |
| 215 "'data:text/html,dataurl';"; | 215 "'data:text/html,dataurl';"; |
| 216 ASSERT_TRUE(ExecuteScript(shell()->web_contents(), data_url_script)); | 216 ASSERT_TRUE(ExecuteScript(shell()->web_contents(), data_url_script)); |
| 217 } | 217 } |
| 218 | 218 |
| 219 bool SitePerProcessBrowserTest::NavigateIframeToURL(Shell* window, | |
| 220 const GURL& url, | |
| 221 std::string iframe_id) { | |
| 222 // TODO(creis): This should wait for LOAD_STOP, but cross-site subframe | |
| 223 // navigations generate extra DidStartLoading and DidStopLoading messages. | |
| 224 // Until we replace swappedout:// with frame proxies, we need to listen for | |
| 225 // something else. For now, we trigger NEW_SUBFRAME navigations and listen | |
| 226 // for commit. | |
| 227 std::string script = base::StringPrintf( | |
| 228 "setTimeout(\"" | |
| 229 "var iframes = document.getElementById('%s');iframes.src='%s';" | |
| 230 "\",0)", | |
| 231 iframe_id.c_str(), url.spec().c_str()); | |
| 232 WindowedNotificationObserver load_observer( | |
| 233 NOTIFICATION_NAV_ENTRY_COMMITTED, | |
| 234 Source<NavigationController>( | |
| 235 &window->web_contents()->GetController())); | |
| 236 if (!ExecuteScript(window->web_contents(), script)) | |
| 237 return false; | |
| 238 load_observer.Wait(); | |
| 239 | |
| 240 return true; | |
| 241 } | |
| 242 | |
| 243 void SitePerProcessBrowserTest::SetUpCommandLine( | 219 void SitePerProcessBrowserTest::SetUpCommandLine( |
| 244 base::CommandLine* command_line) { | 220 base::CommandLine* command_line) { |
| 245 command_line->AppendSwitch(switches::kSitePerProcess); | 221 command_line->AppendSwitch(switches::kSitePerProcess); |
| 246 }; | 222 }; |
| 247 | 223 |
| 248 void SitePerProcessBrowserTest::SetUpOnMainThread() { | 224 void SitePerProcessBrowserTest::SetUpOnMainThread() { |
| 249 host_resolver()->AddRule("*", "127.0.0.1"); | 225 host_resolver()->AddRule("*", "127.0.0.1"); |
| 250 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 226 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 251 SetupCrossSiteRedirector(embedded_test_server()); | 227 SetupCrossSiteRedirector(embedded_test_server()); |
| 252 } | 228 } |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 EXPECT_EQ(url, observer.navigation_url()); | 347 EXPECT_EQ(url, observer.navigation_url()); |
| 372 | 348 |
| 373 // Ensure that we have created a new process for the subframe. | 349 // Ensure that we have created a new process for the subframe. |
| 374 ASSERT_EQ(2U, root->child_count()); | 350 ASSERT_EQ(2U, root->child_count()); |
| 375 SiteInstance* site_instance = child->current_frame_host()->GetSiteInstance(); | 351 SiteInstance* site_instance = child->current_frame_host()->GetSiteInstance(); |
| 376 EXPECT_NE(shell()->web_contents()->GetSiteInstance(), site_instance); | 352 EXPECT_NE(shell()->web_contents()->GetSiteInstance(), site_instance); |
| 377 | 353 |
| 378 // Emulate the main frame changing the src of the iframe such that it | 354 // Emulate the main frame changing the src of the iframe such that it |
| 379 // navigates cross-site. | 355 // navigates cross-site. |
| 380 url = embedded_test_server()->GetURL("bar.com", "/title3.html"); | 356 url = embedded_test_server()->GetURL("bar.com", "/title3.html"); |
| 381 NavigateIframeToURL(shell(), url, "test"); | 357 NavigateIframeToURL(shell()->web_contents(), "test", url); |
| 382 EXPECT_TRUE(observer.navigation_succeeded()); | 358 EXPECT_TRUE(observer.navigation_succeeded()); |
| 383 EXPECT_EQ(url, observer.navigation_url()); | 359 EXPECT_EQ(url, observer.navigation_url()); |
| 384 | 360 |
| 385 // Check again that a new process is created and is different from the | 361 // Check again that a new process is created and is different from the |
| 386 // top level one and the previous one. | 362 // top level one and the previous one. |
| 387 ASSERT_EQ(2U, root->child_count()); | 363 ASSERT_EQ(2U, root->child_count()); |
| 388 child = root->child_at(0); | 364 child = root->child_at(0); |
| 389 EXPECT_NE(shell()->web_contents()->GetSiteInstance(), | 365 EXPECT_NE(shell()->web_contents()->GetSiteInstance(), |
| 390 child->current_frame_host()->GetSiteInstance()); | 366 child->current_frame_host()->GetSiteInstance()); |
| 391 EXPECT_NE(site_instance, | 367 EXPECT_NE(site_instance, |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 NavigateToURL(shell(), main_url); | 484 NavigateToURL(shell(), main_url); |
| 509 | 485 |
| 510 StartFrameAtDataURL(); | 486 StartFrameAtDataURL(); |
| 511 | 487 |
| 512 // These must stay in scope with replace_host. | 488 // These must stay in scope with replace_host. |
| 513 GURL::Replacements replace_host; | 489 GURL::Replacements replace_host; |
| 514 std::string foo_com("foo.com"); | 490 std::string foo_com("foo.com"); |
| 515 | 491 |
| 516 // Load cross-site page into iframe. | 492 // Load cross-site page into iframe. |
| 517 EXPECT_TRUE(NavigateIframeToURL( | 493 EXPECT_TRUE(NavigateIframeToURL( |
| 518 shell(), | 494 shell()->web_contents(), "test", |
| 519 embedded_test_server()->GetURL("/cross-site/foo.com/title2.html"), | 495 embedded_test_server()->GetURL("/cross-site/foo.com/title2.html"))); |
| 520 "test")); | |
| 521 | 496 |
| 522 // Check the subframe process. | 497 // Check the subframe process. |
| 523 FrameTreeNode* root = | 498 FrameTreeNode* root = |
| 524 static_cast<WebContentsImpl*>(shell()->web_contents())-> | 499 static_cast<WebContentsImpl*>(shell()->web_contents())-> |
| 525 GetFrameTree()->root(); | 500 GetFrameTree()->root(); |
| 526 ASSERT_EQ(2U, root->child_count()); | 501 ASSERT_EQ(2U, root->child_count()); |
| 527 FrameTreeNode* child = root->child_at(0); | 502 FrameTreeNode* child = root->child_at(0); |
| 528 EXPECT_EQ(main_url, root->current_url()); | 503 EXPECT_EQ(main_url, root->current_url()); |
| 529 EXPECT_EQ("foo.com", child->current_url().host()); | 504 EXPECT_EQ("foo.com", child->current_url().host()); |
| 530 EXPECT_EQ("/title2.html", child->current_url().path()); | 505 EXPECT_EQ("/title2.html", child->current_url().path()); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 GURL https_url(https_server.GetURL("files/title1.html")); | 559 GURL https_url(https_server.GetURL("files/title1.html")); |
| 585 | 560 |
| 586 NavigateToURL(shell(), main_url); | 561 NavigateToURL(shell(), main_url); |
| 587 | 562 |
| 588 SitePerProcessWebContentsObserver observer(shell()->web_contents()); | 563 SitePerProcessWebContentsObserver observer(shell()->web_contents()); |
| 589 { | 564 { |
| 590 // Load cross-site client-redirect page into Iframe. | 565 // Load cross-site client-redirect page into Iframe. |
| 591 // Should be blocked. | 566 // Should be blocked. |
| 592 GURL client_redirect_https_url(https_server.GetURL( | 567 GURL client_redirect_https_url(https_server.GetURL( |
| 593 "client-redirect?files/title1.html")); | 568 "client-redirect?files/title1.html")); |
| 594 EXPECT_TRUE(NavigateIframeToURL(shell(), | 569 EXPECT_TRUE(NavigateIframeToURL(shell()->web_contents(), "test", |
| 595 client_redirect_https_url, "test")); | 570 client_redirect_https_url)); |
| 596 // DidFailProvisionalLoad when navigating to client_redirect_https_url. | 571 // DidFailProvisionalLoad when navigating to client_redirect_https_url. |
| 597 EXPECT_EQ(observer.navigation_url(), client_redirect_https_url); | 572 EXPECT_EQ(observer.navigation_url(), client_redirect_https_url); |
| 598 EXPECT_FALSE(observer.navigation_succeeded()); | 573 EXPECT_FALSE(observer.navigation_succeeded()); |
| 599 } | 574 } |
| 600 | 575 |
| 601 { | 576 { |
| 602 // Load cross-site server-redirect page into Iframe, | 577 // Load cross-site server-redirect page into Iframe, |
| 603 // which redirects to same-site page. | 578 // which redirects to same-site page. |
| 604 GURL server_redirect_http_url(https_server.GetURL( | 579 GURL server_redirect_http_url(https_server.GetURL( |
| 605 "server-redirect?" + http_url.spec())); | 580 "server-redirect?" + http_url.spec())); |
| 606 EXPECT_TRUE(NavigateIframeToURL(shell(), | 581 EXPECT_TRUE(NavigateIframeToURL(shell()->web_contents(), "test", |
| 607 server_redirect_http_url, "test")); | 582 server_redirect_http_url)); |
| 608 EXPECT_EQ(observer.navigation_url(), http_url); | 583 EXPECT_EQ(observer.navigation_url(), http_url); |
| 609 EXPECT_TRUE(observer.navigation_succeeded()); | 584 EXPECT_TRUE(observer.navigation_succeeded()); |
| 610 } | 585 } |
| 611 | 586 |
| 612 { | 587 { |
| 613 // Load cross-site server-redirect page into Iframe, | 588 // Load cross-site server-redirect page into Iframe, |
| 614 // which redirects to cross-site page. | 589 // which redirects to cross-site page. |
| 615 GURL server_redirect_http_url(https_server.GetURL( | 590 GURL server_redirect_http_url(https_server.GetURL( |
| 616 "server-redirect?files/title1.html")); | 591 "server-redirect?files/title1.html")); |
| 617 EXPECT_TRUE(NavigateIframeToURL(shell(), | 592 EXPECT_TRUE(NavigateIframeToURL(shell()->web_contents(), "test", |
| 618 server_redirect_http_url, "test")); | 593 server_redirect_http_url)); |
| 619 // DidFailProvisionalLoad when navigating to https_url. | 594 // DidFailProvisionalLoad when navigating to https_url. |
| 620 EXPECT_EQ(observer.navigation_url(), https_url); | 595 EXPECT_EQ(observer.navigation_url(), https_url); |
| 621 EXPECT_FALSE(observer.navigation_succeeded()); | 596 EXPECT_FALSE(observer.navigation_succeeded()); |
| 622 } | 597 } |
| 623 | 598 |
| 624 { | 599 { |
| 625 // Load same-site server-redirect page into Iframe, | 600 // Load same-site server-redirect page into Iframe, |
| 626 // which redirects to cross-site page. | 601 // which redirects to cross-site page. |
| 627 GURL server_redirect_http_url(test_server()->GetURL( | 602 GURL server_redirect_http_url(test_server()->GetURL( |
| 628 "server-redirect?" + https_url.spec())); | 603 "server-redirect?" + https_url.spec())); |
| 629 EXPECT_TRUE(NavigateIframeToURL(shell(), | 604 EXPECT_TRUE(NavigateIframeToURL(shell()->web_contents(), "test", |
| 630 server_redirect_http_url, "test")); | 605 server_redirect_http_url)); |
| 631 | 606 |
| 632 EXPECT_EQ(observer.navigation_url(), https_url); | 607 EXPECT_EQ(observer.navigation_url(), https_url); |
| 633 EXPECT_FALSE(observer.navigation_succeeded()); | 608 EXPECT_FALSE(observer.navigation_succeeded()); |
| 634 } | 609 } |
| 635 | 610 |
| 636 { | 611 { |
| 637 // Load same-site client-redirect page into Iframe, | 612 // Load same-site client-redirect page into Iframe, |
| 638 // which redirects to cross-site page. | 613 // which redirects to cross-site page. |
| 639 GURL client_redirect_http_url(test_server()->GetURL( | 614 GURL client_redirect_http_url(test_server()->GetURL( |
| 640 "client-redirect?" + https_url.spec())); | 615 "client-redirect?" + https_url.spec())); |
| 641 | 616 |
| 642 RedirectNotificationObserver load_observer2( | 617 RedirectNotificationObserver load_observer2( |
| 643 NOTIFICATION_LOAD_STOP, | 618 NOTIFICATION_LOAD_STOP, |
| 644 Source<NavigationController>( | 619 Source<NavigationController>( |
| 645 &shell()->web_contents()->GetController())); | 620 &shell()->web_contents()->GetController())); |
| 646 | 621 |
| 647 EXPECT_TRUE(NavigateIframeToURL(shell(), | 622 EXPECT_TRUE(NavigateIframeToURL(shell()->web_contents(), "test", |
| 648 client_redirect_http_url, "test")); | 623 client_redirect_http_url)); |
| 649 | 624 |
| 650 // Same-site Client-Redirect Page should be loaded successfully. | 625 // Same-site Client-Redirect Page should be loaded successfully. |
| 651 EXPECT_EQ(observer.navigation_url(), client_redirect_http_url); | 626 EXPECT_EQ(observer.navigation_url(), client_redirect_http_url); |
| 652 EXPECT_TRUE(observer.navigation_succeeded()); | 627 EXPECT_TRUE(observer.navigation_succeeded()); |
| 653 | 628 |
| 654 // Redirecting to Cross-site Page should be blocked. | 629 // Redirecting to Cross-site Page should be blocked. |
| 655 load_observer2.Wait(); | 630 load_observer2.Wait(); |
| 656 EXPECT_EQ(observer.navigation_url(), https_url); | 631 EXPECT_EQ(observer.navigation_url(), https_url); |
| 657 EXPECT_FALSE(observer.navigation_succeeded()); | 632 EXPECT_FALSE(observer.navigation_succeeded()); |
| 658 } | 633 } |
| 659 | 634 |
| 660 { | 635 { |
| 661 // Load same-site server-redirect page into Iframe, | 636 // Load same-site server-redirect page into Iframe, |
| 662 // which redirects to same-site page. | 637 // which redirects to same-site page. |
| 663 GURL server_redirect_http_url(test_server()->GetURL( | 638 GURL server_redirect_http_url(test_server()->GetURL( |
| 664 "server-redirect?files/title1.html")); | 639 "server-redirect?files/title1.html")); |
| 665 EXPECT_TRUE(NavigateIframeToURL(shell(), | 640 EXPECT_TRUE(NavigateIframeToURL(shell()->web_contents(), "test", |
| 666 server_redirect_http_url, "test")); | 641 server_redirect_http_url)); |
| 667 EXPECT_EQ(observer.navigation_url(), http_url); | 642 EXPECT_EQ(observer.navigation_url(), http_url); |
| 668 EXPECT_TRUE(observer.navigation_succeeded()); | 643 EXPECT_TRUE(observer.navigation_succeeded()); |
| 669 } | 644 } |
| 670 | 645 |
| 671 { | 646 { |
| 672 // Load same-site client-redirect page into Iframe, | 647 // Load same-site client-redirect page into Iframe, |
| 673 // which redirects to same-site page. | 648 // which redirects to same-site page. |
| 674 GURL client_redirect_http_url(test_server()->GetURL( | 649 GURL client_redirect_http_url(test_server()->GetURL( |
| 675 "client-redirect?" + http_url.spec())); | 650 "client-redirect?" + http_url.spec())); |
| 676 RedirectNotificationObserver load_observer2( | 651 RedirectNotificationObserver load_observer2( |
| 677 NOTIFICATION_LOAD_STOP, | 652 NOTIFICATION_LOAD_STOP, |
| 678 Source<NavigationController>( | 653 Source<NavigationController>( |
| 679 &shell()->web_contents()->GetController())); | 654 &shell()->web_contents()->GetController())); |
| 680 | 655 |
| 681 EXPECT_TRUE(NavigateIframeToURL(shell(), | 656 EXPECT_TRUE(NavigateIframeToURL(shell()->web_contents(), "test", |
| 682 client_redirect_http_url, "test")); | 657 client_redirect_http_url)); |
| 683 | 658 |
| 684 // Same-site Client-Redirect Page should be loaded successfully. | 659 // Same-site Client-Redirect Page should be loaded successfully. |
| 685 EXPECT_EQ(observer.navigation_url(), client_redirect_http_url); | 660 EXPECT_EQ(observer.navigation_url(), client_redirect_http_url); |
| 686 EXPECT_TRUE(observer.navigation_succeeded()); | 661 EXPECT_TRUE(observer.navigation_succeeded()); |
| 687 | 662 |
| 688 // Redirecting to Same-site Page should be loaded successfully. | 663 // Redirecting to Same-site Page should be loaded successfully. |
| 689 load_observer2.Wait(); | 664 load_observer2.Wait(); |
| 690 EXPECT_EQ(observer.navigation_url(), http_url); | 665 EXPECT_EQ(observer.navigation_url(), http_url); |
| 691 EXPECT_TRUE(observer.navigation_succeeded()); | 666 EXPECT_TRUE(observer.navigation_succeeded()); |
| 692 } | 667 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 719 "client-redirect?" + http_url.spec())); | 694 "client-redirect?" + http_url.spec())); |
| 720 GURL client_redirect_http_url(test_server()->GetURL( | 695 GURL client_redirect_http_url(test_server()->GetURL( |
| 721 "client-redirect?" + client_redirect_https_url.spec())); | 696 "client-redirect?" + client_redirect_https_url.spec())); |
| 722 | 697 |
| 723 // We should wait until second client redirect get cancelled. | 698 // We should wait until second client redirect get cancelled. |
| 724 RedirectNotificationObserver load_observer2( | 699 RedirectNotificationObserver load_observer2( |
| 725 NOTIFICATION_LOAD_STOP, | 700 NOTIFICATION_LOAD_STOP, |
| 726 Source<NavigationController>( | 701 Source<NavigationController>( |
| 727 &shell()->web_contents()->GetController())); | 702 &shell()->web_contents()->GetController())); |
| 728 | 703 |
| 729 EXPECT_TRUE(NavigateIframeToURL(shell(), client_redirect_http_url, "test")); | 704 EXPECT_TRUE(NavigateIframeToURL(shell()->web_contents(), "test", |
| 705 client_redirect_http_url)); |
| 730 | 706 |
| 731 // DidFailProvisionalLoad when navigating to client_redirect_https_url. | 707 // DidFailProvisionalLoad when navigating to client_redirect_https_url. |
| 732 load_observer2.Wait(); | 708 load_observer2.Wait(); |
| 733 EXPECT_EQ(observer.navigation_url(), client_redirect_https_url); | 709 EXPECT_EQ(observer.navigation_url(), client_redirect_https_url); |
| 734 EXPECT_FALSE(observer.navigation_succeeded()); | 710 EXPECT_FALSE(observer.navigation_succeeded()); |
| 735 } | 711 } |
| 736 | 712 |
| 737 { | 713 { |
| 738 // Load server-redirect page pointing to a cross-site server-redirect page, | 714 // Load server-redirect page pointing to a cross-site server-redirect page, |
| 739 // which eventually redirect back to same-site page. | 715 // which eventually redirect back to same-site page. |
| 740 GURL server_redirect_https_url(https_server.GetURL( | 716 GURL server_redirect_https_url(https_server.GetURL( |
| 741 "server-redirect?" + http_url.spec())); | 717 "server-redirect?" + http_url.spec())); |
| 742 GURL server_redirect_http_url(test_server()->GetURL( | 718 GURL server_redirect_http_url(test_server()->GetURL( |
| 743 "server-redirect?" + server_redirect_https_url.spec())); | 719 "server-redirect?" + server_redirect_https_url.spec())); |
| 744 EXPECT_TRUE(NavigateIframeToURL(shell(), | 720 EXPECT_TRUE(NavigateIframeToURL(shell()->web_contents(), "test", |
| 745 server_redirect_http_url, "test")); | 721 server_redirect_http_url)); |
| 746 EXPECT_EQ(observer.navigation_url(), http_url); | 722 EXPECT_EQ(observer.navigation_url(), http_url); |
| 747 EXPECT_TRUE(observer.navigation_succeeded()); | 723 EXPECT_TRUE(observer.navigation_succeeded()); |
| 748 } | 724 } |
| 749 | 725 |
| 750 { | 726 { |
| 751 // Load server-redirect page pointing to a cross-site server-redirect page, | 727 // Load server-redirect page pointing to a cross-site server-redirect page, |
| 752 // which eventually redirects back to cross-site page. | 728 // which eventually redirects back to cross-site page. |
| 753 GURL server_redirect_https_url(https_server.GetURL( | 729 GURL server_redirect_https_url(https_server.GetURL( |
| 754 "server-redirect?" + https_url.spec())); | 730 "server-redirect?" + https_url.spec())); |
| 755 GURL server_redirect_http_url(test_server()->GetURL( | 731 GURL server_redirect_http_url(test_server()->GetURL( |
| 756 "server-redirect?" + server_redirect_https_url.spec())); | 732 "server-redirect?" + server_redirect_https_url.spec())); |
| 757 EXPECT_TRUE(NavigateIframeToURL(shell(), server_redirect_http_url, "test")); | 733 EXPECT_TRUE(NavigateIframeToURL(shell()->web_contents(), "test", |
| 734 server_redirect_http_url)); |
| 758 | 735 |
| 759 // DidFailProvisionalLoad when navigating to https_url. | 736 // DidFailProvisionalLoad when navigating to https_url. |
| 760 EXPECT_EQ(observer.navigation_url(), https_url); | 737 EXPECT_EQ(observer.navigation_url(), https_url); |
| 761 EXPECT_FALSE(observer.navigation_succeeded()); | 738 EXPECT_FALSE(observer.navigation_succeeded()); |
| 762 } | 739 } |
| 763 | 740 |
| 764 { | 741 { |
| 765 // Load server-redirect page pointing to a cross-site client-redirect page, | 742 // Load server-redirect page pointing to a cross-site client-redirect page, |
| 766 // which eventually redirects back to same-site page. | 743 // which eventually redirects back to same-site page. |
| 767 GURL client_redirect_http_url(https_server.GetURL( | 744 GURL client_redirect_http_url(https_server.GetURL( |
| 768 "client-redirect?" + http_url.spec())); | 745 "client-redirect?" + http_url.spec())); |
| 769 GURL server_redirect_http_url(test_server()->GetURL( | 746 GURL server_redirect_http_url(test_server()->GetURL( |
| 770 "server-redirect?" + client_redirect_http_url.spec())); | 747 "server-redirect?" + client_redirect_http_url.spec())); |
| 771 EXPECT_TRUE(NavigateIframeToURL(shell(), server_redirect_http_url, "test")); | 748 EXPECT_TRUE(NavigateIframeToURL(shell()->web_contents(), "test", |
| 749 server_redirect_http_url)); |
| 772 | 750 |
| 773 // DidFailProvisionalLoad when navigating to client_redirect_http_url. | 751 // DidFailProvisionalLoad when navigating to client_redirect_http_url. |
| 774 EXPECT_EQ(observer.navigation_url(), client_redirect_http_url); | 752 EXPECT_EQ(observer.navigation_url(), client_redirect_http_url); |
| 775 EXPECT_FALSE(observer.navigation_succeeded()); | 753 EXPECT_FALSE(observer.navigation_succeeded()); |
| 776 } | 754 } |
| 777 } | 755 } |
| 778 | 756 |
| 779 // Ensure that when navigating a frame cross-process RenderFrameProxyHosts are | 757 // Ensure that when navigating a frame cross-process RenderFrameProxyHosts are |
| 780 // created in the FrameTree skipping the subtree of the navigating frame. | 758 // created in the FrameTree skipping the subtree of the navigating frame. |
| 781 // | 759 // |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1102 params.frame_tree_node_id = child->frame_tree_node_id(); | 1080 params.frame_tree_node_id = child->frame_tree_node_id(); |
| 1103 child->navigator()->GetController()->LoadURLWithParams(params); | 1081 child->navigator()->GetController()->LoadURLWithParams(params); |
| 1104 nav_observer.Wait(); | 1082 nav_observer.Wait(); |
| 1105 | 1083 |
| 1106 // Verify that the navigation succeeded and the expected URL was loaded. | 1084 // Verify that the navigation succeeded and the expected URL was loaded. |
| 1107 EXPECT_TRUE(observer.navigation_succeeded()); | 1085 EXPECT_TRUE(observer.navigation_succeeded()); |
| 1108 EXPECT_EQ(url, observer.navigation_url()); | 1086 EXPECT_EQ(url, observer.navigation_url()); |
| 1109 } | 1087 } |
| 1110 | 1088 |
| 1111 } // namespace content | 1089 } // namespace content |
| OLD | NEW |