OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "chrome/browser/debugger/devtools_manager.h" | 6 #include "chrome/browser/debugger/devtools_manager.h" |
7 #include "chrome/browser/renderer_host/site_instance.h" | 7 #include "chrome/browser/renderer_host/site_instance.h" |
8 #include "chrome/browser/tab_contents/tab_contents.h" | 8 #include "chrome/browser/tab_contents/tab_contents.h" |
9 #include "chrome/browser/renderer_host/render_process_host.h" | 9 #include "chrome/browser/renderer_host/render_process_host.h" |
10 #include "chrome/browser/renderer_host/render_view_host.h" | 10 #include "chrome/browser/renderer_host/render_view_host.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 devtools, DEVTOOLS_TOGGLE_ACTION_INSPECT); | 176 devtools, DEVTOOLS_TOGGLE_ACTION_INSPECT); |
177 host_count++; | 177 host_count++; |
178 EXPECT_EQ(tab_count, browser()->tab_count()); | 178 EXPECT_EQ(tab_count, browser()->tab_count()); |
179 EXPECT_EQ(host_count, RenderProcessHostCount()); | 179 EXPECT_EQ(host_count, RenderProcessHostCount()); |
180 } | 180 } |
181 | 181 |
182 // When we hit the max number of renderers, verify that the way we do process | 182 // When we hit the max number of renderers, verify that the way we do process |
183 // sharing behaves correctly. In particular, this test is verifying that even | 183 // sharing behaves correctly. In particular, this test is verifying that even |
184 // when we hit the max process limit, that renderers of each type will wind up | 184 // when we hit the max process limit, that renderers of each type will wind up |
185 // in a process of that type, even if that means creating a new process. | 185 // in a process of that type, even if that means creating a new process. |
186 // TODO(erikkay) crbug.com/43448 - disabled for now until we can get a | 186 IN_PROC_BROWSER_TEST_F(RenderProcessHostTest, ProcessOverflow) { |
187 // reasonable implementation in place. | |
188 IN_PROC_BROWSER_TEST_F(RenderProcessHostTest, DISABLED_ProcessOverflow) { | |
189 // Set max renderers to 1 to force running out of processes. | 187 // Set max renderers to 1 to force running out of processes. |
190 RenderProcessHost::SetMaxRendererProcessCount(1); | 188 RenderProcessHost::SetMaxRendererProcessCount(1); |
191 | 189 |
192 int tab_count = 1; | 190 int tab_count = 1; |
193 int host_count = 1; | 191 int host_count = 1; |
194 TabContents* tab1 = NULL; | 192 TabContents* tab1 = NULL; |
195 TabContents* tab2 = NULL; | 193 TabContents* tab2 = NULL; |
196 RenderProcessHost* rph1 = NULL; | 194 RenderProcessHost* rph1 = NULL; |
197 RenderProcessHost* rph2 = NULL; | 195 RenderProcessHost* rph2 = NULL; |
198 RenderProcessHost* rph3 = NULL; | 196 RenderProcessHost* rph3 = NULL; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 tab_count++; | 254 tab_count++; |
257 host_count++; | 255 host_count++; |
258 EXPECT_EQ(tab_count, browser()->tab_count()); | 256 EXPECT_EQ(tab_count, browser()->tab_count()); |
259 tab1 = browser()->GetTabContentsAt(tab_count - 1); | 257 tab1 = browser()->GetTabContentsAt(tab_count - 1); |
260 rph3 = tab1->GetRenderProcessHost(); | 258 rph3 = tab1->GetRenderProcessHost(); |
261 EXPECT_EQ(tab1->GetURL(), bookmarks); | 259 EXPECT_EQ(tab1->GetURL(), bookmarks); |
262 EXPECT_EQ(host_count, RenderProcessHostCount()); | 260 EXPECT_EQ(host_count, RenderProcessHostCount()); |
263 EXPECT_NE(rph1, rph3); | 261 EXPECT_NE(rph1, rph3); |
264 EXPECT_NE(rph2, rph3); | 262 EXPECT_NE(rph2, rph3); |
265 } | 263 } |
OLD | NEW |