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 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1422 GURL webui_url2(webui_url.spec() + "#foo"); | 1422 GURL webui_url2(webui_url.spec() + "#foo"); |
1423 NavigateToURL(shell(), webui_url2); | 1423 NavigateToURL(shell(), webui_url2); |
1424 EXPECT_EQ(webui, web_contents->GetRenderManagerForTesting()->web_ui()); | 1424 EXPECT_EQ(webui, web_contents->GetRenderManagerForTesting()->web_ui()); |
1425 EXPECT_FALSE(web_contents->GetRenderManagerForTesting()->pending_web_ui()); | 1425 EXPECT_FALSE(web_contents->GetRenderManagerForTesting()->pending_web_ui()); |
1426 } | 1426 } |
1427 | 1427 |
1428 class RFHMProcessPerTabTest : public RenderFrameHostManagerTest { | 1428 class RFHMProcessPerTabTest : public RenderFrameHostManagerTest { |
1429 public: | 1429 public: |
1430 RFHMProcessPerTabTest() {} | 1430 RFHMProcessPerTabTest() {} |
1431 | 1431 |
1432 void SetUpCommandLine(CommandLine* command_line) override { | 1432 void SetUpCommandLine(base::CommandLine* command_line) override { |
1433 command_line->AppendSwitch(switches::kProcessPerTab); | 1433 command_line->AppendSwitch(switches::kProcessPerTab); |
1434 } | 1434 } |
1435 }; | 1435 }; |
1436 | 1436 |
1437 // Test that we still swap processes for BrowsingInstance changes even in | 1437 // Test that we still swap processes for BrowsingInstance changes even in |
1438 // --process-per-tab mode. See http://crbug.com/343017. | 1438 // --process-per-tab mode. See http://crbug.com/343017. |
1439 // Disabled on Android: http://crbug.com/345873. | 1439 // Disabled on Android: http://crbug.com/345873. |
1440 // Crashes under ThreadSanitizer, http://crbug.com/356758. | 1440 // Crashes under ThreadSanitizer, http://crbug.com/356758. |
1441 #if defined(OS_ANDROID) || defined(THREAD_SANITIZER) | 1441 #if defined(OS_ANDROID) || defined(THREAD_SANITIZER) |
1442 #define MAYBE_BackFromWebUI DISABLED_BackFromWebUI | 1442 #define MAYBE_BackFromWebUI DISABLED_BackFromWebUI |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1511 EXPECT_EQ(BINDINGS_POLICY_WEB_UI, | 1511 EXPECT_EQ(BINDINGS_POLICY_WEB_UI, |
1512 new_web_contents->GetRenderViewHost()->GetEnabledBindings()); | 1512 new_web_contents->GetRenderViewHost()->GetEnabledBindings()); |
1513 } | 1513 } |
1514 | 1514 |
1515 // crbug.com/424526 | 1515 // crbug.com/424526 |
1516 // The test loads a WebUI page in rocess-per-tab mode, then navigates to a blank | 1516 // The test loads a WebUI page in rocess-per-tab mode, then navigates to a blank |
1517 // page and then to a regular page. The bug reproduces if blank page is visited | 1517 // page and then to a regular page. The bug reproduces if blank page is visited |
1518 // in between WebUI and regular page. | 1518 // in between WebUI and regular page. |
1519 IN_PROC_BROWSER_TEST_F(RenderFrameHostManagerTest, | 1519 IN_PROC_BROWSER_TEST_F(RenderFrameHostManagerTest, |
1520 ForceSwapAfterWebUIBindings) { | 1520 ForceSwapAfterWebUIBindings) { |
1521 CommandLine::ForCurrentProcess()->AppendSwitch(switches::kProcessPerTab); | 1521 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| 1522 switches::kProcessPerTab); |
1522 ASSERT_TRUE(test_server()->Start()); | 1523 ASSERT_TRUE(test_server()->Start()); |
1523 | 1524 |
1524 const GURL web_ui_url(std::string(kChromeUIScheme) + "://" + | 1525 const GURL web_ui_url(std::string(kChromeUIScheme) + "://" + |
1525 std::string(kChromeUIGpuHost)); | 1526 std::string(kChromeUIGpuHost)); |
1526 NavigateToURL(shell(), web_ui_url); | 1527 NavigateToURL(shell(), web_ui_url); |
1527 EXPECT_TRUE(ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( | 1528 EXPECT_TRUE(ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( |
1528 shell()->web_contents()->GetRenderProcessHost()->GetID())); | 1529 shell()->web_contents()->GetRenderProcessHost()->GetID())); |
1529 | 1530 |
1530 NavigateToURL(shell(), GURL(url::kAboutBlankURL)); | 1531 NavigateToURL(shell(), GURL(url::kAboutBlankURL)); |
1531 | 1532 |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1663 back_nav_load_observer.Wait(); | 1664 back_nav_load_observer.Wait(); |
1664 EXPECT_NE(process_id, | 1665 EXPECT_NE(process_id, |
1665 shell()->web_contents()->GetRenderProcessHost()->GetID()); | 1666 shell()->web_contents()->GetRenderProcessHost()->GetID()); |
1666 | 1667 |
1667 // Ensure that the file access still exists in the new process ID. | 1668 // Ensure that the file access still exists in the new process ID. |
1668 EXPECT_TRUE(ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile( | 1669 EXPECT_TRUE(ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile( |
1669 shell()->web_contents()->GetRenderProcessHost()->GetID(), file)); | 1670 shell()->web_contents()->GetRenderProcessHost()->GetID(), file)); |
1670 } | 1671 } |
1671 | 1672 |
1672 } // namespace content | 1673 } // namespace content |
OLD | NEW |