Chromium Code Reviews| 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 1813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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. | 1833 // The following condition is what was causing the bug. |
| 1834 EXPECT_EQ(0, initial_rvh->GetEnabledBindings()); | 1834 // EXPECT_EQ(0, initial_rvh->GetMainFrame()->GetEnabledBindings()); |
|
Charlie Reis
2016/12/16 01:01:52
Shouldn't comment this line out.
Sam McNally
2017/01/12 09:27:08
So it turns out that this RVH doesn't have a Rende
| |
| 1835 | 1835 |
| 1836 // Navigate to url1 and check bindings. | 1836 // Navigate to url1 and check bindings. |
| 1837 NavigateToURL(new_shell, url1); | 1837 NavigateToURL(new_shell, url1); |
| 1838 // The navigation should have used the first SiteInstance, otherwise | 1838 // The navigation should have used the first SiteInstance, otherwise |
| 1839 // |initial_rvh| did not have a chance to be used. | 1839 // |initial_rvh| did not have a chance to be used. |
| 1840 EXPECT_EQ(new_web_contents->GetSiteInstance(), site_instance1); | 1840 EXPECT_EQ(new_web_contents->GetSiteInstance(), site_instance1); |
| 1841 EXPECT_EQ(BINDINGS_POLICY_WEB_UI, | 1841 EXPECT_EQ(BINDINGS_POLICY_WEB_UI, |
| 1842 new_web_contents->GetRenderViewHost()->GetEnabledBindings()); | 1842 new_web_contents->GetMainFrame()->GetEnabledBindings()); |
| 1843 } | 1843 } |
| 1844 | 1844 |
| 1845 // crbug.com/424526 | 1845 // crbug.com/424526 |
| 1846 // The test loads a WebUI page in process-per-tab mode, then navigates to a | 1846 // 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 | 1847 // blank page and then to a regular page. The bug reproduces if blank page is |
| 1848 // visited in between WebUI and regular page. | 1848 // visited in between WebUI and regular page. |
| 1849 IN_PROC_BROWSER_TEST_F(RenderFrameHostManagerTest, | 1849 IN_PROC_BROWSER_TEST_F(RenderFrameHostManagerTest, |
| 1850 ForceSwapAfterWebUIBindings) { | 1850 ForceSwapAfterWebUIBindings) { |
| 1851 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 1851 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| 1852 switches::kProcessPerTab); | 1852 switches::kProcessPerTab); |
| (...skipping 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3024 // the iframe's old RFH still has correct origin, even though it's pending | 3024 // the iframe's old RFH still has correct origin, even though it's pending |
| 3025 // deletion. | 3025 // deletion. |
| 3026 if (AreAllSitesIsolatedForTesting()) { | 3026 if (AreAllSitesIsolatedForTesting()) { |
| 3027 EXPECT_FALSE(child_rfh_b->is_active()); | 3027 EXPECT_FALSE(child_rfh_b->is_active()); |
| 3028 EXPECT_NE(child_rfh_b, child->current_frame_host()); | 3028 EXPECT_NE(child_rfh_b, child->current_frame_host()); |
| 3029 EXPECT_EQ(url::Origin(url_b), child_rfh_b->GetLastCommittedOrigin()); | 3029 EXPECT_EQ(url::Origin(url_b), child_rfh_b->GetLastCommittedOrigin()); |
| 3030 } | 3030 } |
| 3031 } | 3031 } |
| 3032 | 3032 |
| 3033 } // namespace content | 3033 } // namespace content |
| OLD | NEW |