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

Side by Side Diff: base/process/process_metrics_unittest.cc

Issue 2791243002: Rewrite base::Bind into base::BindOnce on trivial cases in base (Closed)
Patch Set: rebase Created 3 years, 8 months 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 unified diff | Download patch
« no previous file with comments | « base/posix/unix_domain_socket_linux_unittest.cc ('k') | base/run_loop_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 thread3.StartAndWaitForTesting(); 370 thread3.StartAndWaitForTesting();
371 371
372 ASSERT_TRUE(thread1.IsRunning()); 372 ASSERT_TRUE(thread1.IsRunning());
373 ASSERT_TRUE(thread2.IsRunning()); 373 ASSERT_TRUE(thread2.IsRunning());
374 ASSERT_TRUE(thread3.IsRunning()); 374 ASSERT_TRUE(thread3.IsRunning());
375 375
376 std::vector<std::string> vec1; 376 std::vector<std::string> vec1;
377 std::vector<std::string> vec2; 377 std::vector<std::string> vec2;
378 std::vector<std::string> vec3; 378 std::vector<std::string> vec3;
379 379
380 thread1.task_runner()->PostTask(FROM_HERE, Bind(&BusyWork, &vec1)); 380 thread1.task_runner()->PostTask(FROM_HERE, BindOnce(&BusyWork, &vec1));
381 thread2.task_runner()->PostTask(FROM_HERE, Bind(&BusyWork, &vec2)); 381 thread2.task_runner()->PostTask(FROM_HERE, BindOnce(&BusyWork, &vec2));
382 thread3.task_runner()->PostTask(FROM_HERE, Bind(&BusyWork, &vec3)); 382 thread3.task_runner()->PostTask(FROM_HERE, BindOnce(&BusyWork, &vec3));
383 383
384 EXPECT_GE(metrics->GetCPUUsage(), 0.0); 384 EXPECT_GE(metrics->GetCPUUsage(), 0.0);
385 385
386 thread1.Stop(); 386 thread1.Stop();
387 EXPECT_GE(metrics->GetCPUUsage(), 0.0); 387 EXPECT_GE(metrics->GetCPUUsage(), 0.0);
388 388
389 thread2.Stop(); 389 thread2.Stop();
390 EXPECT_GE(metrics->GetCPUUsage(), 0.0); 390 EXPECT_GE(metrics->GetCPUUsage(), 0.0);
391 391
392 thread3.Stop(); 392 thread3.Stop();
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 562
563 std::unique_ptr<ProcessMetrics> metrics( 563 std::unique_ptr<ProcessMetrics> metrics(
564 ProcessMetrics::CreateProcessMetrics(spawn_child.process.Handle())); 564 ProcessMetrics::CreateProcessMetrics(spawn_child.process.Handle()));
565 EXPECT_EQ(0, metrics->GetOpenFdCount()); 565 EXPECT_EQ(0, metrics->GetOpenFdCount());
566 ASSERT_TRUE(spawn_child.process.Terminate(0, true)); 566 ASSERT_TRUE(spawn_child.process.Terminate(0, true));
567 } 567 }
568 #endif // defined(OS_LINUX) 568 #endif // defined(OS_LINUX)
569 569
570 } // namespace debug 570 } // namespace debug
571 } // namespace base 571 } // namespace base
OLDNEW
« no previous file with comments | « base/posix/unix_domain_socket_linux_unittest.cc ('k') | base/run_loop_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698