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 WebUIImpl* webui = web_contents->GetRenderManagerForTesting()->web_ui(); | 1693 FrameTreeNode* root = web_contents->GetFrameTree()->root(); |
| 1694 WebUIImpl* webui = root->current_frame_host()->web_ui(); |
1694 EXPECT_TRUE(webui); | 1695 EXPECT_TRUE(webui); |
1695 EXPECT_FALSE(web_contents->GetRenderManagerForTesting()->pending_web_ui()); | 1696 EXPECT_FALSE( |
| 1697 web_contents->GetRenderManagerForTesting()->GetNavigatingWebUI()); |
1696 | 1698 |
1697 // Navigate to another WebUI URL that reuses the WebUI object. Make sure we | 1699 // Navigate to another WebUI URL that reuses the WebUI object. Make sure we |
1698 // clear pending_web_ui() when it commits. | 1700 // clear GetNavigatingWebUI() when it commits. |
1699 GURL webui_url2(webui_url.spec() + "#foo"); | 1701 GURL webui_url2(webui_url.spec() + "#foo"); |
1700 NavigateToURL(shell(), webui_url2); | 1702 NavigateToURL(shell(), webui_url2); |
1701 EXPECT_EQ(webui, web_contents->GetRenderManagerForTesting()->web_ui()); | 1703 EXPECT_EQ(webui, root->current_frame_host()->web_ui()); |
1702 EXPECT_FALSE(web_contents->GetRenderManagerForTesting()->pending_web_ui()); | 1704 EXPECT_FALSE( |
| 1705 web_contents->GetRenderManagerForTesting()->GetNavigatingWebUI()); |
1703 } | 1706 } |
1704 | 1707 |
1705 class RFHMProcessPerTabTest : public RenderFrameHostManagerTest { | 1708 class RFHMProcessPerTabTest : public RenderFrameHostManagerTest { |
1706 public: | 1709 public: |
1707 RFHMProcessPerTabTest() {} | 1710 RFHMProcessPerTabTest() {} |
1708 | 1711 |
1709 void SetUpCommandLine(base::CommandLine* command_line) override { | 1712 void SetUpCommandLine(base::CommandLine* command_line) override { |
1710 command_line->AppendSwitch(switches::kProcessPerTab); | 1713 command_line->AppendSwitch(switches::kProcessPerTab); |
1711 } | 1714 } |
1712 }; | 1715 }; |
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2354 popup_root->current_frame_host()->render_view_host()->IsRenderViewLive()); | 2357 popup_root->current_frame_host()->render_view_host()->IsRenderViewLive()); |
2355 | 2358 |
2356 // Navigate the main tab to the site of the popup. This will cause the | 2359 // Navigate the main tab to the site of the popup. This will cause the |
2357 // RenderView for b.com in the main tab to be recreated. If the issue | 2360 // RenderView for b.com in the main tab to be recreated. If the issue |
2358 // is not fixed, this will result in process crash and failing test. | 2361 // is not fixed, this will result in process crash and failing test. |
2359 EXPECT_TRUE(NavigateToURL( | 2362 EXPECT_TRUE(NavigateToURL( |
2360 shell(), embedded_test_server()->GetURL("b.com", "/title3.html"))); | 2363 shell(), embedded_test_server()->GetURL("b.com", "/title3.html"))); |
2361 } | 2364 } |
2362 | 2365 |
2363 } // namespace content | 2366 } // namespace content |
OLD | NEW |