Index: components/policy/core/common/remote_commands/remote_commands_queue_unittest.cc |
diff --git a/components/policy/core/common/remote_commands/remote_commands_queue_unittest.cc b/components/policy/core/common/remote_commands/remote_commands_queue_unittest.cc |
index 8bf44fee91dd353aad052d4f1f9bdd277f1bcde5..d67473c07bc5293110c3a0f359e69f776bbba3fb 100644 |
--- a/components/policy/core/common/remote_commands/remote_commands_queue_unittest.cc |
+++ b/components/policy/core/common/remote_commands/remote_commands_queue_unittest.cc |
@@ -56,26 +56,6 @@ class MockRemoteCommandsQueueObserver : public RemoteCommandsQueue::Observer { |
DISALLOW_COPY_AND_ASSIGN(MockRemoteCommandsQueueObserver); |
}; |
-// Clock which converts the current time represented by a base::TimeTick from |
-// base::TestMockTimeTaskRunner to a base::Time. |
-class TestingClock : public base::Clock { |
- public: |
- explicit TestingClock(scoped_refptr<base::TestMockTimeTaskRunner> task_runner) |
- : task_runner_(task_runner) {} |
- ~TestingClock() override {} |
- |
- // base::Clock: |
- base::Time Now() override { |
- return (task_runner_->GetCurrentMockTime() - base::TimeTicks::UnixEpoch()) + |
- base::Time::UnixEpoch(); |
- } |
- |
- private: |
- scoped_refptr<base::TestMockTimeTaskRunner> task_runner_; |
- |
- DISALLOW_COPY_AND_ASSIGN(TestingClock); |
-}; |
- |
} // namespace |
using ::testing::InSequence; |
@@ -122,11 +102,12 @@ class RemoteCommandsQueueTest : public testing::Test { |
RemoteCommandsQueueTest::RemoteCommandsQueueTest() |
: task_runner_(new base::TestMockTimeTaskRunner()), |
+ clock_(nullptr), |
runner_handle_(task_runner_) { |
} |
void RemoteCommandsQueueTest::SetUp() { |
- scoped_ptr<base::Clock> clock(new TestingClock(task_runner_)); |
+ scoped_ptr<base::Clock> clock(task_runner_->GetMockClock()); |
test_start_time_ = clock->Now(); |
clock_ = clock.get(); |