summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authornsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-09 17:32:32 +0000
committernsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-09 17:32:32 +0000
commit85f633544904e9a2e1b47ad3a713ad764c81eaf2 (patch)
tree78ad55aeacd41a6ad480a9f3a6af28040feace19 /chrome
parent53bb5675486a7a3ddb0f29482fc0217f7452f833 (diff)
downloadchromium_src-85f633544904e9a2e1b47ad3a713ad764c81eaf2.zip
chromium_src-85f633544904e9a2e1b47ad3a713ad764c81eaf2.tar.gz
chromium_src-85f633544904e9a2e1b47ad3a713ad764c81eaf2.tar.bz2
Revert 55400 - Cleanup in base. This moves the implementation (and a bunch of header file
dependencies) from the multiprocess test and the test_suite headers to .cc files. Moves multiprocess_test to the test directory, and all of this stuff to the existing base_test_support project. I also used the base namespace. Previously other projects included this functionality just by #include because it was all inline, so I had to add dependencies on base_test_support in a few places. Moves and renames the command line switch this was using to base_switches. Move the base switch for process type to chrome switches. TEST=none BUG=none Review URL: http://codereview.chromium.org/3026055 TBR=brettw@chromium.org Review URL: http://codereview.chromium.org/3035062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55416 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/app/breakpad_win.cc1
-rw-r--r--chrome/chrome_installer.gypi3
-rw-r--r--chrome/common/chrome_switches.cc4
-rw-r--r--chrome/common/chrome_switches.h1
-rw-r--r--chrome/common/process_watcher_unittest.cc9
-rw-r--r--chrome/common/sandbox_mac_unittest_helper.h4
-rw-r--r--chrome/common/sandbox_mac_unittest_helper.mm7
-rw-r--r--chrome/renderer/renderer_main_unittest.cc8
-rw-r--r--chrome/test/mini_installer_test/run_all_unittests.cc3
-rw-r--r--chrome/test/perf/perftests.cc2
-rw-r--r--chrome/test/test_launcher/out_of_proc_test_runner.cc2
-rw-r--r--chrome/test/test_launcher/test_runner.cc2
-rw-r--r--chrome/test/unit/chrome_test_suite.h11
13 files changed, 19 insertions, 38 deletions
diff --git a/chrome/app/breakpad_win.cc b/chrome/app/breakpad_win.cc
index c3a9533..a21f5b5 100644
--- a/chrome/app/breakpad_win.cc
+++ b/chrome/app/breakpad_win.cc
@@ -22,7 +22,6 @@
#include "breakpad/src/client/windows/handler/exception_handler.h"
#include "chrome/app/hard_error_handler_win.h"
#include "chrome/common/child_process_logging.h"
-#include "chrome/common/chrome_switches.h"
#include "chrome/common/env_vars.h"
#include "chrome/common/result_codes.h"
#include "chrome/common/policy_constants.h"
diff --git a/chrome/chrome_installer.gypi b/chrome/chrome_installer.gypi
index aab12c5..d3d7046 100644
--- a/chrome/chrome_installer.gypi
+++ b/chrome/chrome_installer.gypi
@@ -66,7 +66,6 @@
'installer_util_strings',
'<(DEPTH)/base/base.gyp:base',
'<(DEPTH)/base/base.gyp:base_i18n',
- '<(DEPTH)/base/base.gyp:test_support_base',
'<(DEPTH)/build/temp_gyp/googleurl.gyp:googleurl',
'<(DEPTH)/testing/gtest.gyp:gtest',
],
@@ -145,7 +144,6 @@
'installer_util',
'<(DEPTH)/base/base.gyp:base',
'<(DEPTH)/base/base.gyp:base_i18n',
- '<(DEPTH)/base/base.gyp:test_support_base',
'<(DEPTH)/testing/gtest.gyp:gtest',
],
'include_dirs': [
@@ -295,7 +293,6 @@
'installer_util',
'<(DEPTH)/base/base.gyp:base',
'<(DEPTH)/base/base.gyp:base_i18n',
- '<(DEPTH)/base/base.gyp:test_support_base',
'<(DEPTH)/build/temp_gyp/googleurl.gyp:googleurl',
'<(DEPTH)/testing/gtest.gyp:gtest',
],
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 4deba43..32cbdca 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -752,10 +752,6 @@ const char kProcessPerSite[] = "process-per-site";
// script connections to each other).
const char kProcessPerTab[] = "process-per-tab";
-// The value of this switch determines whether the process is started as a
-// renderer or plugin host. If it's empty, it's the browser.
-const char kProcessType[] = "type";
-
// Output the product version information and quit. Used as an internal api to
// detect the installed version of Chrome on Linux.
const char kProductVersion[] = "product-version";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 4767574..0db5f99 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -220,7 +220,6 @@ extern const char kPrelaunchGpuProcess[];
extern const char kPrint[];
extern const char kProcessPerSite[];
extern const char kProcessPerTab[];
-extern const char kProcessType[];
extern const char kProductVersion[];
extern const char kProfileImportProcess[];
extern const char kProxyAutoDetect[];
diff --git a/chrome/common/process_watcher_unittest.cc b/chrome/common/process_watcher_unittest.cc
index 9bde1ac..159ebb59 100644
--- a/chrome/common/process_watcher_unittest.cc
+++ b/chrome/common/process_watcher_unittest.cc
@@ -8,12 +8,11 @@
#include <sys/wait.h>
#include "base/eintr_wrapper.h"
+#include "base/multiprocess_test.h"
#include "base/process_util.h"
-#include "base/test/multiprocess_test.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "testing/multiprocess_func_list.h"
-class ProcessWatcherTest : public base::MultiProcessTest {
+class ProcessWatcherTest : public MultiProcessTest {
};
namespace {
@@ -30,7 +29,7 @@ bool IsProcessDead(base::ProcessHandle child) {
TEST_F(ProcessWatcherTest, DelayedTermination) {
base::ProcessHandle child_process =
- SpawnChild("process_watcher_test_never_die", false);
+ SpawnChild("process_watcher_test_never_die");
ProcessWatcher::EnsureProcessTerminated(child_process);
base::WaitForSingleProcess(child_process, 5000);
@@ -48,7 +47,7 @@ MULTIPROCESS_TEST_MAIN(process_watcher_test_never_die) {
TEST_F(ProcessWatcherTest, ImmediateTermination) {
base::ProcessHandle child_process =
- SpawnChild("process_watcher_test_die_immediately", false);
+ SpawnChild("process_watcher_test_die_immediately");
// Give it time to die.
sleep(2);
ProcessWatcher::EnsureProcessTerminated(child_process);
diff --git a/chrome/common/sandbox_mac_unittest_helper.h b/chrome/common/sandbox_mac_unittest_helper.h
index 960a4cf..3006576 100644
--- a/chrome/common/sandbox_mac_unittest_helper.h
+++ b/chrome/common/sandbox_mac_unittest_helper.h
@@ -6,7 +6,7 @@
#define CHROME_COMMON_SANDBOX_MAC_UNITTEST_HELPER_H_
#pragma once
-#include "base/test/multiprocess_test.h"
+#include "base/multiprocess_test.h"
#include "chrome/common/sandbox_mac.h"
namespace sandboxtest {
@@ -43,7 +43,7 @@ namespace sandboxtest {
// Base test type with helper functions to spawn a subprocess that exercises
// a given test in the sandbox.
-class MacSandboxTest : public base::MultiProcessTest {
+class MacSandboxTest : public MultiProcessTest {
public:
// Runs a test specified by |test_name| in a sandbox of the type specified
// by |sandbox_type|. |test_data| is a custom string that a test can pass
diff --git a/chrome/common/sandbox_mac_unittest_helper.mm b/chrome/common/sandbox_mac_unittest_helper.mm
index 5b421c6..5ad7260 100644
--- a/chrome/common/sandbox_mac_unittest_helper.mm
+++ b/chrome/common/sandbox_mac_unittest_helper.mm
@@ -8,12 +8,8 @@ extern "C" {
#include <sandbox.h>
}
-#include <map>
-
-#include "base/logging.h"
#include "base/scoped_ptr.h"
#include "chrome/common/sandbox_mac.h"
-#include "testing/multiprocess_func_list.h"
namespace {
@@ -75,8 +71,7 @@ bool MacSandboxTest::RunTestInSandbox(sandbox::SandboxProcessType sandbox_type,
if (test_data)
setenv(kTestDataKey, test_data, 1);
- base::ProcessHandle child_process = SpawnChild("mac_sandbox_test_runner",
- false);
+ base::ProcessHandle child_process = SpawnChild("mac_sandbox_test_runner");
int code = -1;
if (!base::WaitForExitCode(child_process, &code)) {
LOG(WARNING) << "base::WaitForExitCode failed";
diff --git a/chrome/renderer/renderer_main_unittest.cc b/chrome/renderer/renderer_main_unittest.cc
index f30103c..f329337 100644
--- a/chrome/renderer/renderer_main_unittest.cc
+++ b/chrome/renderer/renderer_main_unittest.cc
@@ -1,16 +1,15 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 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 "base/message_loop.h"
+#include "base/multiprocess_test.h"
#include "base/process_util.h"
-#include "base/test/multiprocess_test.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/main_function_params.h"
#include "ipc/ipc_channel.h"
#include "ipc/ipc_switches.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "testing/multiprocess_func_list.h"
// TODO(port): Bring up this test this on other platforms.
#if defined(OS_POSIX)
@@ -23,8 +22,9 @@ extern int RendererMain(const MainFunctionParams& parameters);
// TODO(port): The IPC Channel tests have a class with extremely similar
// functionality, we should combine them.
-class RendererMainTest : public base::MultiProcessTest {
+class RendererMainTest : public MultiProcessTest {
protected:
+
// Create a new MessageLoopForIO For each test.
virtual void SetUp();
virtual void TearDown();
diff --git a/chrome/test/mini_installer_test/run_all_unittests.cc b/chrome/test/mini_installer_test/run_all_unittests.cc
index a0f6159..0549e1a 100644
--- a/chrome/test/mini_installer_test/run_all_unittests.cc
+++ b/chrome/test/mini_installer_test/run_all_unittests.cc
@@ -4,7 +4,6 @@
#include "base/command_line.h"
#include "base/file_util.h"
-#include "base/process_util.h"
#include "base/test/test_suite.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/installer/util/util_constants.h"
@@ -45,7 +44,7 @@ int main(int argc, char** argv) {
// with cleaning the system or make a backup before continuing.
CommandLine::Init(argc, argv);
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
- base::TestSuite test_suite(argc, argv);
+ TestSuite test_suite = TestSuite(argc, argv);
if (command_line.HasSwitch(switches::kInstallerTestClean)) {
printf("Current version of Chrome will be uninstalled "
"from all levels before proceeding with tests.\n");
diff --git a/chrome/test/perf/perftests.cc b/chrome/test/perf/perftests.cc
index dd00b65..904d44e 100644
--- a/chrome/test/perf/perftests.cc
+++ b/chrome/test/perf/perftests.cc
@@ -7,7 +7,7 @@
#include "chrome/common/chrome_paths.cc"
int main(int argc, char **argv) {
- base::PerfTestSuite suite(argc, argv);
+ PerfTestSuite suite(argc, argv);
chrome::RegisterPathProvider();
MessageLoop main_message_loop;
diff --git a/chrome/test/test_launcher/out_of_proc_test_runner.cc b/chrome/test/test_launcher/out_of_proc_test_runner.cc
index 290bec0..eb4e172 100644
--- a/chrome/test/test_launcher/out_of_proc_test_runner.cc
+++ b/chrome/test/test_launcher/out_of_proc_test_runner.cc
@@ -78,7 +78,7 @@ class OutOfProcTestRunner : public tests::TestRunner {
// Do not let the child ignore failures. We need to propagate the
// failure status back to the parent.
- new_cmd_line.AppendSwitch(base::TestSuite::kStrictFailureHandling);
+ new_cmd_line.AppendSwitch(kStrictFailureHandling);
base::ProcessHandle process_handle;
if (!base::LaunchApp(new_cmd_line, false, false, &process_handle))
diff --git a/chrome/test/test_launcher/test_runner.cc b/chrome/test/test_launcher/test_runner.cc
index de448a36..1b75318 100644
--- a/chrome/test/test_launcher/test_runner.cc
+++ b/chrome/test/test_launcher/test_runner.cc
@@ -237,7 +237,7 @@ bool RunTests(const TestRunnerFactory& test_runner_factory) {
++test_run_count;
if (!test_runner->RunTest(test_name.c_str())) {
failed_tests.push_back(test_name);
- bool ignore_failure = base::TestSuite::ShouldIgnoreFailure(*test_info);
+ bool ignore_failure = TestSuite::ShouldIgnoreFailure(*test_info);
printer.OnTestEnd(test_info->name(), test_case->name(), true, true,
ignore_failure,
(base::Time::Now() - start_time).InMillisecondsF());
diff --git a/chrome/test/unit/chrome_test_suite.h b/chrome/test/unit/chrome_test_suite.h
index 1cdd90f..b788879 100644
--- a/chrome/test/unit/chrome_test_suite.h
+++ b/chrome/test/unit/chrome_test_suite.h
@@ -12,11 +12,9 @@
#include "app/app_paths.h"
#include "app/resource_bundle.h"
-#include "base/command_line.h"
#include "base/stats_table.h"
#include "base/file_util.h"
#include "base/path_service.h"
-#include "base/process_util.h"
#include "base/ref_counted.h"
#include "base/scoped_nsautorelease_pool.h"
#include "base/test/test_suite.h"
@@ -30,7 +28,6 @@
#include "chrome/test/testing_browser_process.h"
#include "net/base/mock_host_resolver.h"
#include "net/base/net_util.h"
-#include "testing/gtest/include/gtest/gtest.h"
#if defined(OS_MACOSX)
#include "base/mac_util.h"
@@ -84,10 +81,10 @@ class WarningHostResolverProc : public net::HostResolverProc {
}
};
-class ChromeTestSuite : public base::TestSuite {
+class ChromeTestSuite : public TestSuite {
public:
ChromeTestSuite(int argc, char** argv)
- : base::TestSuite(argc, argv),
+ : TestSuite(argc, argv),
stats_table_(NULL),
created_user_data_dir_(false) {
}
@@ -97,7 +94,7 @@ class ChromeTestSuite : public base::TestSuite {
virtual void Initialize() {
base::ScopedNSAutoreleasePool autorelease_pool;
- base::TestSuite::Initialize();
+ TestSuite::Initialize();
chrome::RegisterChromeSchemes();
host_resolver_proc_ = new WarningHostResolverProc();
@@ -175,7 +172,7 @@ class ChromeTestSuite : public base::TestSuite {
file_util::Delete(user_data_dir, true);
file_util::Delete(user_data_dir.DirName(), false);
}
- base::TestSuite::Shutdown();
+ TestSuite::Shutdown();
}
void SetBrowserDirectory(const FilePath& browser_dir) {