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

Side by Side Diff: chromecast/base/system_time_change_notifier_unittest.cc

Issue 2823103003: Introduce TaskRunner::RunsTasksInCurrentSequence() (Closed)
Patch Set: fixed build error and commments 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chromecast/base/system_time_change_notifier.h" 5 #include "chromecast/base/system_time_change_notifier.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 22 matching lines...) Expand all
33 base::ThreadTaskRunnerHandle::Get()->PostTask(from_here, std::move(task)); 33 base::ThreadTaskRunnerHandle::Get()->PostTask(from_here, std::move(task));
34 return true; 34 return true;
35 } 35 }
36 36
37 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, 37 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here,
38 base::OnceClosure task, 38 base::OnceClosure task,
39 base::TimeDelta delay) override { 39 base::TimeDelta delay) override {
40 return true; 40 return true;
41 } 41 }
42 42
43 bool RunsTasksOnCurrentThread() const override { return true; } 43 bool RunsTasksInCurrentSequence() const override { return true; }
44 44
45 private: 45 private:
46 ~SequencedTaskRunnerNoDelay() override {} 46 ~SequencedTaskRunnerNoDelay() override {}
47 47
48 DISALLOW_COPY_AND_ASSIGN(SequencedTaskRunnerNoDelay); 48 DISALLOW_COPY_AND_ASSIGN(SequencedTaskRunnerNoDelay);
49 }; 49 };
50 50
51 class TimeChangeObserver : public SystemTimeChangeNotifier::Observer { 51 class TimeChangeObserver : public SystemTimeChangeNotifier::Observer {
52 public: 52 public:
53 TimeChangeObserver() : num_time_changed_(0) {} 53 TimeChangeObserver() : num_time_changed_(0) {}
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 RunPendingTasks(); 208 RunPendingTasks();
209 EXPECT_EQ(0, observer_->num_time_changed()); 209 EXPECT_EQ(0, observer_->num_time_changed());
210 210
211 // Time change detected. Expected = now - 20 + 1, actual = now - 20. 211 // Time change detected. Expected = now - 20 + 1, actual = now - 20.
212 notifier_->set_fake_now_for_testing(now - base::TimeDelta::FromSeconds(20)); 212 notifier_->set_fake_now_for_testing(now - base::TimeDelta::FromSeconds(20));
213 RunPendingTasks(); 213 RunPendingTasks();
214 EXPECT_EQ(0, observer_->num_time_changed()); 214 EXPECT_EQ(0, observer_->num_time_changed());
215 } 215 }
216 216
217 } // namespace chromecast 217 } // namespace chromecast
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698