| 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 1527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 WebUIImpl* webui = web_contents->GetRenderManagerForTesting()->web_ui(); |
| 1547 EXPECT_TRUE(webui); | 1547 EXPECT_TRUE(webui); |
| 1548 EXPECT_FALSE( | 1548 EXPECT_FALSE(web_contents->GetRenderManagerForTesting()->pending_web_ui()); |
| 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 pending_web_ui() when it commits. |
| 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, web_contents->GetRenderManagerForTesting()->web_ui()); |
| 1556 EXPECT_FALSE( | 1555 EXPECT_FALSE(web_contents->GetRenderManagerForTesting()->pending_web_ui()); |
| 1557 web_contents->GetRenderManagerForTesting()->GetNavigatingWebUI()); | |
| 1558 } | 1556 } |
| 1559 | 1557 |
| 1560 class RFHMProcessPerTabTest : public RenderFrameHostManagerTest { | 1558 class RFHMProcessPerTabTest : public RenderFrameHostManagerTest { |
| 1561 public: | 1559 public: |
| 1562 RFHMProcessPerTabTest() {} | 1560 RFHMProcessPerTabTest() {} |
| 1563 | 1561 |
| 1564 void SetUpCommandLine(base::CommandLine* command_line) override { | 1562 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 1565 command_line->AppendSwitch(switches::kProcessPerTab); | 1563 command_line->AppendSwitch(switches::kProcessPerTab); |
| 1566 } | 1564 } |
| 1567 }; | 1565 }; |
| (...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2209 popup_root->current_frame_host()->render_view_host()->IsRenderViewLive()); | 2207 popup_root->current_frame_host()->render_view_host()->IsRenderViewLive()); |
| 2210 | 2208 |
| 2211 // Navigate the main tab to the site of the popup. This will cause the | 2209 // 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 | 2210 // 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. | 2211 // is not fixed, this will result in process crash and failing test. |
| 2214 EXPECT_TRUE(NavigateToURL( | 2212 EXPECT_TRUE(NavigateToURL( |
| 2215 shell(), embedded_test_server()->GetURL("b.com", "/title3.html"))); | 2213 shell(), embedded_test_server()->GetURL("b.com", "/title3.html"))); |
| 2216 } | 2214 } |
| 2217 | 2215 |
| 2218 } // namespace content | 2216 } // namespace content |
| OLD | NEW |