blob: 275f670cbc51e939a9dd1b1198d2ed9f263f9603 (
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
// Copyright (c) 2011 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/ui/ui_perf_test.h"
#include "base/path_service.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/chrome_process_util.h"
#include "chrome/test/base/test_switches.h"
#include "chrome/test/perf/perf_test.h"
void UIPerfTest::SetLaunchSwitches() {
UITestBase::SetLaunchSwitches();
// Reduce performance test variance by disabling background networking.
launch_arguments_.AppendSwitch(switches::kDisableBackgroundNetworking);
// We don't want tests to slow down mysteriously when we update the minimum
// plugin version.
launch_arguments_.AppendSwitch(switches::kAllowOutdatedPlugins);
}
void UIPerfTest::PrintIOPerfInfo(const char* test_name) {
ChromeProcessList chrome_processes(
GetRunningChromeProcesses(browser_process_id()));
perf_test::PrintIOPerfInfo(test_name, chrome_processes,
browser_process_id());
}
void UIPerfTest::PrintMemoryUsageInfo(const char* test_name) {
ChromeProcessList chrome_processes(
GetRunningChromeProcesses(browser_process_id()));
perf_test::PrintMemoryUsageInfo(test_name, chrome_processes,
browser_process_id());
}
void UIPerfTest::UseReferenceBuild() {
FilePath dir;
PathService::Get(chrome::DIR_TEST_TOOLS, &dir);
dir = dir.AppendASCII("reference_build");
#if defined(OS_WIN)
dir = dir.AppendASCII("chrome_win");
#elif defined(OS_LINUX)
dir = dir.AppendASCII("chrome_linux");
#elif defined(OS_MACOSX)
dir = dir.AppendASCII("chrome_mac");
#endif
launch_arguments_.AppendSwitch(switches::kEnableChromiumBranding);
SetBrowserDirectory(dir);
}
|