| Index: content/browser/site_per_process_browsertest.cc
|
| diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc
|
| index 2a89fe80209232bc83a4006d07f4be81294b499e..0b3a97f754e0523466bf90da8a4615b5414e35cb 100644
|
| --- a/content/browser/site_per_process_browsertest.cc
|
| +++ b/content/browser/site_per_process_browsertest.cc
|
| @@ -2316,7 +2316,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, ProcessTransferAfterError) {
|
| // of the API), but the frame's last_successful_url shouldn't change and the
|
| // origin should be empty.
|
| // PlzNavigate: We have switched RenderFrameHosts for the subframe, so the
|
| - // last succesful url should be empty (since the frame only loaded an error
|
| + // last successful url should be empty (since the frame only loaded an error
|
| // page).
|
| if (IsBrowserSideNavigationEnabled())
|
| EXPECT_EQ(GURL(), child->current_frame_host()->last_successful_url());
|
| @@ -7168,15 +7168,39 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
|
| load_observer.Wait();
|
| }
|
|
|
| - // The blocked frame should stay at the old location.
|
| - EXPECT_EQ(old_subframe_url, root->child_at(0)->current_url());
|
| + if (IsBrowserSideNavigationEnabled()) {
|
| + // We have switched RenderFrameHosts for the subframe, so the last
|
| + // successful url should be empty (since the frame only loaded an error
|
| + // page).
|
| + EXPECT_EQ(GURL(),
|
| + root->child_at(0)->current_frame_host()->last_successful_url());
|
| +
|
| + // The blocked frame should go to an error page. Errors currently commit
|
| + // with the URL of the blocked page.
|
| + EXPECT_EQ(blocked_url, root->child_at(0)->current_url());
|
| +
|
| + // The page should get the title of an error page (i.e "") and not the
|
| + // title of the blocked page.
|
| + std::string frame_title;
|
| + EXPECT_TRUE(ExecuteScriptAndExtractString(
|
| + root->child_at(0), "domAutomationController.send(document.title)",
|
| + &frame_title));
|
| + EXPECT_EQ("", frame_title);
|
| + } else {
|
| + // The last successful url shouldn't be the blocked url.
|
| + EXPECT_EQ(old_subframe_url,
|
| + root->child_at(0)->current_frame_host()->last_successful_url());
|
|
|
| - // The blocked frame should keep the old title.
|
| - std::string frame_title;
|
| - EXPECT_TRUE(ExecuteScriptAndExtractString(
|
| - root->child_at(0), "domAutomationController.send(document.title)",
|
| - &frame_title));
|
| - EXPECT_EQ("Title Of Awesomeness", frame_title);
|
| + // The blocked frame should stay at the old location.
|
| + EXPECT_EQ(old_subframe_url, root->child_at(0)->current_url());
|
| +
|
| + // The blocked frame should keep the old title.
|
| + std::string frame_title;
|
| + EXPECT_TRUE(ExecuteScriptAndExtractString(
|
| + root->child_at(0), "domAutomationController.send(document.title)",
|
| + &frame_title));
|
| + EXPECT_EQ("Title Of Awesomeness", frame_title);
|
| + }
|
|
|
| // Navigate to a URL without CSP.
|
| EXPECT_TRUE(NavigateToURL(
|
| @@ -7243,15 +7267,39 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
|
| load_observer2.Wait();
|
| }
|
|
|
| - // The blocked frame should stay at the old location.
|
| - EXPECT_EQ(old_subframe_url, root->child_at(0)->current_url());
|
| + if (IsBrowserSideNavigationEnabled()) {
|
| + // We have switched RenderFrameHosts for the subframe, so the last
|
| + // successful url should be empty (since the frame only loaded an error
|
| + // page).
|
| + EXPECT_EQ(GURL(),
|
| + root->child_at(0)->current_frame_host()->last_successful_url());
|
| +
|
| + // The blocked frame should go to an error page. Errors currently commit
|
| + // with the URL of the blocked page.
|
| + EXPECT_EQ(blocked_url, root->child_at(0)->current_url());
|
| +
|
| + // The page should get the title of an error page (i.e "") and not the
|
| + // title of the blocked page.
|
| + std::string frame_title;
|
| + EXPECT_TRUE(ExecuteScriptAndExtractString(
|
| + root->child_at(0), "domAutomationController.send(document.title)",
|
| + &frame_title));
|
| + EXPECT_EQ("", frame_title);
|
| + } else {
|
| + // The last successful url shouldn't be the blocked url.
|
| + EXPECT_EQ(old_subframe_url,
|
| + root->child_at(0)->current_frame_host()->last_successful_url());
|
|
|
| - // The blocked frame should keep the old title.
|
| - std::string frame_title;
|
| - EXPECT_TRUE(ExecuteScriptAndExtractString(
|
| - root->child_at(0), "domAutomationController.send(document.title)",
|
| - &frame_title));
|
| - EXPECT_EQ("Title Of Awesomeness", frame_title);
|
| + // The blocked frame should stay at the old location.
|
| + EXPECT_EQ(old_subframe_url, root->child_at(0)->current_url());
|
| +
|
| + // The blocked frame should keep the old title.
|
| + std::string frame_title;
|
| + EXPECT_TRUE(ExecuteScriptAndExtractString(
|
| + root->child_at(0), "domAutomationController.send(document.title)",
|
| + &frame_title));
|
| + EXPECT_EQ("Title Of Awesomeness", frame_title);
|
| + }
|
| }
|
|
|
| // Test that a cross-origin frame's navigation can be blocked by CSP frame-src.
|
| @@ -7312,15 +7360,39 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
|
| load_observer2.Wait();
|
| }
|
|
|
| - // The blocked frame should stay at the old location.
|
| - EXPECT_EQ(old_subframe_url, navigating_frame->current_url());
|
| + if (IsBrowserSideNavigationEnabled()) {
|
| + // We have switched RenderFrameHosts for the subframe, so the last
|
| + // successful url should be empty (since the frame only loaded an error
|
| + // page).
|
| + EXPECT_EQ(GURL(),
|
| + navigating_frame->current_frame_host()->last_successful_url());
|
| +
|
| + // The blocked frame should go to an error page. Errors currently commit
|
| + // with the URL of the blocked page.
|
| + EXPECT_EQ(blocked_url, navigating_frame->current_url());
|
| +
|
| + // The page should get the title of an error page (i.e "") and not the
|
| + // title of the blocked page.
|
| + std::string frame_title;
|
| + EXPECT_TRUE(ExecuteScriptAndExtractString(
|
| + navigating_frame, "domAutomationController.send(document.title)",
|
| + &frame_title));
|
| + EXPECT_EQ("", frame_title);
|
| + } else {
|
| + // The last successful url shouldn't be the blocked url.
|
| + EXPECT_EQ(old_subframe_url,
|
| + navigating_frame->current_frame_host()->last_successful_url());
|
|
|
| - // The blocked frame should keep the old title.
|
| - std::string frame_title;
|
| - EXPECT_TRUE(ExecuteScriptAndExtractString(
|
| - navigating_frame, "domAutomationController.send(document.title)",
|
| - &frame_title));
|
| - EXPECT_EQ("Title Of Awesomeness", frame_title);
|
| + // The blocked frame should stay at the old location.
|
| + EXPECT_EQ(old_subframe_url, navigating_frame->current_url());
|
| +
|
| + // The blocked frame should keep the old title.
|
| + std::string frame_title;
|
| + EXPECT_TRUE(ExecuteScriptAndExtractString(
|
| + navigating_frame, "domAutomationController.send(document.title)",
|
| + &frame_title));
|
| + EXPECT_EQ("Title Of Awesomeness", frame_title);
|
| + }
|
|
|
| // Navigate the subframe to a URL without CSP.
|
| NavigateFrameToURL(srcdoc_frame,
|
|
|