Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Unified Diff: base/test/launcher/test_launcher.cc

Issue 1446363003: Deleted OS_WIN and all Windows specific files from base. (Closed) Base URL: https://github.com/domokit/mojo.git@base_tests
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/test/expectations/expectation.cc ('k') | base/test/launcher/unit_test_launcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/launcher/test_launcher.cc
diff --git a/base/test/launcher/test_launcher.cc b/base/test/launcher/test_launcher.cc
index 7f258f5f3953f7b20b3379f87fb009bbc6e78de2..26f3eb72725ed0f7081cb7ed6a3e4d6a2e6746df 100644
--- a/base/test/launcher/test_launcher.cc
+++ b/base/test/launcher/test_launcher.cc
@@ -45,10 +45,6 @@
#include "base/mac/scoped_nsautorelease_pool.h"
#endif
-#if defined(OS_WIN)
-#include "base/win/windows_version.h"
-#endif
-
namespace base {
// See https://groups.google.com/a/chromium.org/d/msg/chromium-dev/nkdTP7sstSc/uT3FaE_sgkAJ .
@@ -230,9 +226,7 @@ CommandLine PrepareCommandLineForGTest(const CommandLine& command_line,
// does not really support removing switches well, and trying to do that
// on a CommandLine with a wrapper is known to break.
// TODO(phajdan.jr): Give it a try to support CommandLine removing switches.
-#if defined(OS_WIN)
- new_command_line.PrependWrapper(ASCIIToUTF16(wrapper));
-#elif defined(OS_POSIX)
+#if defined(OS_POSIX)
new_command_line.PrependWrapper(wrapper);
#endif
@@ -254,34 +248,6 @@ int LaunchChildTestProcessWithOptions(const CommandLine& command_line,
LaunchOptions new_options(options);
-#if defined(OS_WIN)
- DCHECK(!new_options.job_handle);
-
- win::ScopedHandle job_handle;
- if (flags & TestLauncher::USE_JOB_OBJECTS) {
- job_handle.Set(CreateJobObject(NULL, NULL));
- if (!job_handle.IsValid()) {
- LOG(ERROR) << "Could not create JobObject.";
- return -1;
- }
-
- DWORD job_flags = JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE;
-
- // Allow break-away from job since sandbox and few other places rely on it
- // on Windows versions prior to Windows 8 (which supports nested jobs).
- if (win::GetVersion() < win::VERSION_WIN8 &&
- flags & TestLauncher::ALLOW_BREAKAWAY_FROM_JOB) {
- job_flags |= JOB_OBJECT_LIMIT_BREAKAWAY_OK;
- }
-
- if (!SetJobObjectLimitFlags(job_handle.Get(), job_flags)) {
- LOG(ERROR) << "Could not SetJobObjectLimitFlags.";
- return -1;
- }
-
- new_options.job_handle = job_handle.Get();
- }
-#endif // defined(OS_WIN)
#if defined(OS_LINUX)
// To prevent accidental privilege sharing to an untrusted child, processes
@@ -361,30 +327,7 @@ void DoLaunchChildTestProcess(
CHECK(CreateTemporaryFile(&output_file));
LaunchOptions options;
-#if defined(OS_WIN)
- win::ScopedHandle handle;
-
- if (redirect_stdio) {
- // Make the file handle inheritable by the child.
- SECURITY_ATTRIBUTES sa_attr;
- sa_attr.nLength = sizeof(SECURITY_ATTRIBUTES);
- sa_attr.lpSecurityDescriptor = NULL;
- sa_attr.bInheritHandle = TRUE;
-
- handle.Set(CreateFile(output_file.value().c_str(),
- GENERIC_WRITE,
- FILE_SHARE_READ | FILE_SHARE_DELETE,
- &sa_attr,
- OPEN_EXISTING,
- FILE_ATTRIBUTE_TEMPORARY,
- NULL));
- CHECK(handle.IsValid());
- options.inherit_handles = true;
- options.stdin_handle = INVALID_HANDLE_VALUE;
- options.stdout_handle = handle.Get();
- options.stderr_handle = handle.Get();
- }
-#elif defined(OS_POSIX)
+#if defined(OS_POSIX)
options.new_process_group = true;
#if defined(OS_LINUX)
options.kill_on_parent_death = true;
@@ -408,10 +351,7 @@ void DoLaunchChildTestProcess(
command_line, options, flags, timeout, &was_timeout);
if (redirect_stdio) {
-#if defined(OS_WIN)
- FlushFileBuffers(handle.Get());
- handle.Close();
-#elif defined(OS_POSIX)
+#if defined(OS_POSIX)
output_file_fd.reset();
#endif
}
@@ -876,10 +816,6 @@ bool TestLauncher::Init() {
results_tracker_.AddGlobalTag("OS_SOLARIS");
#endif
-#if defined(OS_WIN)
- results_tracker_.AddGlobalTag("OS_WIN");
-#endif
-
// CPU-related tags.
#if defined(ARCH_CPU_32_BITS)
results_tracker_.AddGlobalTag("CPU_32_BITS");
@@ -1032,11 +968,7 @@ void TestLauncher::OnOutputTimeout() {
g_live_processes.Get().begin();
i != g_live_processes.Get().end();
++i) {
-#if defined(OS_WIN)
- fwprintf(stdout, L"\t%s\n", i->second.GetCommandLineString().c_str());
-#else
fprintf(stdout, "\t%s\n", i->second.GetCommandLineString().c_str());
-#endif
}
fflush(stdout);
« no previous file with comments | « base/test/expectations/expectation.cc ('k') | base/test/launcher/unit_test_launcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698