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 4f2eacedf5199d3f835a4de3016578cbabe52404..4a19289a26481d92a8d46b12d6065d76e2a677df 100644 |
--- a/content/browser/site_per_process_browsertest.cc |
+++ b/content/browser/site_per_process_browsertest.cc |
@@ -2306,7 +2306,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()); |
@@ -7157,15 +7157,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( |
@@ -7232,15 +7256,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. |
@@ -7301,15 +7349,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, |