summaryrefslogtreecommitdiffstats
path: root/chrome/test/perf/browser_perf_test.cc
blob: 30d54a8f8324eaec3487e8276dd6a5efa5c29162 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/test/perf/browser_perf_test.h"

#include "base/command_line.h"
#include "base/process_util.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/chrome_process_util.h"
#include "chrome/test/perf/perf_test.h"

BrowserPerfTest::BrowserPerfTest() {
}

BrowserPerfTest::~BrowserPerfTest() {
}

void BrowserPerfTest::SetUpCommandLine(CommandLine* command_line) {
  // Reduce performance test variance by disabling background networking.
  command_line->AppendSwitch(switches::kDisableBackgroundNetworking);
}

void BrowserPerfTest::PrintIOPerfInfo(const std::string& test_name) {
  base::ProcessId browser_pid = base::GetCurrentProcId();
  ChromeProcessList chrome_processes(GetRunningChromeProcesses(browser_pid));
  perf_test::PrintIOPerfInfo(test_name, chrome_processes, browser_pid);
}

void BrowserPerfTest::PrintMemoryUsageInfo(const std::string& test_name) {
  base::ProcessId browser_pid = base::GetCurrentProcId();
  ChromeProcessList chrome_processes(GetRunningChromeProcesses(browser_pid));
  perf_test::PrintMemoryUsageInfo(test_name, chrome_processes, browser_pid);
}