| 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/process/process_metrics.h" | 5 #include "base/process/process_metrics.h" |
| 6 | 6 |
| 7 #include <stddef.h> |
| 8 #include <stdint.h> |
| 9 |
| 7 #include <sstream> | 10 #include <sstream> |
| 8 #include <string> | 11 #include <string> |
| 9 | 12 |
| 10 #include "base/bind.h" | 13 #include "base/bind.h" |
| 11 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 12 #include "base/files/file.h" | 15 #include "base/files/file.h" |
| 13 #include "base/files/file_util.h" | 16 #include "base/files/file_util.h" |
| 14 #include "base/files/scoped_temp_dir.h" | 17 #include "base/files/scoped_temp_dir.h" |
| 18 #include "base/macros.h" |
| 15 #include "base/strings/string_number_conversions.h" | 19 #include "base/strings/string_number_conversions.h" |
| 16 #include "base/test/multiprocess_test.h" | 20 #include "base/test/multiprocess_test.h" |
| 17 #include "base/threading/thread.h" | 21 #include "base/threading/thread.h" |
| 22 #include "build/build_config.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
| 19 #include "testing/multiprocess_func_list.h" | 24 #include "testing/multiprocess_func_list.h" |
| 20 | 25 |
| 21 namespace base { | 26 namespace base { |
| 22 namespace debug { | 27 namespace debug { |
| 23 | 28 |
| 24 #if defined(OS_LINUX) || defined(OS_CHROMEOS) | 29 #if defined(OS_LINUX) || defined(OS_CHROMEOS) |
| 25 namespace { | 30 namespace { |
| 26 | 31 |
| 27 void BusyWork(std::vector<std::string>* vec) { | 32 void BusyWork(std::vector<std::string>* vec) { |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 | 498 |
| 494 scoped_ptr<ProcessMetrics> metrics( | 499 scoped_ptr<ProcessMetrics> metrics( |
| 495 ProcessMetrics::CreateProcessMetrics(child.Handle())); | 500 ProcessMetrics::CreateProcessMetrics(child.Handle())); |
| 496 EXPECT_EQ(0, metrics->GetOpenFdCount()); | 501 EXPECT_EQ(0, metrics->GetOpenFdCount()); |
| 497 ASSERT_TRUE(child.Terminate(0, true)); | 502 ASSERT_TRUE(child.Terminate(0, true)); |
| 498 } | 503 } |
| 499 #endif // defined(OS_LINUX) | 504 #endif // defined(OS_LINUX) |
| 500 | 505 |
| 501 } // namespace debug | 506 } // namespace debug |
| 502 } // namespace base | 507 } // namespace base |
| OLD | NEW |