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

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

Issue 648653003: Standardize usage of virtual/override/final in chrome/browser/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 EXPECT_EQ(host_count, RenderProcessHostCount()); 212 EXPECT_EQ(host_count, RenderProcessHostCount());
213 EXPECT_NE(rph1, rph3); 213 EXPECT_NE(rph1, rph3);
214 EXPECT_NE(rph2, rph3); 214 EXPECT_NE(rph2, rph3);
215 } 215 }
216 }; 216 };
217 217
218 218
219 class ChromeRenderProcessHostTestWithCommandLine 219 class ChromeRenderProcessHostTestWithCommandLine
220 : public ChromeRenderProcessHostTest { 220 : public ChromeRenderProcessHostTest {
221 protected: 221 protected:
222 virtual void SetUpCommandLine(CommandLine* command_line) override { 222 void SetUpCommandLine(CommandLine* command_line) override {
223 command_line->AppendSwitchASCII(switches::kRendererProcessLimit, "1"); 223 command_line->AppendSwitchASCII(switches::kRendererProcessLimit, "1");
224 } 224 }
225 }; 225 };
226 226
227 IN_PROC_BROWSER_TEST_F(ChromeRenderProcessHostTest, ProcessPerTab) { 227 IN_PROC_BROWSER_TEST_F(ChromeRenderProcessHostTest, ProcessPerTab) {
228 // Set max renderers to 1 to force running out of processes. 228 // Set max renderers to 1 to force running out of processes.
229 content::RenderProcessHost::SetMaxRendererProcessCount(1); 229 content::RenderProcessHost::SetMaxRendererProcessCount(1);
230 230
231 CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); 231 CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess();
232 parsed_command_line.AppendSwitch(switches::kProcessPerTab); 232 parsed_command_line.AppendSwitch(switches::kProcessPerTab);
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 // This class's goal is to close the browser window when a renderer process has 455 // This class's goal is to close the browser window when a renderer process has
456 // crashed. It does so by monitoring WebContents for RenderProcessGone event and 456 // crashed. It does so by monitoring WebContents for RenderProcessGone event and
457 // closing the passed in TabStripModel. This is used in the following test case. 457 // closing the passed in TabStripModel. This is used in the following test case.
458 class WindowDestroyer : public content::WebContentsObserver { 458 class WindowDestroyer : public content::WebContentsObserver {
459 public: 459 public:
460 WindowDestroyer(content::WebContents* web_contents, TabStripModel* model) 460 WindowDestroyer(content::WebContents* web_contents, TabStripModel* model)
461 : content::WebContentsObserver(web_contents), 461 : content::WebContentsObserver(web_contents),
462 tab_strip_model_(model) { 462 tab_strip_model_(model) {
463 } 463 }
464 464
465 virtual void RenderProcessGone(base::TerminationStatus status) override { 465 void RenderProcessGone(base::TerminationStatus status) override {
466 // Wait for the window to be destroyed, which will ensure all other 466 // Wait for the window to be destroyed, which will ensure all other
467 // RenderViewHost objects are deleted before we return and proceed with 467 // RenderViewHost objects are deleted before we return and proceed with
468 // the next iteration of notifications. 468 // the next iteration of notifications.
469 content::WindowedNotificationObserver observer( 469 content::WindowedNotificationObserver observer(
470 chrome::NOTIFICATION_BROWSER_CLOSED, 470 chrome::NOTIFICATION_BROWSER_CLOSED,
471 content::NotificationService::AllSources()); 471 content::NotificationService::AllSources());
472 tab_strip_model_->CloseAllTabs(); 472 tab_strip_model_->CloseAllTabs();
473 observer.Wait(); 473 observer.Wait();
474 } 474 }
475 475
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 chrome::NOTIFICATION_BROWSER_CLOSED, 507 chrome::NOTIFICATION_BROWSER_CLOSED,
508 content::NotificationService::AllSources()); 508 content::NotificationService::AllSources());
509 509
510 // Kill the renderer process, simulating a crash. This should the ProcessDied 510 // Kill the renderer process, simulating a crash. This should the ProcessDied
511 // method to be called. Alternatively, RenderProcessHost::OnChannelError can 511 // method to be called. Alternatively, RenderProcessHost::OnChannelError can
512 // be called to directly force a call to ProcessDied. 512 // be called to directly force a call to ProcessDied.
513 base::KillProcess(wc1->GetRenderProcessHost()->GetHandle(), -1, true); 513 base::KillProcess(wc1->GetRenderProcessHost()->GetHandle(), -1, true);
514 514
515 observer.Wait(); 515 observer.Wait();
516 } 516 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/pepper/pepper_talk_host.h ('k') | chrome/browser/renderer_host/safe_browsing_resource_throttle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698