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

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

Issue 1426403006: Reland #1 of: Move WebUI ownership from the RenderFrameHostManager to the RenderFrameHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 1528 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 WebUIImpl* webui = web_contents->GetRenderManagerForTesting()->web_ui();
1548 EXPECT_TRUE(webui); 1548 EXPECT_TRUE(webui);
1549 EXPECT_FALSE(web_contents->GetRenderManagerForTesting()->pending_web_ui()); 1549 EXPECT_FALSE(
1550 web_contents->GetRenderManagerForTesting()->GetNavigatingWebUI());
1550 1551
1551 // Navigate to another WebUI URL that reuses the WebUI object. Make sure we 1552 // Navigate to another WebUI URL that reuses the WebUI object. Make sure we
1552 // clear pending_web_ui() when it commits. 1553 // clear GetNavigatingWebUI() when it commits.
1553 GURL webui_url2(webui_url.spec() + "#foo"); 1554 GURL webui_url2(webui_url.spec() + "#foo");
1554 NavigateToURL(shell(), webui_url2); 1555 NavigateToURL(shell(), webui_url2);
1555 EXPECT_EQ(webui, web_contents->GetRenderManagerForTesting()->web_ui()); 1556 EXPECT_EQ(webui, web_contents->GetRenderManagerForTesting()->web_ui());
1556 EXPECT_FALSE(web_contents->GetRenderManagerForTesting()->pending_web_ui()); 1557 EXPECT_FALSE(
1558 web_contents->GetRenderManagerForTesting()->GetNavigatingWebUI());
1557 } 1559 }
1558 1560
1559 class RFHMProcessPerTabTest : public RenderFrameHostManagerTest { 1561 class RFHMProcessPerTabTest : public RenderFrameHostManagerTest {
1560 public: 1562 public:
1561 RFHMProcessPerTabTest() {} 1563 RFHMProcessPerTabTest() {}
1562 1564
1563 void SetUpCommandLine(base::CommandLine* command_line) override { 1565 void SetUpCommandLine(base::CommandLine* command_line) override {
1564 command_line->AppendSwitch(switches::kProcessPerTab); 1566 command_line->AppendSwitch(switches::kProcessPerTab);
1565 } 1567 }
1566 }; 1568 };
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
2208 popup_root->current_frame_host()->render_view_host()->IsRenderViewLive()); 2210 popup_root->current_frame_host()->render_view_host()->IsRenderViewLive());
2209 2211
2210 // Navigate the main tab to the site of the popup. This will cause the 2212 // Navigate the main tab to the site of the popup. This will cause the
2211 // RenderView for b.com in the main tab to be recreated. If the issue 2213 // RenderView for b.com in the main tab to be recreated. If the issue
2212 // is not fixed, this will result in process crash and failing test. 2214 // is not fixed, this will result in process crash and failing test.
2213 EXPECT_TRUE(NavigateToURL( 2215 EXPECT_TRUE(NavigateToURL(
2214 shell(), embedded_test_server()->GetURL("b.com", "/title3.html"))); 2216 shell(), embedded_test_server()->GetURL("b.com", "/title3.html")));
2215 } 2217 }
2216 2218
2217 } // namespace content 2219 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698