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

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: Rebase. 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 1525 matching lines...) Expand 10 before | Expand all | Expand 10 after
1536 IN_PROC_BROWSER_TEST_F(RenderFrameHostManagerTest, 1536 IN_PROC_BROWSER_TEST_F(RenderFrameHostManagerTest,
1537 MAYBE_ClearPendingWebUIOnCommit) { 1537 MAYBE_ClearPendingWebUIOnCommit) {
1538 // Visit a WebUI page with bindings. 1538 // Visit a WebUI page with bindings.
1539 GURL webui_url(GURL(std::string(kChromeUIScheme) + "://" + 1539 GURL webui_url(GURL(std::string(kChromeUIScheme) + "://" +
1540 std::string(kChromeUIGpuHost))); 1540 std::string(kChromeUIGpuHost)));
1541 NavigateToURL(shell(), webui_url); 1541 NavigateToURL(shell(), webui_url);
1542 EXPECT_TRUE(ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( 1542 EXPECT_TRUE(ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings(
1543 shell()->web_contents()->GetRenderProcessHost()->GetID())); 1543 shell()->web_contents()->GetRenderProcessHost()->GetID()));
1544 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( 1544 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(
1545 shell()->web_contents()); 1545 shell()->web_contents());
1546 WebUIImpl* webui = web_contents->GetRenderManagerForTesting()->web_ui(); 1546 FrameTreeNode* root = web_contents->GetFrameTree()->root();
1547 WebUIImpl* webui = root->current_frame_host()->web_ui();
1547 EXPECT_TRUE(webui); 1548 EXPECT_TRUE(webui);
1548 EXPECT_FALSE(
1549 web_contents->GetRenderManagerForTesting()->GetNavigatingWebUI());
1550 1549
1551 // Navigate to another WebUI URL that reuses the WebUI object. Make sure we 1550 // Navigate to another WebUI URL that reuses the WebUI object. Make sure we
1552 // clear GetNavigatingWebUI() when it commits. 1551 // clear GetNavigatingWebUI() when it commits.
nasko 2015/11/04 17:23:26 This is stale comment now. GetNavigatingWebUI does
carlosk 2015/11/04 21:50:38 Done.
1553 GURL webui_url2(webui_url.spec() + "#foo"); 1552 GURL webui_url2(webui_url.spec() + "#foo");
1554 NavigateToURL(shell(), webui_url2); 1553 NavigateToURL(shell(), webui_url2);
1555 EXPECT_EQ(webui, web_contents->GetRenderManagerForTesting()->web_ui()); 1554 EXPECT_EQ(webui, root->current_frame_host()->web_ui());
1556 EXPECT_FALSE(
1557 web_contents->GetRenderManagerForTesting()->GetNavigatingWebUI());
1558 } 1555 }
1559 1556
1560 class RFHMProcessPerTabTest : public RenderFrameHostManagerTest { 1557 class RFHMProcessPerTabTest : public RenderFrameHostManagerTest {
1561 public: 1558 public:
1562 RFHMProcessPerTabTest() {} 1559 RFHMProcessPerTabTest() {}
1563 1560
1564 void SetUpCommandLine(base::CommandLine* command_line) override { 1561 void SetUpCommandLine(base::CommandLine* command_line) override {
1565 command_line->AppendSwitch(switches::kProcessPerTab); 1562 command_line->AppendSwitch(switches::kProcessPerTab);
1566 } 1563 }
1567 }; 1564 };
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
2209 popup_root->current_frame_host()->render_view_host()->IsRenderViewLive()); 2206 popup_root->current_frame_host()->render_view_host()->IsRenderViewLive());
2210 2207
2211 // 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
2212 // 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
2213 // 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.
2214 EXPECT_TRUE(NavigateToURL( 2211 EXPECT_TRUE(NavigateToURL(
2215 shell(), embedded_test_server()->GetURL("b.com", "/title3.html"))); 2212 shell(), embedded_test_server()->GetURL("b.com", "/title3.html")));
2216 } 2213 }
2217 2214
2218 } // namespace content 2215 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698