Commit c8935892 authored by Rakina Zata Amni's avatar Rakina Zata Amni Committed by Commit Bot

Update extensions/ test to handle same-site BrowsingInstance swap

With crrev.com/c/2121522, some main-frame same-site navigations will
result in a new BrowsingInstance, SiteInstance, RenderFrameHost,
RenderView, etc. This CL updates expectations of an extensions/ test
that didn't expect a change of RenderFrameHosts etc. on same-site
navigations.

This CL does not include fixes for other tests in chrome/ content/,
components/, and layout tests (they're fixed in other CLs)

For more details, see doc: https://docs.google.com/document/d/1lHdkKLUe8H6ZP6ALwj-dsus7oYcuc93HkSCHCcerItg/edit?usp=sharing

Bug: 977562
Change-Id: I8b1d61ab107b6cead501fee669f90aeca6c7a34c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2212224
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#772060}
parent 1aa881a1
...@@ -357,25 +357,29 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, MAYBE_BookmarkAppGetsNormalProcess) { ...@@ -357,25 +357,29 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, MAYBE_BookmarkAppGetsNormalProcess) {
OpenWindow(tab, base_url.Resolve("path2/empty.html"), true, true, NULL); OpenWindow(tab, base_url.Resolve("path2/empty.html"), true, true, NULL);
// Now let's have a tab navigate out of and back into the app's web // Now let's have a tab navigate out of and back into the app's web
// extent. Neither navigation should switch processes. // extent. Neither navigation should switch processes (but may change
// RenderViewHosts, so we are saving and comparing the processes directly).
const GURL& app_url(base_url.Resolve("path1/empty.html")); const GURL& app_url(base_url.Resolve("path1/empty.html"));
const GURL& non_app_url(base_url.Resolve("path3/empty.html")); const GURL& non_app_url(base_url.Resolve("path3/empty.html"));
RenderViewHost* host2 = content::RenderProcessHost* old_process = browser()
browser()->tab_strip_model()->GetWebContentsAt(2)->GetRenderViewHost(); ->tab_strip_model()
->GetWebContentsAt(2)
->GetRenderViewHost()
->GetProcess();
NavigateInRenderer(browser()->tab_strip_model()->GetWebContentsAt(2), NavigateInRenderer(browser()->tab_strip_model()->GetWebContentsAt(2),
non_app_url); non_app_url);
EXPECT_EQ(host2->GetProcess(), browser() EXPECT_EQ(old_process, browser()
->tab_strip_model() ->tab_strip_model()
->GetWebContentsAt(2) ->GetWebContentsAt(2)
->GetMainFrame() ->GetMainFrame()
->GetProcess()); ->GetProcess());
NavigateInRenderer(browser()->tab_strip_model()->GetWebContentsAt(2), NavigateInRenderer(browser()->tab_strip_model()->GetWebContentsAt(2),
app_url); app_url);
EXPECT_EQ(host2->GetProcess(), browser() EXPECT_EQ(old_process, browser()
->tab_strip_model() ->tab_strip_model()
->GetWebContentsAt(2) ->GetWebContentsAt(2)
->GetMainFrame() ->GetMainFrame()
->GetProcess()); ->GetProcess());
} }
// Tests that app process switching works properly in the following scenario: // Tests that app process switching works properly in the following scenario:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment