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

Unified Diff: base/profiler/stack_sampling_profiler_unittest.cc

Issue 2554123002: Support parallel captures from the StackSamplingProfiler. (Closed)
Patch Set: pass ID instead of pointers Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: base/profiler/stack_sampling_profiler_unittest.cc
diff --git a/base/profiler/stack_sampling_profiler_unittest.cc b/base/profiler/stack_sampling_profiler_unittest.cc
index 662a285377ec593ebf1dd99d2826dc354551a295..fa842a94318ff79d8f1614969f065329cc50c7bf 100644
--- a/base/profiler/stack_sampling_profiler_unittest.cc
+++ b/base/profiler/stack_sampling_profiler_unittest.cc
@@ -882,11 +882,12 @@ TEST(StackSamplingProfilerTest, MAYBE_ConcurrentProfiling) {
WithTargetThread([](PlatformThreadId target_thread_id) {
SamplingParams params[2];
params[0].initial_delay = TimeDelta::FromMilliseconds(10);
- params[0].sampling_interval = TimeDelta::FromMilliseconds(0);
- params[0].samples_per_burst = 1;
+ params[0].sampling_interval = TimeDelta::FromMilliseconds(1);
+ params[0].samples_per_burst = 10;
- params[1].sampling_interval = TimeDelta::FromMilliseconds(0);
- params[1].samples_per_burst = 1;
+ params[0].initial_delay = TimeDelta::FromMilliseconds(10);
+ params[1].sampling_interval = TimeDelta::FromMilliseconds(1);
+ params[1].samples_per_burst = 10;
CallStackProfiles profiles[2];
ScopedVector<WaitableEvent> sampling_completed;
@@ -911,14 +912,9 @@ TEST(StackSamplingProfilerTest, MAYBE_ConcurrentProfiling) {
EXPECT_EQ(1u, profiles[completed_profiler].size());
size_t other_profiler = 1 - completed_profiler;
- // Give the other profiler a chance to run and observe that it hasn't.
- EXPECT_FALSE(sampling_completed[other_profiler]->TimedWait(
- TimeDelta::FromMilliseconds(25)));
-
- // Start the other profiler again and it should run.
- profiler[other_profiler]->Start();
- sampling_completed[other_profiler]->Wait();
- EXPECT_EQ(1u, profiles[other_profiler].size());
+ // Give the other profiler a chance to finish and verify it does no.
+ EXPECT_TRUE(sampling_completed[other_profiler]->TimedWait(
+ TimeDelta::FromMilliseconds(250)));
});
}
« base/profiler/stack_sampling_profiler.cc ('K') | « base/profiler/stack_sampling_profiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698