summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/app/breakpad_win.cc1
-rw-r--r--chrome/browser/importer/firefox_importer_unittest_utils_mac.cc3
-rw-r--r--chrome/common/chrome_switches.cc9
-rw-r--r--chrome/common/chrome_switches.h1
-rw-r--r--chrome/common/process_watcher_unittest.cc9
-rw-r--r--chrome/common/sandbox_mac_diraccess_unittest.mm10
-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/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, 47 insertions, 23 deletions
diff --git a/chrome/app/breakpad_win.cc b/chrome/app/breakpad_win.cc
index 1332a8e..4eb213e 100644
--- a/chrome/app/breakpad_win.cc
+++ b/chrome/app/breakpad_win.cc
@@ -24,6 +24,7 @@
#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/browser/importer/firefox_importer_unittest_utils_mac.cc b/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc
index 859811e..f9958fb 100644
--- a/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc
+++ b/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/importer/firefox_importer_unittest_utils.h"
+#include "base/base_switches.h"
#include "base/command_line.h"
#include "base/debug_on_start.h"
#include "base/file_path.h"
@@ -39,7 +40,7 @@ const char kTestChannelID[] = "T1";
bool LaunchNSSDecrypterChildProcess(const std::wstring& nss_path,
const IPC::Channel& channel, base::ProcessHandle* handle) {
CommandLine cl(*CommandLine::ForCurrentProcess());
- cl.AppendSwitchASCII("client", "NSSDecrypterChildProcess");
+ cl.AppendSwitchASCII(switches::kTestChildProcess, "NSSDecrypterChildProcess");
FilePath ff_dylib_dir = FilePath::FromWStringHack(nss_path);
// Set env variable needed for FF encryption libs to load.
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 2242966..b99a8cb 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -767,6 +767,10 @@ 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";
@@ -850,8 +854,10 @@ const char kSafePlugins[] = "safe-plugins";
// URL prefix used by safebrowsing to fetch hash, download data and
// report malware.
const char kSbInfoURLPrefix[] = "safebrowsing-info-url-prefix";
+
// URL prefix used by safebrowsing to get MAC key.
const char kSbMacKeyURLPrefix[] = "safebrowsing-mackey-url-prefix";
+
// If present, safebrowsing only performs update when
// SafeBrowsingProtocolManager::ForceScheduleNextUpdate() is explicitly called.
// This is used for testing only.
@@ -1047,14 +1053,17 @@ const char kEnableLoginImages[] = "enable-login-images";
// Enable Chrome-as-a-login-manager behavior.
const char kLoginManager[] = "login-manager";
+
// Allows to override the first login screen. The value should be the name
// of the first login screen to show (see
// chrome/browser/chromeos/login/login_wizard_view.cc for actual names).
// Ignored if kLoginManager is not specified.
// TODO(avayvod): Remove when the switch is no longer needed for testing.
const char kLoginScreen[] = "login-screen";
+
// Allows control over the initial login screen size. Pass width,height.
const char kLoginScreenSize[] = "login-screen-size";
+
// Attempts to load libcros and validate it, then exits. A nonzero return code
// means the library could not be loaded correctly.
const char kTestLoadLibcros[] = "test-load-libcros";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 9ffd444..1c6c116d0 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -226,6 +226,7 @@ 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 159ebb59..9bde1ac 100644
--- a/chrome/common/process_watcher_unittest.cc
+++ b/chrome/common/process_watcher_unittest.cc
@@ -8,11 +8,12 @@
#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 MultiProcessTest {
+class ProcessWatcherTest : public base::MultiProcessTest {
};
namespace {
@@ -29,7 +30,7 @@ bool IsProcessDead(base::ProcessHandle child) {
TEST_F(ProcessWatcherTest, DelayedTermination) {
base::ProcessHandle child_process =
- SpawnChild("process_watcher_test_never_die");
+ SpawnChild("process_watcher_test_never_die", false);
ProcessWatcher::EnsureProcessTerminated(child_process);
base::WaitForSingleProcess(child_process, 5000);
@@ -47,7 +48,7 @@ MULTIPROCESS_TEST_MAIN(process_watcher_test_never_die) {
TEST_F(ProcessWatcherTest, ImmediateTermination) {
base::ProcessHandle child_process =
- SpawnChild("process_watcher_test_die_immediately");
+ SpawnChild("process_watcher_test_die_immediately", false);
// Give it time to die.
sleep(2);
ProcessWatcher::EnsureProcessTerminated(child_process);
diff --git a/chrome/common/sandbox_mac_diraccess_unittest.mm b/chrome/common/sandbox_mac_diraccess_unittest.mm
index 1f68a6b..048d13f 100644
--- a/chrome/common/sandbox_mac_diraccess_unittest.mm
+++ b/chrome/common/sandbox_mac_diraccess_unittest.mm
@@ -11,11 +11,12 @@ extern "C" {
#include "base/file_util.h"
#include "base/file_path.h"
-#include "base/multiprocess_test.h"
+#include "base/test/multiprocess_test.h"
#include "base/sys_string_conversions.h"
#include "base/utf_string_conversions.h"
#include "chrome/common/sandbox_mac.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "testing/multiprocess_func_list.h"
// Tests to exercise directory-access-related restrictions of Mac sandbox.
@@ -30,11 +31,12 @@ namespace {
static const char* kSandboxAccessPathKey = "sandbox_dir";
-class MacDirAccessSandboxTest : public MultiProcessTest {
+class MacDirAccessSandboxTest : public base::MultiProcessTest {
public:
- bool CheckSandbox(std::string directory_to_try) {
+ bool CheckSandbox(const std::string& directory_to_try) {
setenv(kSandboxAccessPathKey, directory_to_try.c_str(), 1);
- base::ProcessHandle child_process = SpawnChild("mac_sandbox_path_access");
+ base::ProcessHandle child_process = SpawnChild("mac_sandbox_path_access",
+ false);
int code = -1;
if (!base::WaitForExitCode(child_process, &code)) {
LOG(WARNING) << "base::WaitForExitCode failed";
diff --git a/chrome/common/sandbox_mac_unittest_helper.h b/chrome/common/sandbox_mac_unittest_helper.h
index 3006576..960a4cf 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/multiprocess_test.h"
+#include "base/test/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 MultiProcessTest {
+class MacSandboxTest : public base::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 5ad7260..5b421c6 100644
--- a/chrome/common/sandbox_mac_unittest_helper.mm
+++ b/chrome/common/sandbox_mac_unittest_helper.mm
@@ -8,8 +8,12 @@ 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 {
@@ -71,7 +75,8 @@ bool MacSandboxTest::RunTestInSandbox(sandbox::SandboxProcessType sandbox_type,
if (test_data)
setenv(kTestDataKey, test_data, 1);
- base::ProcessHandle child_process = SpawnChild("mac_sandbox_test_runner");
+ base::ProcessHandle child_process = SpawnChild("mac_sandbox_test_runner",
+ false);
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 f329337..f30103c 100644
--- a/chrome/renderer/renderer_main_unittest.cc
+++ b/chrome/renderer/renderer_main_unittest.cc
@@ -1,15 +1,16 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 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)
@@ -22,9 +23,8 @@ 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 MultiProcessTest {
+class RendererMainTest : public base::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 0549e1a..a0f6159 100644
--- a/chrome/test/mini_installer_test/run_all_unittests.cc
+++ b/chrome/test/mini_installer_test/run_all_unittests.cc
@@ -4,6 +4,7 @@
#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"
@@ -44,7 +45,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();
- TestSuite test_suite = TestSuite(argc, argv);
+ base::TestSuite test_suite(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/test_launcher/out_of_proc_test_runner.cc b/chrome/test/test_launcher/out_of_proc_test_runner.cc
index c614065..786863a 100644
--- a/chrome/test/test_launcher/out_of_proc_test_runner.cc
+++ b/chrome/test/test_launcher/out_of_proc_test_runner.cc
@@ -85,7 +85,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(kStrictFailureHandling);
+ new_cmd_line.AppendSwitch(base::TestSuite::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 1b75318..de448a36 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 = TestSuite::ShouldIgnoreFailure(*test_info);
+ bool ignore_failure = base::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 b788879..1cdd90f 100644
--- a/chrome/test/unit/chrome_test_suite.h
+++ b/chrome/test/unit/chrome_test_suite.h
@@ -12,9 +12,11 @@
#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"
@@ -28,6 +30,7 @@
#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"
@@ -81,10 +84,10 @@ class WarningHostResolverProc : public net::HostResolverProc {
}
};
-class ChromeTestSuite : public TestSuite {
+class ChromeTestSuite : public base::TestSuite {
public:
ChromeTestSuite(int argc, char** argv)
- : TestSuite(argc, argv),
+ : base::TestSuite(argc, argv),
stats_table_(NULL),
created_user_data_dir_(false) {
}
@@ -94,7 +97,7 @@ class ChromeTestSuite : public TestSuite {
virtual void Initialize() {
base::ScopedNSAutoreleasePool autorelease_pool;
- TestSuite::Initialize();
+ base::TestSuite::Initialize();
chrome::RegisterChromeSchemes();
host_resolver_proc_ = new WarningHostResolverProc();
@@ -172,7 +175,7 @@ class ChromeTestSuite : public TestSuite {
file_util::Delete(user_data_dir, true);
file_util::Delete(user_data_dir.DirName(), false);
}
- TestSuite::Shutdown();
+ base::TestSuite::Shutdown();
}
void SetBrowserDirectory(const FilePath& browser_dir) {