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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 ui_test_utils::NavigateToURLWithDisposition( | 245 ui_test_utils::NavigateToURLWithDisposition( |
246 browser(), omnibox, NEW_FOREGROUND_TAB, | 246 browser(), omnibox, NEW_FOREGROUND_TAB, |
247 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); | 247 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
248 tab_count++; | 248 tab_count++; |
249 EXPECT_EQ(tab_count, browser()->tab_strip_model()->count()); | 249 EXPECT_EQ(tab_count, browser()->tab_strip_model()->count()); |
250 EXPECT_EQ(host_count, RenderProcessHostCount()); | 250 EXPECT_EQ(host_count, RenderProcessHostCount()); |
251 } | 251 } |
252 | 252 |
253 // We don't change process priorities on Mac or Posix because the user lacks the | 253 // We don't change process priorities on Mac or Posix because the user lacks the |
254 // permission to raise a process' priority even after lowering it. | 254 // permission to raise a process' priority even after lowering it. |
255 #if defined(OS_WIN) || defined(OS_LINUX) | 255 // TODO(dalecurtis): Reenable this on Windows after figuring out how to reliably |
| 256 // wait for the renderer process to process IPC messages. |
| 257 #if defined(OS_LINUX) |
256 IN_PROC_BROWSER_TEST_F(ChromeRenderProcessHostTest, Backgrounding) { | 258 IN_PROC_BROWSER_TEST_F(ChromeRenderProcessHostTest, Backgrounding) { |
257 if (!base::Process::CanBackgroundProcesses()) { | 259 if (!base::Process::CanBackgroundProcesses()) { |
258 LOG(ERROR) << "Can't background processes"; | 260 LOG(ERROR) << "Can't background processes"; |
259 return; | 261 return; |
260 } | 262 } |
261 CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 263 CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
262 parsed_command_line.AppendSwitch(switches::kProcessPerTab); | 264 parsed_command_line.AppendSwitch(switches::kProcessPerTab); |
263 | 265 |
264 // Change the first tab to be the omnibox page (TYPE_WEBUI). | 266 // Change the first tab to be the omnibox page (TYPE_WEBUI). |
265 GURL omnibox(chrome::kChromeUIOmniboxURL); | 267 GURL omnibox(chrome::kChromeUIOmniboxURL); |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 chrome::NOTIFICATION_BROWSER_CLOSED, | 471 chrome::NOTIFICATION_BROWSER_CLOSED, |
470 content::NotificationService::AllSources()); | 472 content::NotificationService::AllSources()); |
471 | 473 |
472 // Kill the renderer process, simulating a crash. This should the ProcessDied | 474 // Kill the renderer process, simulating a crash. This should the ProcessDied |
473 // method to be called. Alternatively, RenderProcessHost::OnChannelError can | 475 // method to be called. Alternatively, RenderProcessHost::OnChannelError can |
474 // be called to directly force a call to ProcessDied. | 476 // be called to directly force a call to ProcessDied. |
475 base::KillProcess(wc1->GetRenderProcessHost()->GetHandle(), -1, true); | 477 base::KillProcess(wc1->GetRenderProcessHost()->GetHandle(), -1, true); |
476 | 478 |
477 observer.Wait(); | 479 observer.Wait(); |
478 } | 480 } |
OLD | NEW |