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 // crbug.com/424526 |
| 1477 // The test loads a WebUI page in rocess-per-tab mode, then navigates to a blank |
| 1478 // page and then to a regular page. The bug reproduces if blank page is visited |
| 1479 // in between WebUI and regular page. |
| 1480 IN_PROC_BROWSER_TEST_F(RenderFrameHostManagerTest, |
| 1481 ForceSwapAfterWebUIBindings) { |
| 1482 CommandLine::ForCurrentProcess()->AppendSwitch(switches::kProcessPerTab); |
| 1483 ASSERT_TRUE(test_server()->Start()); |
| 1484 |
| 1485 const GURL web_ui_url(std::string(kChromeUIScheme) + "://" + |
| 1486 std::string(kChromeUIGpuHost)); |
| 1487 NavigateToURL(shell(), web_ui_url); |
| 1488 EXPECT_TRUE(ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( |
| 1489 shell()->web_contents()->GetRenderProcessHost()->GetID())); |
| 1490 |
| 1491 NavigateToURL(shell(), GURL(url::kAboutBlankURL)); |
| 1492 |
| 1493 GURL regular_page_url(test_server()->GetURL("files/title2.html")); |
| 1494 NavigateToURL(shell(), regular_page_url); |
| 1495 EXPECT_FALSE(ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( |
| 1496 shell()->web_contents()->GetRenderProcessHost()->GetID())); |
| 1497 } |
| 1498 |
1476 } // namespace content | 1499 } // namespace content |
OLD | NEW |