OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/test/launcher/test_launcher.h" | 5 #include "base/test/launcher/test_launcher.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // Avoids flooding the logs with amount of output that gums up | 90 // Avoids flooding the logs with amount of output that gums up |
91 // the infrastructure. | 91 // the infrastructure. |
92 const size_t kOutputSnippetLinesLimit = 5000; | 92 const size_t kOutputSnippetLinesLimit = 5000; |
93 | 93 |
94 // Limit of output snippet size. Exceeding this limit | 94 // Limit of output snippet size. Exceeding this limit |
95 // results in truncating the output and failing the test. | 95 // results in truncating the output and failing the test. |
96 const size_t kOutputSnippetBytesLimit = 300 * 1024; | 96 const size_t kOutputSnippetBytesLimit = 300 * 1024; |
97 | 97 |
98 // Set of live launch test processes with corresponding lock (it is allowed | 98 // Set of live launch test processes with corresponding lock (it is allowed |
99 // for callers to launch processes on different threads). | 99 // for callers to launch processes on different threads). |
100 LazyInstance<std::map<ProcessHandle, CommandLine> > g_live_processes | 100 LazyInstance<std::map<ProcessHandle, CommandLine>>::DestructorAtExit |
101 = LAZY_INSTANCE_INITIALIZER; | 101 g_live_processes = LAZY_INSTANCE_INITIALIZER; |
102 LazyInstance<Lock> g_live_processes_lock = LAZY_INSTANCE_INITIALIZER; | 102 LazyInstance<Lock>::DestructorAtExit g_live_processes_lock = |
| 103 LAZY_INSTANCE_INITIALIZER; |
103 | 104 |
104 // Performance trace generator. | 105 // Performance trace generator. |
105 LazyInstance<TestLauncherTracer> g_tracer = LAZY_INSTANCE_INITIALIZER; | 106 LazyInstance<TestLauncherTracer>::DestructorAtExit g_tracer = |
| 107 LAZY_INSTANCE_INITIALIZER; |
106 | 108 |
107 #if defined(OS_POSIX) | 109 #if defined(OS_POSIX) |
108 // Self-pipe that makes it possible to do complex shutdown handling | 110 // Self-pipe that makes it possible to do complex shutdown handling |
109 // outside of the signal handler. | 111 // outside of the signal handler. |
110 int g_shutdown_pipe[2] = { -1, -1 }; | 112 int g_shutdown_pipe[2] = { -1, -1 }; |
111 | 113 |
112 void ShutdownPipeSignalHandler(int signal) { | 114 void ShutdownPipeSignalHandler(int signal) { |
113 HANDLE_EINTR(write(g_shutdown_pipe[1], "q", 1)); | 115 HANDLE_EINTR(write(g_shutdown_pipe[1], "q", 1)); |
114 } | 116 } |
115 | 117 |
(...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1214 } | 1216 } |
1215 | 1217 |
1216 std::string snippet(full_output.substr(run_pos)); | 1218 std::string snippet(full_output.substr(run_pos)); |
1217 if (end_pos != std::string::npos) | 1219 if (end_pos != std::string::npos) |
1218 snippet = full_output.substr(run_pos, end_pos - run_pos); | 1220 snippet = full_output.substr(run_pos, end_pos - run_pos); |
1219 | 1221 |
1220 return snippet; | 1222 return snippet; |
1221 } | 1223 } |
1222 | 1224 |
1223 } // namespace base | 1225 } // namespace base |
OLD | NEW |