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

Side by Side Diff: base/trace_event/memory_dump_scheduler_unittest.cc

Issue 2952493002: memory-infra: Fix MemoryDumpScheduler test. (Closed)
Patch Set: Created 3 years, 6 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/trace_event/memory_dump_scheduler.h" 5 #include "base/trace_event/memory_dump_scheduler.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 178
179 scheduler_->Start(config, bg_thread_->task_runner()); 179 scheduler_->Start(config, bg_thread_->task_runner());
180 evt.Wait(); 180 evt.Wait();
181 scheduler_->Stop(); 181 scheduler_->Stop();
182 bg_thread_->Stop(); 182 bg_thread_->Stop();
183 183
184 bg_thread_.reset(new Thread("MemoryDumpSchedulerTest Thread 2")); 184 bg_thread_.reset(new Thread("MemoryDumpSchedulerTest Thread 2"));
185 bg_thread_->Start(); 185 bg_thread_->Start();
186 evt.Reset(); 186 evt.Reset();
187 expected_task_runner = bg_thread_->task_runner(); 187 expected_task_runner = bg_thread_->task_runner();
188 scheduler_->Start(config, bg_thread_->task_runner());
189 EXPECT_CALL(on_tick_, OnTick(_)).Times(kTicks - 1); 188 EXPECT_CALL(on_tick_, OnTick(_)).Times(kTicks - 1);
190 EXPECT_CALL(on_tick_, OnTick(_)) 189 EXPECT_CALL(on_tick_, OnTick(_))
191 .WillRepeatedly( 190 .WillRepeatedly(
192 Invoke([&evt, expected_task_runner](MemoryDumpLevelOfDetail) { 191 Invoke([&evt, expected_task_runner](MemoryDumpLevelOfDetail) {
193 EXPECT_TRUE(expected_task_runner->RunsTasksOnCurrentThread()); 192 EXPECT_TRUE(expected_task_runner->RunsTasksOnCurrentThread());
194 evt.Signal(); 193 evt.Signal();
195 })); 194 }));
195 scheduler_->Start(config, bg_thread_->task_runner());
196 evt.Wait(); 196 evt.Wait();
197 scheduler_->Stop(); 197 scheduler_->Stop();
198 } 198 }
199 199
200 } // namespace trace_event 200 } // namespace trace_event
201 } // namespace base 201 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698