 Chromium Code Reviews
 Chromium Code Reviews Issue 659293002:
  Make sure new render is used when navigating away from about:blank in WebUI renderer.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 659293002:
  Make sure new render is used when navigating away from about:blank in WebUI renderer.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| 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/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" | 
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" | 
| (...skipping 1455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1466 | 1466 | 
| 1467 // Navigate to url1 and check bindings. | 1467 // Navigate to url1 and check bindings. | 
| 1468 NavigateToURL(new_shell, url1); | 1468 NavigateToURL(new_shell, url1); | 
| 1469 // The navigation should have used the first SiteInstance, otherwise | 1469 // The navigation should have used the first SiteInstance, otherwise | 
| 1470 // |initial_rvh| did not have a chance to be used. | 1470 // |initial_rvh| did not have a chance to be used. | 
| 1471 EXPECT_EQ(new_web_contents->GetSiteInstance(), site_instance1); | 1471 EXPECT_EQ(new_web_contents->GetSiteInstance(), site_instance1); | 
| 1472 EXPECT_EQ(BINDINGS_POLICY_WEB_UI, | 1472 EXPECT_EQ(BINDINGS_POLICY_WEB_UI, | 
| 1473 new_web_contents->GetRenderViewHost()->GetEnabledBindings()); | 1473 new_web_contents->GetRenderViewHost()->GetEnabledBindings()); | 
| 1474 } | 1474 } | 
| 1475 | 1475 | 
| 1476 IN_PROC_BROWSER_TEST_F( | |
| 1477 RenderFrameHostManagerTest, | |
| 1478 NavigationFromWebUIToRegularPageInterleavedWithBlankPageProcessPerTab) { | |
| 
Charlie Reis
2014/10/20 19:37:54
Can we come up with a shorter test name, like Forc
 
Krzysztof Olczyk
2014/10/21 08:27:05
Done. I called it ForceSwapAfterWebUIBindings as I
 | |
| 1479 CommandLine::ForCurrentProcess()->AppendSwitch(switches::kProcessPerTab); | |
| 1480 ASSERT_TRUE(test_server()->Start()); | |
| 1481 | |
| 1482 const GURL web_ui_url(std::string(kChromeUIScheme) + "://" + | |
| 1483 std::string(kChromeUIGpuHost)); | |
| 1484 NavigateToURL(shell(), web_ui_url); | |
| 1485 EXPECT_TRUE(ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( | |
| 1486 shell()->web_contents()->GetRenderProcessHost()->GetID())); | |
| 1487 | |
| 1488 NavigateToURL(shell(), GURL(url::kAboutBlankURL)); | |
| 1489 | |
| 1490 GURL regular_page_url(test_server()->GetURL("files/title2.html")); | |
| 1491 NavigateToURL(shell(), regular_page_url); | |
| 1492 EXPECT_FALSE(ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( | |
| 1493 shell()->web_contents()->GetRenderProcessHost()->GetID())); | |
| 1494 } | |
| 1495 | |
| 1476 } // namespace content | 1496 } // namespace content | 
| OLD | NEW |