| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "media/cast/test/fake_single_thread_task_runner.h" | 5 #include "media/base/fake_single_thread_task_runner.h" |
| 6 | 6 |
| 7 #include "base/location.h" | 7 #include "base/location.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/time/tick_clock.h" | 9 #include "base/time/tick_clock.h" |
| 10 | 10 |
| 11 namespace media { | 11 namespace media { |
| 12 namespace cast { | |
| 13 namespace test { | |
| 14 | 12 |
| 15 FakeSingleThreadTaskRunner::FakeSingleThreadTaskRunner( | 13 FakeSingleThreadTaskRunner::FakeSingleThreadTaskRunner( |
| 16 base::SimpleTestTickClock* clock) | 14 base::SimpleTestTickClock* clock) |
| 17 : clock_(clock), | 15 : clock_(clock), fail_on_next_task_(false) {} |
| 18 fail_on_next_task_(false) {} | |
| 19 | 16 |
| 20 FakeSingleThreadTaskRunner::~FakeSingleThreadTaskRunner() {} | 17 FakeSingleThreadTaskRunner::~FakeSingleThreadTaskRunner() {} |
| 21 | 18 |
| 22 bool FakeSingleThreadTaskRunner::PostDelayedTask( | 19 bool FakeSingleThreadTaskRunner::PostDelayedTask( |
| 23 const tracked_objects::Location& from_here, | 20 const tracked_objects::Location& from_here, |
| 24 const base::Closure& task, | 21 const base::Closure& task, |
| 25 base::TimeDelta delay) { | 22 base::TimeDelta delay) { |
| 26 if (fail_on_next_task_) { | 23 if (fail_on_next_task_) { |
| 27 LOG(FATAL) << "Infinite task posting loop detected. Possibly caused by " | 24 LOG(FATAL) << "Infinite task posting loop detected. Possibly caused by " |
| 28 << from_here.ToString() << " posting a task with delay " | 25 << from_here.ToString() << " posting a task with delay " |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 } | 103 } |
| 107 | 104 |
| 108 bool FakeSingleThreadTaskRunner::PostNonNestableDelayedTask( | 105 bool FakeSingleThreadTaskRunner::PostNonNestableDelayedTask( |
| 109 const tracked_objects::Location& from_here, | 106 const tracked_objects::Location& from_here, |
| 110 const base::Closure& task, | 107 const base::Closure& task, |
| 111 base::TimeDelta delay) { | 108 base::TimeDelta delay) { |
| 112 NOTIMPLEMENTED(); | 109 NOTIMPLEMENTED(); |
| 113 return false; | 110 return false; |
| 114 } | 111 } |
| 115 | 112 |
| 116 } // namespace test | |
| 117 } // namespace cast | |
| 118 } // namespace media | 113 } // namespace media |
| OLD | NEW |