| 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 <set> | 5 #include <set> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 1672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1683 IN_PROC_BROWSER_TEST_F(RenderFrameHostManagerTest, | 1683 IN_PROC_BROWSER_TEST_F(RenderFrameHostManagerTest, |
| 1684 MAYBE_ClearPendingWebUIOnCommit) { | 1684 MAYBE_ClearPendingWebUIOnCommit) { |
| 1685 // Visit a WebUI page with bindings. | 1685 // Visit a WebUI page with bindings. |
| 1686 GURL webui_url(GURL(std::string(kChromeUIScheme) + "://" + | 1686 GURL webui_url(GURL(std::string(kChromeUIScheme) + "://" + |
| 1687 std::string(kChromeUIGpuHost))); | 1687 std::string(kChromeUIGpuHost))); |
| 1688 NavigateToURL(shell(), webui_url); | 1688 NavigateToURL(shell(), webui_url); |
| 1689 EXPECT_TRUE(ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( | 1689 EXPECT_TRUE(ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( |
| 1690 shell()->web_contents()->GetRenderProcessHost()->GetID())); | 1690 shell()->web_contents()->GetRenderProcessHost()->GetID())); |
| 1691 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( | 1691 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( |
| 1692 shell()->web_contents()); | 1692 shell()->web_contents()); |
| 1693 FrameTreeNode* root = web_contents->GetFrameTree()->root(); | 1693 WebUIImpl* webui = web_contents->GetRenderManagerForTesting()->web_ui(); |
| 1694 WebUIImpl* webui = root->current_frame_host()->web_ui(); | |
| 1695 EXPECT_TRUE(webui); | 1694 EXPECT_TRUE(webui); |
| 1696 EXPECT_FALSE( | 1695 EXPECT_FALSE(web_contents->GetRenderManagerForTesting()->pending_web_ui()); |
| 1697 web_contents->GetRenderManagerForTesting()->GetNavigatingWebUI()); | |
| 1698 | 1696 |
| 1699 // Navigate to another WebUI URL that reuses the WebUI object. Make sure we | 1697 // Navigate to another WebUI URL that reuses the WebUI object. Make sure we |
| 1700 // clear GetNavigatingWebUI() when it commits. | 1698 // clear pending_web_ui() when it commits. |
| 1701 GURL webui_url2(webui_url.spec() + "#foo"); | 1699 GURL webui_url2(webui_url.spec() + "#foo"); |
| 1702 NavigateToURL(shell(), webui_url2); | 1700 NavigateToURL(shell(), webui_url2); |
| 1703 EXPECT_EQ(webui, root->current_frame_host()->web_ui()); | 1701 EXPECT_EQ(webui, web_contents->GetRenderManagerForTesting()->web_ui()); |
| 1704 EXPECT_FALSE( | 1702 EXPECT_FALSE(web_contents->GetRenderManagerForTesting()->pending_web_ui()); |
| 1705 web_contents->GetRenderManagerForTesting()->GetNavigatingWebUI()); | |
| 1706 } | 1703 } |
| 1707 | 1704 |
| 1708 class RFHMProcessPerTabTest : public RenderFrameHostManagerTest { | 1705 class RFHMProcessPerTabTest : public RenderFrameHostManagerTest { |
| 1709 public: | 1706 public: |
| 1710 RFHMProcessPerTabTest() {} | 1707 RFHMProcessPerTabTest() {} |
| 1711 | 1708 |
| 1712 void SetUpCommandLine(base::CommandLine* command_line) override { | 1709 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 1713 command_line->AppendSwitch(switches::kProcessPerTab); | 1710 command_line->AppendSwitch(switches::kProcessPerTab); |
| 1714 } | 1711 } |
| 1715 }; | 1712 }; |
| (...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2357 popup_root->current_frame_host()->render_view_host()->IsRenderViewLive()); | 2354 popup_root->current_frame_host()->render_view_host()->IsRenderViewLive()); |
| 2358 | 2355 |
| 2359 // Navigate the main tab to the site of the popup. This will cause the | 2356 // Navigate the main tab to the site of the popup. This will cause the |
| 2360 // RenderView for b.com in the main tab to be recreated. If the issue | 2357 // RenderView for b.com in the main tab to be recreated. If the issue |
| 2361 // is not fixed, this will result in process crash and failing test. | 2358 // is not fixed, this will result in process crash and failing test. |
| 2362 EXPECT_TRUE(NavigateToURL( | 2359 EXPECT_TRUE(NavigateToURL( |
| 2363 shell(), embedded_test_server()->GetURL("b.com", "/title3.html"))); | 2360 shell(), embedded_test_server()->GetURL("b.com", "/title3.html"))); |
| 2364 } | 2361 } |
| 2365 | 2362 |
| 2366 } // namespace content | 2363 } // namespace content |
| OLD | NEW |