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
3 // found in the LICENSE file.
5 #include "chrome/test/perf/browser_perf_test.h"
7 #include "base/command_line.h"
8 #include "base/process_util.h"
9 #include "chrome/common/chrome_switches.h"
10 #include "chrome/test/base/chrome_process_util.h"
11 #include "chrome/test/perf/perf_test.h"
13 BrowserPerfTest::BrowserPerfTest() {
16 BrowserPerfTest::~BrowserPerfTest() {
19 void BrowserPerfTest::SetUpCommandLine(CommandLine
* command_line
) {
20 // Reduce performance test variance by disabling background networking.
21 command_line
->AppendSwitch(switches::kDisableBackgroundNetworking
);
24 void BrowserPerfTest::PrintIOPerfInfo(const std::string
& test_name
) {
25 base::ProcessId browser_pid
= base::GetCurrentProcId();
26 ChromeProcessList
chrome_processes(GetRunningChromeProcesses(browser_pid
));
27 perf_test::PrintIOPerfInfo(test_name
, chrome_processes
, browser_pid
);
30 void BrowserPerfTest::PrintMemoryUsageInfo(const std::string
& test_name
) {
31 base::ProcessId browser_pid
= base::GetCurrentProcId();
32 ChromeProcessList
chrome_processes(GetRunningChromeProcesses(browser_pid
));
33 perf_test::PrintMemoryUsageInfo(test_name
, chrome_processes
, browser_pid
);