| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "base/test/histogram_tester.h" | 8 #include "base/test/histogram_tester.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "content/browser/compositor/test/no_transport_image_transport_factory.h
" | 10 #include "content/browser/compositor/test/no_transport_image_transport_factory.h
" |
| (...skipping 1607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1618 opener1_manager->GetSwappedOutRenderViewHost(rfh1->GetSiteInstance()) | 1618 opener1_manager->GetSwappedOutRenderViewHost(rfh1->GetSiteInstance()) |
| 1619 ->IsRenderViewLive()); | 1619 ->IsRenderViewLive()); |
| 1620 | 1620 |
| 1621 // Reload the initial tab. This should recreate the opener's swapped out RVH | 1621 // Reload the initial tab. This should recreate the opener's swapped out RVH |
| 1622 // in the original SiteInstance. | 1622 // in the original SiteInstance. |
| 1623 contents()->GetController().Reload(true); | 1623 contents()->GetController().Reload(true); |
| 1624 contents()->GetMainFrame()->PrepareForCommit(); | 1624 contents()->GetMainFrame()->PrepareForCommit(); |
| 1625 EXPECT_TRUE( | 1625 EXPECT_TRUE( |
| 1626 opener1_manager->GetSwappedOutRenderViewHost(rfh1->GetSiteInstance()) | 1626 opener1_manager->GetSwappedOutRenderViewHost(rfh1->GetSiteInstance()) |
| 1627 ->IsRenderViewLive()); | 1627 ->IsRenderViewLive()); |
| 1628 EXPECT_EQ(opener1_manager->GetSwappedOutRenderViewHost( | 1628 EXPECT_EQ( |
| 1629 rfh1->GetSiteInstance())->GetRoutingID(), | 1629 opener1_manager->GetRoutingIdForSiteInstance(rfh1->GetSiteInstance()), |
| 1630 contents()->GetMainFrame()->GetRenderViewHost()->opener_route_id()); | 1630 contents()->GetMainFrame()->GetRenderViewHost()->opener_frame_route_id()); |
| 1631 } | 1631 } |
| 1632 | 1632 |
| 1633 // Test that RenderViewHosts created for WebUI navigations are properly | 1633 // Test that RenderViewHosts created for WebUI navigations are properly |
| 1634 // granted WebUI bindings even if an unprivileged swapped out RenderViewHost | 1634 // granted WebUI bindings even if an unprivileged swapped out RenderViewHost |
| 1635 // is in the same process (http://crbug.com/79918). | 1635 // is in the same process (http://crbug.com/79918). |
| 1636 TEST_F(RenderFrameHostManagerTest, EnableWebUIWithSwappedOutOpener) { | 1636 TEST_F(RenderFrameHostManagerTest, EnableWebUIWithSwappedOutOpener) { |
| 1637 set_should_create_webui(true); | 1637 set_should_create_webui(true); |
| 1638 const GURL kSettingsUrl("chrome://chrome/settings"); | 1638 const GURL kSettingsUrl("chrome://chrome/settings"); |
| 1639 const GURL kPluginUrl("chrome://plugins"); | 1639 const GURL kPluginUrl("chrome://plugins"); |
| 1640 | 1640 |
| (...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2215 EXPECT_FALSE(contents2->GetMainFrame()->IsRenderFrameLive()); | 2215 EXPECT_FALSE(contents2->GetMainFrame()->IsRenderFrameLive()); |
| 2216 contents2->NavigateAndCommit(kUrl3); | 2216 contents2->NavigateAndCommit(kUrl3); |
| 2217 EXPECT_TRUE(contents2->GetMainFrame()->IsRenderFrameLive()); | 2217 EXPECT_TRUE(contents2->GetMainFrame()->IsRenderFrameLive()); |
| 2218 EXPECT_NE(nullptr, | 2218 EXPECT_NE(nullptr, |
| 2219 iframe->GetRenderFrameProxyHost(contents1->GetSiteInstance())); | 2219 iframe->GetRenderFrameProxyHost(contents1->GetSiteInstance())); |
| 2220 EXPECT_EQ(nullptr, | 2220 EXPECT_EQ(nullptr, |
| 2221 iframe->GetRenderFrameProxyHost(contents2->GetSiteInstance())); | 2221 iframe->GetRenderFrameProxyHost(contents2->GetSiteInstance())); |
| 2222 } | 2222 } |
| 2223 | 2223 |
| 2224 } // namespace content | 2224 } // namespace content |
| OLD | NEW |