OLD | NEW |
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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
11 #include "base/run_loop.h" | 12 #include "base/run_loop.h" |
12 #include "base/sequenced_task_runner.h" | 13 #include "base/sequenced_task_runner.h" |
13 #include "base/time/time.h" | 14 #include "base/time/time.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
15 | 16 |
16 namespace chromecast { | 17 namespace chromecast { |
17 | 18 |
18 namespace { | 19 namespace { |
19 | 20 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 RunPendingTasks(); | 203 RunPendingTasks(); |
203 EXPECT_EQ(0, observer_->num_time_changed()); | 204 EXPECT_EQ(0, observer_->num_time_changed()); |
204 | 205 |
205 // Time change detected. Expected = now - 20 + 1, actual = now - 20. | 206 // Time change detected. Expected = now - 20 + 1, actual = now - 20. |
206 notifier_->set_fake_now_for_testing(now - base::TimeDelta::FromSeconds(20)); | 207 notifier_->set_fake_now_for_testing(now - base::TimeDelta::FromSeconds(20)); |
207 RunPendingTasks(); | 208 RunPendingTasks(); |
208 EXPECT_EQ(0, observer_->num_time_changed()); | 209 EXPECT_EQ(0, observer_->num_time_changed()); |
209 } | 210 } |
210 | 211 |
211 } // namespace chromecast | 212 } // namespace chromecast |
OLD | NEW |