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 1722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1733 IN_PROC_BROWSER_TEST_F(RenderFrameHostManagerTest, | 1733 IN_PROC_BROWSER_TEST_F(RenderFrameHostManagerTest, |
1734 MAYBE_ClearPendingWebUIOnCommit) { | 1734 MAYBE_ClearPendingWebUIOnCommit) { |
1735 // Visit a WebUI page with bindings. | 1735 // Visit a WebUI page with bindings. |
1736 GURL webui_url(GURL(std::string(kChromeUIScheme) + "://" + | 1736 GURL webui_url(GURL(std::string(kChromeUIScheme) + "://" + |
1737 std::string(kChromeUIGpuHost))); | 1737 std::string(kChromeUIGpuHost))); |
1738 NavigateToURL(shell(), webui_url); | 1738 NavigateToURL(shell(), webui_url); |
1739 EXPECT_TRUE(ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( | 1739 EXPECT_TRUE(ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( |
1740 shell()->web_contents()->GetRenderProcessHost()->GetID())); | 1740 shell()->web_contents()->GetRenderProcessHost()->GetID())); |
1741 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( | 1741 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( |
1742 shell()->web_contents()); | 1742 shell()->web_contents()); |
1743 WebUIImpl* webui = web_contents->GetRenderManagerForTesting()->web_ui(); | 1743 FrameTreeNode* root = web_contents->GetFrameTree()->root(); |
| 1744 WebUIImpl* webui = root->current_frame_host()->web_ui(); |
1744 EXPECT_TRUE(webui); | 1745 EXPECT_TRUE(webui); |
1745 EXPECT_FALSE(web_contents->GetRenderManagerForTesting()->pending_web_ui()); | 1746 EXPECT_FALSE( |
| 1747 web_contents->GetRenderManagerForTesting()->GetNavigatingWebUI()); |
1746 | 1748 |
1747 // Navigate to another WebUI URL that reuses the WebUI object. Make sure we | 1749 // Navigate to another WebUI URL that reuses the WebUI object. Make sure we |
1748 // clear pending_web_ui() when it commits. | 1750 // clear GetNavigatingWebUI() when it commits. |
1749 GURL webui_url2(webui_url.spec() + "#foo"); | 1751 GURL webui_url2(webui_url.spec() + "#foo"); |
1750 NavigateToURL(shell(), webui_url2); | 1752 NavigateToURL(shell(), webui_url2); |
1751 EXPECT_EQ(webui, web_contents->GetRenderManagerForTesting()->web_ui()); | 1753 EXPECT_EQ(webui, root->current_frame_host()->web_ui()); |
1752 EXPECT_FALSE(web_contents->GetRenderManagerForTesting()->pending_web_ui()); | 1754 EXPECT_FALSE( |
| 1755 web_contents->GetRenderManagerForTesting()->GetNavigatingWebUI()); |
1753 } | 1756 } |
1754 | 1757 |
1755 class RFHMProcessPerTabTest : public RenderFrameHostManagerTest { | 1758 class RFHMProcessPerTabTest : public RenderFrameHostManagerTest { |
1756 public: | 1759 public: |
1757 RFHMProcessPerTabTest() {} | 1760 RFHMProcessPerTabTest() {} |
1758 | 1761 |
1759 void SetUpCommandLine(base::CommandLine* command_line) override { | 1762 void SetUpCommandLine(base::CommandLine* command_line) override { |
1760 command_line->AppendSwitch(switches::kProcessPerTab); | 1763 command_line->AppendSwitch(switches::kProcessPerTab); |
1761 } | 1764 } |
1762 }; | 1765 }; |
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2404 popup_root->current_frame_host()->render_view_host()->IsRenderViewLive()); | 2407 popup_root->current_frame_host()->render_view_host()->IsRenderViewLive()); |
2405 | 2408 |
2406 // Navigate the main tab to the site of the popup. This will cause the | 2409 // Navigate the main tab to the site of the popup. This will cause the |
2407 // RenderView for b.com in the main tab to be recreated. If the issue | 2410 // RenderView for b.com in the main tab to be recreated. If the issue |
2408 // is not fixed, this will result in process crash and failing test. | 2411 // is not fixed, this will result in process crash and failing test. |
2409 EXPECT_TRUE(NavigateToURL( | 2412 EXPECT_TRUE(NavigateToURL( |
2410 shell(), embedded_test_server()->GetURL("b.com", "/title3.html"))); | 2413 shell(), embedded_test_server()->GetURL("b.com", "/title3.html"))); |
2411 } | 2414 } |
2412 | 2415 |
2413 } // namespace content | 2416 } // namespace content |
OLD | NEW |