Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Side by Side Diff: content/browser/frame_host/render_frame_host_manager_browsertest.cc

Issue 1418853003: Remove RFHM::GetNavigatingWebUI() and RFHM::web_ui(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@webui-refactor
Patch Set: Addressed nits. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1526 matching lines...) Expand 10 before | Expand all | Expand 10 after
1537 IN_PROC_BROWSER_TEST_F(RenderFrameHostManagerTest, 1537 IN_PROC_BROWSER_TEST_F(RenderFrameHostManagerTest,
1538 MAYBE_ClearPendingWebUIOnCommit) { 1538 MAYBE_ClearPendingWebUIOnCommit) {
1539 // Visit a WebUI page with bindings. 1539 // Visit a WebUI page with bindings.
1540 GURL webui_url(GURL(std::string(kChromeUIScheme) + "://" + 1540 GURL webui_url(GURL(std::string(kChromeUIScheme) + "://" +
1541 std::string(kChromeUIGpuHost))); 1541 std::string(kChromeUIGpuHost)));
1542 NavigateToURL(shell(), webui_url); 1542 NavigateToURL(shell(), webui_url);
1543 EXPECT_TRUE(ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( 1543 EXPECT_TRUE(ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings(
1544 shell()->web_contents()->GetRenderProcessHost()->GetID())); 1544 shell()->web_contents()->GetRenderProcessHost()->GetID()));
1545 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( 1545 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(
1546 shell()->web_contents()); 1546 shell()->web_contents());
1547 WebUIImpl* webui = web_contents->GetRenderManagerForTesting()->web_ui(); 1547 FrameTreeNode* root = web_contents->GetFrameTree()->root();
1548 WebUIImpl* webui = root->current_frame_host()->web_ui();
1548 EXPECT_TRUE(webui); 1549 EXPECT_TRUE(webui);
1549 EXPECT_FALSE(
1550 web_contents->GetRenderManagerForTesting()->GetNavigatingWebUI());
1551 1550
1552 // Navigate to another WebUI URL that reuses the WebUI object. Make sure we 1551 // Navigate to another WebUI URL that reuses the WebUI object.
1553 // clear GetNavigatingWebUI() when it commits.
1554 GURL webui_url2(webui_url.spec() + "#foo"); 1552 GURL webui_url2(webui_url.spec() + "#foo");
1555 NavigateToURL(shell(), webui_url2); 1553 NavigateToURL(shell(), webui_url2);
1556 EXPECT_EQ(webui, web_contents->GetRenderManagerForTesting()->web_ui()); 1554 EXPECT_EQ(webui, root->current_frame_host()->web_ui());
1557 EXPECT_FALSE(
1558 web_contents->GetRenderManagerForTesting()->GetNavigatingWebUI());
1559 } 1555 }
1560 1556
1561 class RFHMProcessPerTabTest : public RenderFrameHostManagerTest { 1557 class RFHMProcessPerTabTest : public RenderFrameHostManagerTest {
1562 public: 1558 public:
1563 RFHMProcessPerTabTest() {} 1559 RFHMProcessPerTabTest() {}
1564 1560
1565 void SetUpCommandLine(base::CommandLine* command_line) override { 1561 void SetUpCommandLine(base::CommandLine* command_line) override {
1566 command_line->AppendSwitch(switches::kProcessPerTab); 1562 command_line->AppendSwitch(switches::kProcessPerTab);
1567 } 1563 }
1568 }; 1564 };
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
2210 popup_root->current_frame_host()->render_view_host()->IsRenderViewLive()); 2206 popup_root->current_frame_host()->render_view_host()->IsRenderViewLive());
2211 2207
2212 // Navigate the main tab to the site of the popup. This will cause the 2208 // Navigate the main tab to the site of the popup. This will cause the
2213 // RenderView for b.com in the main tab to be recreated. If the issue 2209 // RenderView for b.com in the main tab to be recreated. If the issue
2214 // is not fixed, this will result in process crash and failing test. 2210 // is not fixed, this will result in process crash and failing test.
2215 EXPECT_TRUE(NavigateToURL( 2211 EXPECT_TRUE(NavigateToURL(
2216 shell(), embedded_test_server()->GetURL("b.com", "/title3.html"))); 2212 shell(), embedded_test_server()->GetURL("b.com", "/title3.html")));
2217 } 2213 }
2218 2214
2219 } // namespace content 2215 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698