Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chrome_notification_types.h" | 6 #include "chrome/browser/chrome_notification_types.h" |
| 7 #include "chrome/browser/devtools/devtools_window.h" | 7 #include "chrome/browser/devtools/devtools_window.h" |
| 8 #include "chrome/browser/search/search.h" | 8 #include "chrome/browser/search/search.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/browser_commands.h" | 10 #include "chrome/browser/ui/browser_commands.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 79 | 79 |
| 80 return wc->GetRenderProcessHost()->GetHandle(); | 80 return wc->GetRenderProcessHost()->GetHandle(); |
| 81 } | 81 } |
| 82 | 82 |
| 83 // When we hit the max number of renderers, verify that the way we do process | 83 // When we hit the max number of renderers, verify that the way we do process |
| 84 // sharing behaves correctly. In particular, this test is verifying that even | 84 // sharing behaves correctly. In particular, this test is verifying that even |
| 85 // when we hit the max process limit, that renderers of each type will wind up | 85 // when we hit the max process limit, that renderers of each type will wind up |
| 86 // in a process of that type, even if that means creating a new process. | 86 // in a process of that type, even if that means creating a new process. |
| 87 void TestProcessOverflow() { | 87 void TestProcessOverflow() { |
| 88 int tab_count = 1; | 88 int tab_count = 1; |
| 89 int host_count = 1; | 89 int host_count = 2; |
| 90 WebContents* tab1 = NULL; | 90 WebContents* tab1 = NULL; |
| 91 WebContents* tab2 = NULL; | 91 WebContents* tab2 = NULL; |
| 92 content::RenderProcessHost* rph1 = NULL; | 92 content::RenderProcessHost* rph1 = NULL; |
| 93 content::RenderProcessHost* rph2 = NULL; | 93 content::RenderProcessHost* rph2 = NULL; |
| 94 content::RenderProcessHost* rph3 = NULL; | 94 content::RenderProcessHost* rph3 = NULL; |
| 95 | 95 |
| 96 // Change the first tab to be the new tab page (TYPE_WEBUI). | 96 // Change the first tab to be the omnibox page (TYPE_WEBUI). |
|
sky
2013/10/07 20:30:59
omnibox_url?
samarth
2013/10/11 22:26:04
Done.
| |
| 97 GURL newtab(chrome::kChromeUINewTabURL); | 97 GURL omnibox(chrome::kChromeUIOmniboxURL); |
| 98 ui_test_utils::NavigateToURL(browser(), newtab); | 98 ui_test_utils::NavigateToURL(browser(), omnibox); |
| 99 EXPECT_EQ(tab_count, browser()->tab_strip_model()->count()); | 99 EXPECT_EQ(tab_count, browser()->tab_strip_model()->count()); |
| 100 tab1 = browser()->tab_strip_model()->GetWebContentsAt(tab_count - 1); | 100 tab1 = browser()->tab_strip_model()->GetWebContentsAt(tab_count - 1); |
| 101 rph1 = tab1->GetRenderProcessHost(); | 101 rph1 = tab1->GetRenderProcessHost(); |
| 102 EXPECT_TRUE(chrome::IsNTPURL(tab1->GetURL(), browser()->profile())); | 102 EXPECT_EQ(omnibox, tab1->GetURL()); |
| 103 EXPECT_EQ(host_count, RenderProcessHostCount()); | 103 EXPECT_EQ(host_count, RenderProcessHostCount()); |
| 104 | 104 |
| 105 // Create a new TYPE_TABBED tab. It should be in its own process. | 105 // Create a new TYPE_TABBED tab. It should be in its own process. |
| 106 GURL page1("data:text/html,hello world1"); | 106 GURL page1("data:text/html,hello world1"); |
| 107 | 107 |
| 108 ui_test_utils::WindowedTabAddedNotificationObserver observer1( | 108 ui_test_utils::WindowedTabAddedNotificationObserver observer1( |
| 109 content::NotificationService::AllSources()); | 109 content::NotificationService::AllSources()); |
| 110 chrome::ShowSingletonTab(browser(), page1); | 110 chrome::ShowSingletonTab(browser(), page1); |
| 111 observer1.Wait(); | 111 observer1.Wait(); |
| 112 | 112 |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 125 content::NotificationService::AllSources()); | 125 content::NotificationService::AllSources()); |
| 126 chrome::ShowSingletonTab(browser(), page2); | 126 chrome::ShowSingletonTab(browser(), page2); |
| 127 observer2.Wait(); | 127 observer2.Wait(); |
| 128 tab_count++; | 128 tab_count++; |
| 129 EXPECT_EQ(tab_count, browser()->tab_strip_model()->count()); | 129 EXPECT_EQ(tab_count, browser()->tab_strip_model()->count()); |
| 130 tab2 = browser()->tab_strip_model()->GetWebContentsAt(tab_count - 1); | 130 tab2 = browser()->tab_strip_model()->GetWebContentsAt(tab_count - 1); |
| 131 EXPECT_EQ(tab2->GetURL(), page2); | 131 EXPECT_EQ(tab2->GetURL(), page2); |
| 132 EXPECT_EQ(host_count, RenderProcessHostCount()); | 132 EXPECT_EQ(host_count, RenderProcessHostCount()); |
| 133 EXPECT_EQ(tab2->GetRenderProcessHost(), rph2); | 133 EXPECT_EQ(tab2->GetRenderProcessHost(), rph2); |
| 134 | 134 |
| 135 // Create another TYPE_WEBUI tab. It should share the process with newtab. | 135 // Create another TYPE_WEBUI tab. It should share the process with omnibox. |
| 136 // Note: intentionally create this tab after the TYPE_TABBED tabs to | 136 // Note: intentionally create this tab after the TYPE_TABBED tabs to |
| 137 // exercise bug 43448 where extension and WebUI tabs could get combined into | 137 // exercise bug 43448 where extension and WebUI tabs could get combined into |
| 138 // normal renderers. | 138 // normal renderers. |
| 139 GURL history(chrome::kChromeUIHistoryURL); | 139 GURL history(chrome::kChromeUIHistoryURL); |
| 140 ui_test_utils::WindowedTabAddedNotificationObserver observer3( | 140 ui_test_utils::WindowedTabAddedNotificationObserver observer3( |
| 141 content::NotificationService::AllSources()); | 141 content::NotificationService::AllSources()); |
| 142 chrome::ShowSingletonTab(browser(), history); | 142 chrome::ShowSingletonTab(browser(), history); |
| 143 observer3.Wait(); | 143 observer3.Wait(); |
| 144 tab_count++; | 144 tab_count++; |
| 145 EXPECT_EQ(tab_count, browser()->tab_strip_model()->count()); | 145 EXPECT_EQ(tab_count, browser()->tab_strip_model()->count()); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 177 }; | 177 }; |
| 178 | 178 |
| 179 IN_PROC_BROWSER_TEST_F(ChromeRenderProcessHostTest, ProcessPerTab) { | 179 IN_PROC_BROWSER_TEST_F(ChromeRenderProcessHostTest, ProcessPerTab) { |
| 180 // Set max renderers to 1 to force running out of processes. | 180 // Set max renderers to 1 to force running out of processes. |
| 181 content::RenderProcessHost::SetMaxRendererProcessCount(1); | 181 content::RenderProcessHost::SetMaxRendererProcessCount(1); |
| 182 | 182 |
| 183 CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 183 CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
| 184 parsed_command_line.AppendSwitch(switches::kProcessPerTab); | 184 parsed_command_line.AppendSwitch(switches::kProcessPerTab); |
| 185 | 185 |
| 186 int tab_count = 1; | 186 int tab_count = 1; |
| 187 int host_count = 1; | 187 int host_count = 2; |
| 188 | 188 |
| 189 // Change the first tab to be the new tab page (TYPE_WEBUI). | 189 // Change the first tab to be the omnibox page (TYPE_WEBUI). |
| 190 GURL newtab(chrome::kChromeUINewTabURL); | 190 GURL omnibox(chrome::kChromeUIOmniboxURL); |
| 191 ui_test_utils::NavigateToURL(browser(), newtab); | 191 ui_test_utils::NavigateToURL(browser(), omnibox); |
| 192 EXPECT_EQ(tab_count, browser()->tab_strip_model()->count()); | 192 EXPECT_EQ(tab_count, browser()->tab_strip_model()->count()); |
| 193 EXPECT_EQ(host_count, RenderProcessHostCount()); | 193 EXPECT_EQ(host_count, RenderProcessHostCount()); |
| 194 | 194 |
| 195 // Create a new TYPE_TABBED tab. It should be in its own process. | 195 // Create a new TYPE_TABBED tab. It should be in its own process. |
| 196 GURL page1("data:text/html,hello world1"); | 196 GURL page1("data:text/html,hello world1"); |
| 197 ui_test_utils::WindowedTabAddedNotificationObserver observer1( | 197 ui_test_utils::WindowedTabAddedNotificationObserver observer1( |
| 198 content::NotificationService::AllSources()); | 198 content::NotificationService::AllSources()); |
| 199 chrome::ShowSingletonTab(browser(), page1); | 199 chrome::ShowSingletonTab(browser(), page1); |
| 200 observer1.Wait(); | 200 observer1.Wait(); |
| 201 tab_count++; | 201 tab_count++; |
| 202 host_count++; | 202 host_count++; |
| 203 EXPECT_EQ(tab_count, browser()->tab_strip_model()->count()); | 203 EXPECT_EQ(tab_count, browser()->tab_strip_model()->count()); |
| 204 EXPECT_EQ(host_count, RenderProcessHostCount()); | 204 EXPECT_EQ(host_count, RenderProcessHostCount()); |
| 205 | 205 |
| 206 // Create another TYPE_TABBED tab. It should share the previous process. | 206 // Create another TYPE_TABBED tab. It should share the previous process. |
| 207 GURL page2("data:text/html,hello world2"); | 207 GURL page2("data:text/html,hello world2"); |
| 208 ui_test_utils::WindowedTabAddedNotificationObserver observer2( | 208 ui_test_utils::WindowedTabAddedNotificationObserver observer2( |
| 209 content::NotificationService::AllSources()); | 209 content::NotificationService::AllSources()); |
| 210 chrome::ShowSingletonTab(browser(), page2); | 210 chrome::ShowSingletonTab(browser(), page2); |
| 211 observer2.Wait(); | 211 observer2.Wait(); |
| 212 tab_count++; | 212 tab_count++; |
| 213 EXPECT_EQ(tab_count, browser()->tab_strip_model()->count()); | 213 EXPECT_EQ(tab_count, browser()->tab_strip_model()->count()); |
| 214 EXPECT_EQ(host_count, RenderProcessHostCount()); | 214 EXPECT_EQ(host_count, RenderProcessHostCount()); |
| 215 | 215 |
| 216 // Create another new tab. It should share the process with the other WebUI. | 216 // Create another new tab. It should share the process with the other WebUI. |
| 217 ui_test_utils::WindowedTabAddedNotificationObserver observer3( | 217 ui_test_utils::WindowedTabAddedNotificationObserver observer3( |
| 218 content::NotificationService::AllSources()); | 218 content::NotificationService::AllSources()); |
| 219 chrome::NewTab(browser()); | 219 ui_test_utils::NavigateToURLWithDisposition( |
| 220 browser(), omnibox, NEW_FOREGROUND_TAB, | |
| 221 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); | |
| 220 observer3.Wait(); | 222 observer3.Wait(); |
| 221 tab_count++; | 223 tab_count++; |
| 222 EXPECT_EQ(tab_count, browser()->tab_strip_model()->count()); | 224 EXPECT_EQ(tab_count, browser()->tab_strip_model()->count()); |
| 223 EXPECT_EQ(host_count, RenderProcessHostCount()); | 225 EXPECT_EQ(host_count, RenderProcessHostCount()); |
| 224 | 226 |
| 225 // Create another new tab. It should share the process with the other WebUI. | 227 // Create another new tab. It should share the process with the other WebUI. |
| 226 ui_test_utils::WindowedTabAddedNotificationObserver observer4( | 228 ui_test_utils::WindowedTabAddedNotificationObserver observer4( |
| 227 content::NotificationService::AllSources()); | 229 content::NotificationService::AllSources()); |
| 228 chrome::NewTab(browser()); | 230 ui_test_utils::NavigateToURLWithDisposition( |
| 231 browser(), omnibox, NEW_FOREGROUND_TAB, | |
| 232 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); | |
| 229 observer4.Wait(); | 233 observer4.Wait(); |
| 230 tab_count++; | 234 tab_count++; |
| 231 EXPECT_EQ(tab_count, browser()->tab_strip_model()->count()); | 235 EXPECT_EQ(tab_count, browser()->tab_strip_model()->count()); |
| 232 EXPECT_EQ(host_count, RenderProcessHostCount()); | 236 EXPECT_EQ(host_count, RenderProcessHostCount()); |
| 233 } | 237 } |
| 234 | 238 |
| 235 // We don't change process priorities on Mac or Posix because the user lacks the | 239 // We don't change process priorities on Mac or Posix because the user lacks the |
| 236 // permission to raise a process' priority even after lowering it. | 240 // permission to raise a process' priority even after lowering it. |
| 237 #if defined(OS_WIN) || defined(OS_LINUX) | 241 #if defined(OS_WIN) || defined(OS_LINUX) |
| 238 IN_PROC_BROWSER_TEST_F(ChromeRenderProcessHostTest, Backgrounding) { | 242 IN_PROC_BROWSER_TEST_F(ChromeRenderProcessHostTest, Backgrounding) { |
| 239 if (!base::Process::CanBackgroundProcesses()) { | 243 if (!base::Process::CanBackgroundProcesses()) { |
| 240 LOG(ERROR) << "Can't background processes"; | 244 LOG(ERROR) << "Can't background processes"; |
| 241 return; | 245 return; |
| 242 } | 246 } |
| 243 CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 247 CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
| 244 parsed_command_line.AppendSwitch(switches::kProcessPerTab); | 248 parsed_command_line.AppendSwitch(switches::kProcessPerTab); |
| 245 | 249 |
| 246 // Change the first tab to be the new tab page (TYPE_WEBUI). | 250 // Change the first tab to be the omnibox page (TYPE_WEBUI). |
| 247 GURL newtab(chrome::kChromeUINewTabURL); | 251 GURL omnibox(chrome::kChromeUINewTabURL); |
| 248 ui_test_utils::NavigateToURL(browser(), newtab); | 252 ui_test_utils::NavigateToURL(browser(), omnibox); |
| 249 | 253 |
| 250 // Create a new tab. It should be foreground. | 254 // Create a new tab. It should be foreground. |
| 251 GURL page1("data:text/html,hello world1"); | 255 GURL page1("data:text/html,hello world1"); |
| 252 base::ProcessHandle pid1 = ShowSingletonTab(page1); | 256 base::ProcessHandle pid1 = ShowSingletonTab(page1); |
| 253 EXPECT_FALSE(base::Process(pid1).IsProcessBackgrounded()); | 257 EXPECT_FALSE(base::Process(pid1).IsProcessBackgrounded()); |
| 254 | 258 |
| 255 // Create another tab. It should be foreground, and the first tab should | 259 // Create another tab. It should be foreground, and the first tab should |
| 256 // now be background. | 260 // now be background. |
| 257 GURL page2("data:text/html,hello world2"); | 261 GURL page2("data:text/html,hello world2"); |
| 258 base::ProcessHandle pid2 = ShowSingletonTab(page2); | 262 base::ProcessHandle pid2 = ShowSingletonTab(page2); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 295 #if defined(OS_WIN) && defined(USE_ASH) | 299 #if defined(OS_WIN) && defined(USE_ASH) |
| 296 // Disable this test in Metro+Ash for now (http://crbug.com/262796). | 300 // Disable this test in Metro+Ash for now (http://crbug.com/262796). |
| 297 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) | 301 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) |
| 298 return; | 302 return; |
| 299 #endif | 303 #endif |
| 300 | 304 |
| 301 CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 305 CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
| 302 parsed_command_line.AppendSwitch(switches::kProcessPerTab); | 306 parsed_command_line.AppendSwitch(switches::kProcessPerTab); |
| 303 | 307 |
| 304 int tab_count = 1; | 308 int tab_count = 1; |
| 305 int host_count = 1; | 309 int host_count = 2; |
| 306 | 310 |
| 307 GURL page1("data:text/html,hello world1"); | 311 GURL page1("data:text/html,hello world1"); |
| 308 ui_test_utils::WindowedTabAddedNotificationObserver observer1( | 312 ui_test_utils::WindowedTabAddedNotificationObserver observer1( |
| 309 content::NotificationService::AllSources()); | 313 content::NotificationService::AllSources()); |
| 310 chrome::ShowSingletonTab(browser(), page1); | 314 chrome::ShowSingletonTab(browser(), page1); |
| 311 observer1.Wait(); | 315 observer1.Wait(); |
| 312 tab_count++; | 316 tab_count++; |
| 313 host_count++; | 317 host_count++; |
| 314 EXPECT_EQ(tab_count, browser()->tab_strip_model()->count()); | 318 EXPECT_EQ(tab_count, browser()->tab_strip_model()->count()); |
| 315 EXPECT_EQ(host_count, RenderProcessHostCount()); | 319 EXPECT_EQ(host_count, RenderProcessHostCount()); |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 335 // process. See crbug.com/69873. | 339 // process. See crbug.com/69873. |
| 336 IN_PROC_BROWSER_TEST_F(ChromeRenderProcessHostTest, | 340 IN_PROC_BROWSER_TEST_F(ChromeRenderProcessHostTest, |
| 337 DevToolsOnSelfInOwnProcess) { | 341 DevToolsOnSelfInOwnProcess) { |
| 338 #if defined(OS_WIN) && defined(USE_ASH) | 342 #if defined(OS_WIN) && defined(USE_ASH) |
| 339 // Disable this test in Metro+Ash for now (http://crbug.com/262796). | 343 // Disable this test in Metro+Ash for now (http://crbug.com/262796). |
| 340 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) | 344 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) |
| 341 return; | 345 return; |
| 342 #endif | 346 #endif |
| 343 | 347 |
| 344 int tab_count = 1; | 348 int tab_count = 1; |
| 345 int host_count = 1; | 349 int host_count = 2; |
| 346 | 350 |
| 347 GURL page1("data:text/html,hello world1"); | 351 GURL page1("data:text/html,hello world1"); |
| 348 ui_test_utils::WindowedTabAddedNotificationObserver observer1( | 352 ui_test_utils::WindowedTabAddedNotificationObserver observer1( |
| 349 content::NotificationService::AllSources()); | 353 content::NotificationService::AllSources()); |
| 350 chrome::ShowSingletonTab(browser(), page1); | 354 chrome::ShowSingletonTab(browser(), page1); |
| 351 observer1.Wait(); | 355 observer1.Wait(); |
| 352 tab_count++; | 356 tab_count++; |
| 353 host_count++; | 357 host_count++; |
| 354 EXPECT_EQ(tab_count, browser()->tab_strip_model()->count()); | 358 EXPECT_EQ(tab_count, browser()->tab_strip_model()->count()); |
| 355 EXPECT_EQ(host_count, RenderProcessHostCount()); | 359 EXPECT_EQ(host_count, RenderProcessHostCount()); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 396 TabStripModel* tab_strip_model_; | 400 TabStripModel* tab_strip_model_; |
| 397 | 401 |
| 398 DISALLOW_COPY_AND_ASSIGN(WindowDestroyer); | 402 DISALLOW_COPY_AND_ASSIGN(WindowDestroyer); |
| 399 }; | 403 }; |
| 400 | 404 |
| 401 // Test to ensure that while iterating through all listeners in | 405 // Test to ensure that while iterating through all listeners in |
| 402 // RenderProcessHost and invalidating them, we remove them properly and don't | 406 // RenderProcessHost and invalidating them, we remove them properly and don't |
| 403 // access already freed objects. See http://crbug.com/255524. | 407 // access already freed objects. See http://crbug.com/255524. |
| 404 IN_PROC_BROWSER_TEST_F(ChromeRenderProcessHostTest, | 408 IN_PROC_BROWSER_TEST_F(ChromeRenderProcessHostTest, |
| 405 CloseAllTabsDuringProcessDied) { | 409 CloseAllTabsDuringProcessDied) { |
| 406 GURL url(chrome::kChromeUINewTabURL); | 410 GURL url(chrome::kChromeUIOmniboxURL); |
| 407 | 411 |
| 408 ui_test_utils::NavigateToURL(browser(), url); | 412 ui_test_utils::NavigateToURL(browser(), url); |
| 409 ui_test_utils::NavigateToURLWithDisposition( | 413 ui_test_utils::NavigateToURLWithDisposition( |
| 410 browser(), url, NEW_BACKGROUND_TAB, | 414 browser(), url, NEW_BACKGROUND_TAB, |
| 411 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); | 415 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
| 412 | 416 |
| 413 EXPECT_EQ(2, browser()->tab_strip_model()->count()); | 417 EXPECT_EQ(2, browser()->tab_strip_model()->count()); |
| 414 | 418 |
| 415 WebContents* wc1 = browser()->tab_strip_model()->GetWebContentsAt(0); | 419 WebContents* wc1 = browser()->tab_strip_model()->GetWebContentsAt(0); |
| 416 WebContents* wc2 = browser()->tab_strip_model()->GetWebContentsAt(1); | 420 WebContents* wc2 = browser()->tab_strip_model()->GetWebContentsAt(1); |
| 417 EXPECT_EQ(wc1->GetRenderProcessHost(), wc2->GetRenderProcessHost()); | 421 EXPECT_EQ(wc1->GetRenderProcessHost(), wc2->GetRenderProcessHost()); |
| 418 | 422 |
| 419 // Create an object that will close the window on a process crash. | 423 // Create an object that will close the window on a process crash. |
| 420 WindowDestroyer destroyer(wc1, browser()->tab_strip_model()); | 424 WindowDestroyer destroyer(wc1, browser()->tab_strip_model()); |
| 421 | 425 |
| 422 // Use NOTIFICATION_BROWSER_CLOSED instead of NOTIFICATION_WINDOW_CLOSED, | 426 // Use NOTIFICATION_BROWSER_CLOSED instead of NOTIFICATION_WINDOW_CLOSED, |
| 423 // since the latter is not implemented on OSX and the test will timeout, | 427 // since the latter is not implemented on OSX and the test will timeout, |
| 424 // causing it to fail. | 428 // causing it to fail. |
| 425 content::WindowedNotificationObserver observer( | 429 content::WindowedNotificationObserver observer( |
| 426 chrome::NOTIFICATION_BROWSER_CLOSED, | 430 chrome::NOTIFICATION_BROWSER_CLOSED, |
| 427 content::NotificationService::AllSources()); | 431 content::NotificationService::AllSources()); |
| 428 | 432 |
| 429 // Kill the renderer process, simulating a crash. This should the ProcessDied | 433 // Kill the renderer process, simulating a crash. This should the ProcessDied |
| 430 // method to be called. Alternatively, RenderProcessHost::OnChannelError can | 434 // method to be called. Alternatively, RenderProcessHost::OnChannelError can |
| 431 // be called to directly force a call to ProcessDied. | 435 // be called to directly force a call to ProcessDied. |
| 432 base::KillProcess(wc1->GetRenderProcessHost()->GetHandle(), -1, true); | 436 base::KillProcess(wc1->GetRenderProcessHost()->GetHandle(), -1, true); |
| 433 | 437 |
| 434 observer.Wait(); | 438 observer.Wait(); |
| 435 } | 439 } |
| OLD | NEW |