Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1118)

Side by Side Diff: chrome/browser/renderer_host/render_process_host_chrome_browsertest.cc

Issue 940993002: Revert of Handle RenderProcessHostImpl::SetBackgrounded on Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@908473002_ps2
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/process/process_win.cc ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/process/process.h" 6 #include "base/process/process.h"
7 #include "chrome/browser/chrome_notification_types.h" 7 #include "chrome/browser/chrome_notification_types.h"
8 #include "chrome/browser/devtools/devtools_window.h" 8 #include "chrome/browser/devtools/devtools_window.h"
9 #include "chrome/browser/search/search.h" 9 #include "chrome/browser/search/search.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 browser(), omnibox, NEW_FOREGROUND_TAB, 284 browser(), omnibox, NEW_FOREGROUND_TAB,
285 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); 285 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION);
286 tab_count++; 286 tab_count++;
287 EXPECT_EQ(tab_count, browser()->tab_strip_model()->count()); 287 EXPECT_EQ(tab_count, browser()->tab_strip_model()->count());
288 EXPECT_EQ(host_count, RenderProcessHostCount()); 288 EXPECT_EQ(host_count, RenderProcessHostCount());
289 } 289 }
290 290
291 // We don't change process priorities on Mac or Posix because the user lacks the 291 // We don't change process priorities on Mac or Posix because the user lacks the
292 // permission to raise a process' priority even after lowering it. 292 // permission to raise a process' priority even after lowering it.
293 #if defined(OS_WIN) || defined(OS_LINUX) 293 #if defined(OS_WIN) || defined(OS_LINUX)
294 IN_PROC_BROWSER_TEST_F(ChromeRenderProcessHostTest, Backgrounding) { 294 #if defined(OS_WIN)
295 // Flaky test: crbug.com/394368
296 #define MAYBE_Backgrounding DISABLED_Backgrounding
297 #else
298 #define MAYBE_Backgrounding Backgrounding
299 #endif
300 IN_PROC_BROWSER_TEST_F(ChromeRenderProcessHostTest, MAYBE_Backgrounding) {
295 if (!base::Process::CanBackgroundProcesses()) { 301 if (!base::Process::CanBackgroundProcesses()) {
296 LOG(ERROR) << "Can't background processes"; 302 LOG(ERROR) << "Can't background processes";
297 return; 303 return;
298 } 304 }
299 base::CommandLine& parsed_command_line = 305 base::CommandLine& parsed_command_line =
300 *base::CommandLine::ForCurrentProcess(); 306 *base::CommandLine::ForCurrentProcess();
301 parsed_command_line.AppendSwitch(switches::kProcessPerTab); 307 parsed_command_line.AppendSwitch(switches::kProcessPerTab);
302 308
303 // Change the first tab to be the omnibox page (TYPE_WEBUI). 309 // Change the first tab to be the omnibox page (TYPE_WEBUI).
304 GURL omnibox(chrome::kChromeUIOmniboxURL); 310 GURL omnibox(chrome::kChromeUIOmniboxURL);
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 chrome::NOTIFICATION_BROWSER_CLOSED, 527 chrome::NOTIFICATION_BROWSER_CLOSED,
522 content::NotificationService::AllSources()); 528 content::NotificationService::AllSources());
523 529
524 // Kill the renderer process, simulating a crash. This should the ProcessDied 530 // Kill the renderer process, simulating a crash. This should the ProcessDied
525 // method to be called. Alternatively, RenderProcessHost::OnChannelError can 531 // method to be called. Alternatively, RenderProcessHost::OnChannelError can
526 // be called to directly force a call to ProcessDied. 532 // be called to directly force a call to ProcessDied.
527 wc1->GetRenderProcessHost()->Shutdown(-1, true); 533 wc1->GetRenderProcessHost()->Shutdown(-1, true);
528 534
529 observer.Wait(); 535 observer.Wait();
530 } 536 }
OLDNEW
« no previous file with comments | « base/process/process_win.cc ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698