Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef BASE_TIMER_MOCK_TIMER_H_ | |
| 6 #define BASE_TIMER_MOCK_TIMER_H_ | |
| 7 | |
| 8 #include "base/timer/timer.h" | |
| 9 | |
| 10 namespace base { | |
| 11 | |
| 12 class BASE_EXPORT MockTimer : public Timer { | |
| 13 public: | |
| 14 MockTimer(bool retain_user_task, bool is_repeating); | |
| 15 MockTimer(const tracked_objects::Location& posted_from, | |
| 16 TimeDelta delay, | |
| 17 const base::Closure& user_task, | |
| 18 bool is_repeating); | |
| 19 virtual ~MockTimer(); | |
| 20 | |
| 21 // base::Timer implementation. | |
| 22 virtual bool IsRunning() const OVERRIDE; | |
| 23 virtual base::TimeDelta GetCurrentDelay() const OVERRIDE; | |
| 24 virtual void Start(const tracked_objects::Location& posted_from, | |
| 25 base::TimeDelta delay, | |
| 26 const base::Closure& user_task) OVERRIDE; | |
| 27 virtual void Stop() OVERRIDE; | |
| 28 virtual void Reset() OVERRIDE; | |
| 29 | |
| 30 // Testing methods. | |
| 31 virtual void Fire(); | |
|
Mark Mentovai
2014/03/13 15:17:34
Doesn’t need to be virtual.
Elly Fong-Jones
2014/03/13 15:30:09
Done.
| |
| 32 protected: | |
|
Mark Mentovai
2014/03/13 15:17:34
This should be private, not protected. Also, a nit
Elly Fong-Jones
2014/03/13 15:30:09
Done.
| |
| 33 base::Closure user_task_; | |
|
Mark Mentovai
2014/03/13 15:17:34
All of these fields duplicate fields in the base c
Elly Fong-Jones
2014/03/13 15:30:09
Okay. I moved retain_user_task_ and is_repeating_
| |
| 34 bool retain_user_task_; | |
| 35 TimeDelta delay_; | |
| 36 bool is_repeating_; | |
| 37 bool is_running_; | |
| 38 }; | |
| 39 | |
| 40 } // namespace base | |
| 41 | |
| 42 #endif // !BASE_TIMER_MOCK_TIMER_H_ | |
| OLD | NEW |