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

Unified Diff: components/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests.cc

Issue 1424053002: Adds a flag to support "Virtual Time" to the blink scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years, 1 month 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: components/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests.cc
diff --git a/components/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests.cc b/components/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests.cc
index 23c69978402bf982ee9fdd0a986e376b11a273f7..c1aa4790bd534dc4a2a394dd3f1c7c580b5609a4 100644
--- a/components/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests.cc
+++ b/components/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests.cc
@@ -4,6 +4,8 @@
#include "components/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests.h"
+#include "base/time/default_tick_clock.h"
+
namespace scheduler {
// static
@@ -15,7 +17,8 @@ LazySchedulerMessageLoopDelegateForTests::Create() {
LazySchedulerMessageLoopDelegateForTests::
LazySchedulerMessageLoopDelegateForTests()
: message_loop_(base::MessageLoop::current()),
- thread_id_(base::PlatformThread::CurrentId()) {
+ thread_id_(base::PlatformThread::CurrentId()),
+ time_source_(make_scoped_ptr(new base::DefaultTickClock())) {
if (message_loop_)
original_task_runner_ = message_loop_->task_runner();
}
@@ -82,4 +85,10 @@ bool LazySchedulerMessageLoopDelegateForTests::IsNested() const {
return EnsureMessageLoop()->IsNested();
}
+base::TimeTicks LazySchedulerMessageLoopDelegateForTests::NowTicks() {
+ return time_source_->NowTicks();
+}
+
+void LazySchedulerMessageLoopDelegateForTests::OnNoMoreImmediateWork() {}
+
} // namespace scheduler
« no previous file with comments | « components/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests.h ('k') | content/browser/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698