| 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 browser(), omnibox, NEW_FOREGROUND_TAB, | 259 browser(), omnibox, NEW_FOREGROUND_TAB, |
| 260 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); | 260 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
| 261 tab_count++; | 261 tab_count++; |
| 262 EXPECT_EQ(tab_count, browser()->tab_strip_model()->count()); | 262 EXPECT_EQ(tab_count, browser()->tab_strip_model()->count()); |
| 263 EXPECT_EQ(host_count, RenderProcessHostCount()); | 263 EXPECT_EQ(host_count, RenderProcessHostCount()); |
| 264 } | 264 } |
| 265 | 265 |
| 266 // We don't change process priorities on Mac or Posix because the user lacks the | 266 // We don't change process priorities on Mac or Posix because the user lacks the |
| 267 // permission to raise a process' priority even after lowering it. | 267 // permission to raise a process' priority even after lowering it. |
| 268 #if defined(OS_WIN) || defined(OS_LINUX) | 268 #if defined(OS_WIN) || defined(OS_LINUX) |
| 269 IN_PROC_BROWSER_TEST_F(ChromeRenderProcessHostTest, Backgrounding) { | 269 #if defined(OS_WIN) |
| 270 // Flaky test: crbug.com/394368 |
| 271 #define MAYBE_Backgrounding DISABLED_Backgrounding |
| 272 #else |
| 273 #define MAYBE_Backgrounding Backgrounding |
| 274 #endif |
| 275 IN_PROC_BROWSER_TEST_F(ChromeRenderProcessHostTest, MAYBE_Backgrounding) { |
| 270 if (!base::Process::CanBackgroundProcesses()) { | 276 if (!base::Process::CanBackgroundProcesses()) { |
| 271 LOG(ERROR) << "Can't background processes"; | 277 LOG(ERROR) << "Can't background processes"; |
| 272 return; | 278 return; |
| 273 } | 279 } |
| 274 CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 280 CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
| 275 parsed_command_line.AppendSwitch(switches::kProcessPerTab); | 281 parsed_command_line.AppendSwitch(switches::kProcessPerTab); |
| 276 | 282 |
| 277 // Change the first tab to be the omnibox page (TYPE_WEBUI). | 283 // Change the first tab to be the omnibox page (TYPE_WEBUI). |
| 278 GURL omnibox(chrome::kChromeUIOmniboxURL); | 284 GURL omnibox(chrome::kChromeUIOmniboxURL); |
| 279 ui_test_utils::NavigateToURL(browser(), omnibox); | 285 ui_test_utils::NavigateToURL(browser(), omnibox); |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 chrome::NOTIFICATION_BROWSER_CLOSED, | 488 chrome::NOTIFICATION_BROWSER_CLOSED, |
| 483 content::NotificationService::AllSources()); | 489 content::NotificationService::AllSources()); |
| 484 | 490 |
| 485 // Kill the renderer process, simulating a crash. This should the ProcessDied | 491 // Kill the renderer process, simulating a crash. This should the ProcessDied |
| 486 // method to be called. Alternatively, RenderProcessHost::OnChannelError can | 492 // method to be called. Alternatively, RenderProcessHost::OnChannelError can |
| 487 // be called to directly force a call to ProcessDied. | 493 // be called to directly force a call to ProcessDied. |
| 488 base::KillProcess(wc1->GetRenderProcessHost()->GetHandle(), -1, true); | 494 base::KillProcess(wc1->GetRenderProcessHost()->GetHandle(), -1, true); |
| 489 | 495 |
| 490 observer.Wait(); | 496 observer.Wait(); |
| 491 } | 497 } |
| OLD | NEW |