Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1706)

Unified Diff: content/browser/site_per_process_browsertest.cc

Issue 2480203002: ui: Cleanup class/struct forward declarations (Closed)
Patch Set: Sync CL to position 430550 Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 55a2ab9ccfdf381c510fc51fe2d1ba762dbe1398..4adc89452ca9b58f72d8968b86cd2a85c5628387 100644
--- a/content/browser/site_per_process_browsertest.cc
+++ b/content/browser/site_per_process_browsertest.cc
@@ -626,24 +626,28 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessHighDPIBrowserTest,
"a.com", "/cross_site_iframe_factory.html?a(b)"));
NavigateToURL(shell(), main_url);
- EXPECT_EQ(SitePerProcessHighDPIBrowserTest::kDeviceScaleFactor,
- GetFrameDeviceScaleFactor(web_contents()));
+ // On Android forcing device scale factor does not work for tests, therefore
+ // we ensure that make frame and iframe have the same DIP scale there, but
+ // not necessarily kDeviceScaleFactor.
+ const double expected_dip_scale =
+#if defined(OS_ANDROID)
+ GetFrameDeviceScaleFactor(web_contents());
+#else
+ SitePerProcessHighDPIBrowserTest::kDeviceScaleFactor;
+#endif
+
+ EXPECT_EQ(expected_dip_scale, GetFrameDeviceScaleFactor(web_contents()));
FrameTreeNode* root = web_contents()->GetFrameTree()->root();
+ ASSERT_EQ(1U, root->child_count());
+
FrameTreeNode* child = root->child_at(0);
- EXPECT_EQ(SitePerProcessHighDPIBrowserTest::kDeviceScaleFactor,
- GetFrameDeviceScaleFactor(child));
+ EXPECT_EQ(expected_dip_scale, GetFrameDeviceScaleFactor(child));
}
// Ensure that navigating subframes in --site-per-process mode works and the
// correct documents are committed.
-#if defined(OS_WIN)
-// This test is flaky on Windows, see https://crbug.com/629419.
-#define MAYBE_CrossSiteIframe DISABLED_CrossSiteIframe
-#else
-#define MAYBE_CrossSiteIframe CrossSiteIframe
-#endif
-IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, MAYBE_CrossSiteIframe) {
+IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, CrossSiteIframe) {
GURL main_url(embedded_test_server()->GetURL(
"a.com", "/cross_site_iframe_factory.html?a(a,a(a,a(a)))"));
NavigateToURL(shell(), main_url);
@@ -679,7 +683,11 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, MAYBE_CrossSiteIframe) {
// Load cross-site page into iframe.
GURL url = embedded_test_server()->GetURL("foo.com", "/title2.html");
- NavigateFrameToURL(root->child_at(0), url);
+ {
+ RenderFrameDeletedObserver deleted_observer(child->current_frame_host());
+ NavigateFrameToURL(root->child_at(0), url);
+ deleted_observer.WaitUntilDeleted();
+ }
// Verify that the navigation succeeded and the expected URL was loaded.
EXPECT_TRUE(observer.last_navigation_succeeded());
EXPECT_EQ(url, observer.last_navigation_url());
@@ -723,7 +731,11 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, MAYBE_CrossSiteIframe) {
// Load another cross-site page into the same iframe.
url = embedded_test_server()->GetURL("bar.com", "/title3.html");
- NavigateFrameToURL(root->child_at(0), url);
+ {
+ RenderFrameDeletedObserver deleted_observer(child->current_frame_host());
+ NavigateFrameToURL(root->child_at(0), url);
+ deleted_observer.WaitUntilDeleted();
+ }
EXPECT_TRUE(observer.last_navigation_succeeded());
EXPECT_EQ(url, observer.last_navigation_url());
@@ -1717,13 +1729,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, RestrictFrameDetach) {
DepictFrameTree(root));
}
-#if defined(OS_WIN)
-// This test is flaky on Windows, see https://crbug.com/629419.
-#define MAYBE_NavigateRemoteFrame DISABLED_NavigateRemoteFrame
-#else
-#define MAYBE_NavigateRemoteFrame NavigateRemoteFrame
-#endif
-IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, MAYBE_NavigateRemoteFrame) {
+IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, NavigateRemoteFrame) {
GURL main_url(embedded_test_server()->GetURL(
"a.com", "/cross_site_iframe_factory.html?a(a,a(a,a(a)))"));
NavigateToURL(shell(), main_url);
@@ -1742,7 +1748,11 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, MAYBE_NavigateRemoteFrame) {
// Load cross-site page into iframe.
GURL url = embedded_test_server()->GetURL("foo.com", "/title2.html");
- NavigateFrameToURL(root->child_at(0), url);
+ {
+ RenderFrameDeletedObserver deleted_observer(child->current_frame_host());
+ NavigateFrameToURL(root->child_at(0), url);
+ deleted_observer.WaitUntilDeleted();
+ }
EXPECT_TRUE(observer.last_navigation_succeeded());
EXPECT_EQ(url, observer.last_navigation_url());
@@ -1763,7 +1773,11 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, MAYBE_NavigateRemoteFrame) {
// Emulate the main frame changing the src of the iframe such that it
// navigates cross-site.
url = embedded_test_server()->GetURL("bar.com", "/title3.html");
- NavigateIframeToURL(shell()->web_contents(), "child-0", url);
+ {
+ RenderFrameDeletedObserver deleted_observer(child->current_frame_host());
+ NavigateIframeToURL(shell()->web_contents(), "child-0", url);
+ deleted_observer.WaitUntilDeleted();
+ }
EXPECT_TRUE(observer.last_navigation_succeeded());
EXPECT_EQ(url, observer.last_navigation_url());
@@ -1782,7 +1796,11 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, MAYBE_NavigateRemoteFrame) {
// Navigate back to the parent's origin and ensure we return to the
// parent's process.
- NavigateFrameToURL(child, http_url);
+ {
+ RenderFrameDeletedObserver deleted_observer(child->current_frame_host());
+ NavigateFrameToURL(child, http_url);
+ deleted_observer.WaitUntilDeleted();
+ }
EXPECT_EQ(http_url, observer.last_navigation_url());
EXPECT_TRUE(observer.last_navigation_succeeded());
EXPECT_EQ(shell()->web_contents()->GetSiteInstance(),
@@ -4248,13 +4266,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, IndexedFrameAccess) {
EXPECT_EQ(1, GetReceivedMessages(child2));
}
-#if defined(OS_WIN)
-// This test is flaky on Windows, see https://crbug.com/629419.
-#define MAYBE_RFPHDestruction DISABLED_RFPHDestruction
-#else
-#define MAYBE_RFPHDestruction RFPHDestruction
-#endif
-IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, MAYBE_RFPHDestruction) {
+IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, RFPHDestruction) {
GURL main_url(embedded_test_server()->GetURL("/site_per_process_main.html"));
NavigateToURL(shell(), main_url);
@@ -4266,7 +4278,11 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, MAYBE_RFPHDestruction) {
// Load cross-site page into iframe.
FrameTreeNode* child = root->child_at(0);
GURL url = embedded_test_server()->GetURL("foo.com", "/title2.html");
- NavigateFrameToURL(root->child_at(0), url);
+ {
+ RenderFrameDeletedObserver deleted_observer(child->current_frame_host());
+ NavigateFrameToURL(root->child_at(0), url);
+ deleted_observer.WaitUntilDeleted();
+ }
EXPECT_TRUE(observer.last_navigation_succeeded());
EXPECT_EQ(url, observer.last_navigation_url());
EXPECT_EQ(
@@ -4282,7 +4298,11 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, MAYBE_RFPHDestruction) {
// Load another cross-site page.
url = embedded_test_server()->GetURL("bar.com", "/title3.html");
- NavigateIframeToURL(shell()->web_contents(), "test", url);
+ {
+ RenderFrameDeletedObserver deleted_observer(child->current_frame_host());
+ NavigateIframeToURL(shell()->web_contents(), "test", url);
+ deleted_observer.WaitUntilDeleted();
+ }
EXPECT_TRUE(observer.last_navigation_succeeded());
EXPECT_EQ(url, observer.last_navigation_url());
EXPECT_EQ(
@@ -4297,14 +4317,16 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, MAYBE_RFPHDestruction) {
DepictFrameTree(root));
// Navigate back to the parent's origin.
- RenderFrameDeletedObserver deleted_observer(child->current_frame_host());
- url = embedded_test_server()->GetURL("/title1.html");
- NavigateFrameToURL(child, url);
+ {
+ RenderFrameDeletedObserver deleted_observer(child->current_frame_host());
+ url = embedded_test_server()->GetURL("/title1.html");
+ NavigateFrameToURL(child, url);
+ // Wait for the old process to exit, to verify that the proxies go away.
+ deleted_observer.WaitUntilDeleted();
+ }
EXPECT_EQ(url, observer.last_navigation_url());
EXPECT_TRUE(observer.last_navigation_succeeded());
- // Wait for the old process to exit, to verify that the proxies go away.
- deleted_observer.WaitUntilDeleted();
EXPECT_EQ(
" Site A\n"
" |--Site A\n"

Powered by Google App Engine
This is Rietveld 408576698