OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 1812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1823 Shell* new_shell = shao.GetShell(); | 1823 Shell* new_shell = shao.GetShell(); |
1824 WebContentsImpl* new_web_contents = static_cast<WebContentsImpl*>( | 1824 WebContentsImpl* new_web_contents = static_cast<WebContentsImpl*>( |
1825 new_shell->web_contents()); | 1825 new_shell->web_contents()); |
1826 SiteInstance* site_instance2 = new_web_contents->GetSiteInstance(); | 1826 SiteInstance* site_instance2 = new_web_contents->GetSiteInstance(); |
1827 | 1827 |
1828 EXPECT_NE(site_instance2, site_instance1); | 1828 EXPECT_NE(site_instance2, site_instance1); |
1829 EXPECT_TRUE(site_instance2->IsRelatedSiteInstance(site_instance1)); | 1829 EXPECT_TRUE(site_instance2->IsRelatedSiteInstance(site_instance1)); |
1830 RenderViewHost* initial_rvh = new_web_contents-> | 1830 RenderViewHost* initial_rvh = new_web_contents-> |
1831 GetRenderManagerForTesting()->GetSwappedOutRenderViewHost(site_instance1); | 1831 GetRenderManagerForTesting()->GetSwappedOutRenderViewHost(site_instance1); |
1832 ASSERT_TRUE(initial_rvh); | 1832 ASSERT_TRUE(initial_rvh); |
1833 // The following condition is what was causing the bug. | |
1834 EXPECT_EQ(0, initial_rvh->GetEnabledBindings()); | |
1835 | 1833 |
1836 // Navigate to url1 and check bindings. | 1834 // Navigate to url1 and check bindings. |
1837 NavigateToURL(new_shell, url1); | 1835 NavigateToURL(new_shell, url1); |
1838 // The navigation should have used the first SiteInstance, otherwise | 1836 // The navigation should have used the first SiteInstance, otherwise |
1839 // |initial_rvh| did not have a chance to be used. | 1837 // |initial_rvh| did not have a chance to be used. |
1840 EXPECT_EQ(new_web_contents->GetSiteInstance(), site_instance1); | 1838 EXPECT_EQ(new_web_contents->GetSiteInstance(), site_instance1); |
1841 EXPECT_EQ(BINDINGS_POLICY_WEB_UI, | 1839 EXPECT_EQ(BINDINGS_POLICY_WEB_UI, |
1842 new_web_contents->GetRenderViewHost()->GetEnabledBindings()); | 1840 new_web_contents->GetMainFrame()->GetEnabledBindings()); |
1843 } | 1841 } |
1844 | 1842 |
1845 // crbug.com/424526 | 1843 // crbug.com/424526 |
1846 // The test loads a WebUI page in process-per-tab mode, then navigates to a | 1844 // The test loads a WebUI page in process-per-tab mode, then navigates to a |
1847 // blank page and then to a regular page. The bug reproduces if blank page is | 1845 // blank page and then to a regular page. The bug reproduces if blank page is |
1848 // visited in between WebUI and regular page. | 1846 // visited in between WebUI and regular page. |
1849 IN_PROC_BROWSER_TEST_F(RenderFrameHostManagerTest, | 1847 IN_PROC_BROWSER_TEST_F(RenderFrameHostManagerTest, |
1850 ForceSwapAfterWebUIBindings) { | 1848 ForceSwapAfterWebUIBindings) { |
1851 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 1849 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
1852 switches::kProcessPerTab); | 1850 switches::kProcessPerTab); |
(...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3025 // the iframe's old RFH still has correct origin, even though it's pending | 3023 // the iframe's old RFH still has correct origin, even though it's pending |
3026 // deletion. | 3024 // deletion. |
3027 if (AreAllSitesIsolatedForTesting()) { | 3025 if (AreAllSitesIsolatedForTesting()) { |
3028 EXPECT_FALSE(child_rfh_b->is_active()); | 3026 EXPECT_FALSE(child_rfh_b->is_active()); |
3029 EXPECT_NE(child_rfh_b, child->current_frame_host()); | 3027 EXPECT_NE(child_rfh_b, child->current_frame_host()); |
3030 EXPECT_EQ(url::Origin(url_b), child_rfh_b->GetLastCommittedOrigin()); | 3028 EXPECT_EQ(url::Origin(url_b), child_rfh_b->GetLastCommittedOrigin()); |
3031 } | 3029 } |
3032 } | 3030 } |
3033 | 3031 |
3034 } // namespace content | 3032 } // namespace content |
OLD | NEW |