| 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/parallel_test_launcher.h" | 5 #include "base/test/parallel_test_launcher.h" |
| 6 | 6 |
| 7 #if defined(OS_POSIX) | 7 #if defined(OS_POSIX) |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <sys/stat.h> | 9 #include <sys/stat.h> |
| 10 #include <sys/types.h> | 10 #include <sys/types.h> |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 #if defined(OS_WIN) | 103 #if defined(OS_WIN) |
| 104 FlushFileBuffers(handle.Get()); | 104 FlushFileBuffers(handle.Get()); |
| 105 handle.Close(); | 105 handle.Close(); |
| 106 #elif defined(OS_POSIX) | 106 #elif defined(OS_POSIX) |
| 107 output_file_fd_closer.reset(); | 107 output_file_fd_closer.reset(); |
| 108 #endif | 108 #endif |
| 109 | 109 |
| 110 std::string output_file_contents; | 110 std::string output_file_contents; |
| 111 CHECK(base::ReadFileToString(output_file, &output_file_contents)); | 111 CHECK(base::ReadFileToString(output_file, &output_file_contents)); |
| 112 | 112 |
| 113 CHECK(base::DeleteFile(output_file, false)); | 113 if (!base::DeleteFile(output_file, false)) { |
| 114 // This needs to be non-fatal at least for Windows. |
| 115 LOG(WARNING) << "Failed to delete " << output_file.AsUTF8Unsafe(); |
| 116 } |
| 114 | 117 |
| 115 // Run target callback on the thread it was originating from, not on | 118 // Run target callback on the thread it was originating from, not on |
| 116 // a worker pool thread. | 119 // a worker pool thread. |
| 117 message_loop_proxy->PostTask( | 120 message_loop_proxy->PostTask( |
| 118 FROM_HERE, | 121 FROM_HERE, |
| 119 Bind(&RunCallback, | 122 Bind(&RunCallback, |
| 120 callback, | 123 callback, |
| 121 exit_code, | 124 exit_code, |
| 122 TimeTicks::Now() - start_time, | 125 TimeTicks::Now() - start_time, |
| 123 was_timeout, | 126 was_timeout, |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 #endif | 238 #endif |
| 236 } | 239 } |
| 237 | 240 |
| 238 fflush(stdout); | 241 fflush(stdout); |
| 239 | 242 |
| 240 // Arm the timer again - otherwise it would fire only once. | 243 // Arm the timer again - otherwise it would fire only once. |
| 241 timer_.Reset(); | 244 timer_.Reset(); |
| 242 } | 245 } |
| 243 | 246 |
| 244 } // namespace base | 247 } // namespace base |
| OLD | NEW |