| 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> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <sstream> | 10 #include <sstream> |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 #if defined(OS_LINUX) || defined(OS_ANDROID) | 411 #if defined(OS_LINUX) || defined(OS_ANDROID) |
| 412 EXPECT_GT(info.buffers, 0); | 412 EXPECT_GT(info.buffers, 0); |
| 413 EXPECT_GT(info.cached, 0); | 413 EXPECT_GT(info.cached, 0); |
| 414 EXPECT_GT(info.active_anon, 0); | 414 EXPECT_GT(info.active_anon, 0); |
| 415 EXPECT_GT(info.inactive_anon, 0); | 415 EXPECT_GT(info.inactive_anon, 0); |
| 416 EXPECT_GT(info.active_file, 0); | 416 EXPECT_GT(info.active_file, 0); |
| 417 EXPECT_GT(info.inactive_file, 0); | 417 EXPECT_GT(info.inactive_file, 0); |
| 418 #endif // defined(OS_LINUX) || defined(OS_ANDROID) | 418 #endif // defined(OS_LINUX) || defined(OS_ANDROID) |
| 419 | 419 |
| 420 // All the values should be less than the total amount of memory. | 420 // All the values should be less than the total amount of memory. |
| 421 #if !defined(OS_WIN) | 421 #if !defined(OS_WIN) && !defined(OS_IOS) |
| 422 // TODO(crbug.com/711450): re-enable the following assertion on iOS. |
| 422 EXPECT_LT(info.free, info.total); | 423 EXPECT_LT(info.free, info.total); |
| 423 #endif | 424 #endif |
| 424 #if defined(OS_LINUX) || defined(OS_ANDROID) | 425 #if defined(OS_LINUX) || defined(OS_ANDROID) |
| 425 EXPECT_LT(info.buffers, info.total); | 426 EXPECT_LT(info.buffers, info.total); |
| 426 EXPECT_LT(info.cached, info.total); | 427 EXPECT_LT(info.cached, info.total); |
| 427 EXPECT_LT(info.active_anon, info.total); | 428 EXPECT_LT(info.active_anon, info.total); |
| 428 EXPECT_LT(info.inactive_anon, info.total); | 429 EXPECT_LT(info.inactive_anon, info.total); |
| 429 EXPECT_LT(info.active_file, info.total); | 430 EXPECT_LT(info.active_file, info.total); |
| 430 EXPECT_LT(info.inactive_file, info.total); | 431 EXPECT_LT(info.inactive_file, info.total); |
| 431 #endif // defined(OS_LINUX) || defined(OS_ANDROID) | 432 #endif // defined(OS_LINUX) || defined(OS_ANDROID) |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 | 563 |
| 563 std::unique_ptr<ProcessMetrics> metrics( | 564 std::unique_ptr<ProcessMetrics> metrics( |
| 564 ProcessMetrics::CreateProcessMetrics(spawn_child.process.Handle())); | 565 ProcessMetrics::CreateProcessMetrics(spawn_child.process.Handle())); |
| 565 EXPECT_EQ(0, metrics->GetOpenFdCount()); | 566 EXPECT_EQ(0, metrics->GetOpenFdCount()); |
| 566 ASSERT_TRUE(spawn_child.process.Terminate(0, true)); | 567 ASSERT_TRUE(spawn_child.process.Terminate(0, true)); |
| 567 } | 568 } |
| 568 #endif // defined(OS_LINUX) | 569 #endif // defined(OS_LINUX) |
| 569 | 570 |
| 570 } // namespace debug | 571 } // namespace debug |
| 571 } // namespace base | 572 } // namespace base |
| OLD | NEW |