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 "content/browser/renderer_host/render_process_host_impl.h" | 5 #include "content/browser/renderer_host/render_process_host_impl.h" |
6 #include "content/common/child_process_messages.h" | 6 #include "content/common/child_process_messages.h" |
7 #include "content/public/browser/render_process_host.h" | 7 #include "content/public/browser/render_process_host.h" |
8 #include "content/public/browser/render_process_host_observer.h" | 8 #include "content/public/browser/render_process_host_observer.h" |
9 #include "content/public/browser/render_view_host.h" | 9 #include "content/public/browser/render_view_host.h" |
10 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 // Set max renderers to 1 to force running out of processes. | 85 // Set max renderers to 1 to force running out of processes. |
86 content::RenderProcessHost::SetMaxRendererProcessCount(1); | 86 content::RenderProcessHost::SetMaxRendererProcessCount(1); |
87 | 87 |
88 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 88 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
89 | 89 |
90 GURL test_url = embedded_test_server()->GetURL("/simple_page.html"); | 90 GURL test_url = embedded_test_server()->GetURL("/simple_page.html"); |
91 NavigateToURL(shell(), test_url); | 91 NavigateToURL(shell(), test_url); |
92 RenderProcessHost* rph = | 92 RenderProcessHost* rph = |
93 shell()->web_contents()->GetRenderViewHost()->GetProcess(); | 93 shell()->web_contents()->GetRenderViewHost()->GetProcess(); |
94 // Make it believe it's a guest. | 94 // Make it believe it's a guest. |
95 reinterpret_cast<RenderProcessHostImpl*>(rph)->SetIsGuestForTesting(true); | 95 reinterpret_cast<RenderProcessHostImpl*>(rph)-> |
| 96 set_is_isolated_guest_for_testing(true); |
96 EXPECT_EQ(1, RenderProcessHostCount()); | 97 EXPECT_EQ(1, RenderProcessHostCount()); |
97 | 98 |
98 // Navigate to a different page. | 99 // Navigate to a different page. |
99 GURL::Replacements replace_host; | 100 GURL::Replacements replace_host; |
100 std::string host_str("localhost"); // Must stay in scope with replace_host. | 101 std::string host_str("localhost"); // Must stay in scope with replace_host. |
101 replace_host.SetHostStr(host_str); | 102 replace_host.SetHostStr(host_str); |
102 GURL another_url = embedded_test_server()->GetURL("/simple_page.html"); | 103 GURL another_url = embedded_test_server()->GetURL("/simple_page.html"); |
103 another_url = another_url.ReplaceComponents(replace_host); | 104 another_url = another_url.ReplaceComponents(replace_host); |
104 NavigateToURL(CreateBrowser(), another_url); | 105 NavigateToURL(CreateBrowser(), another_url); |
105 | 106 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 // If the test fails, and somehow the RPH is still alive somehow, at least | 187 // If the test fails, and somehow the RPH is still alive somehow, at least |
187 // deregister the observers so that the test fails and doesn't also crash. | 188 // deregister the observers so that the test fails and doesn't also crash. |
188 if (!observer_logger.host_destroyed()) { | 189 if (!observer_logger.host_destroyed()) { |
189 rph->RemoveObserver(&shell_closer); | 190 rph->RemoveObserver(&shell_closer); |
190 rph->RemoveObserver(&observer_logger); | 191 rph->RemoveObserver(&observer_logger); |
191 } | 192 } |
192 } | 193 } |
193 | 194 |
194 } // namespace | 195 } // namespace |
195 } // namespace content | 196 } // namespace content |
OLD | NEW |