OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_EXTENSIONS_MOCK_SYSTEM_INFO_WATCHER_H_ |
| 5 #define CHROME_BROWSER_EXTENSIONS_MOCK_SYSTEM_INFO_WATCHER_H_ |
| 6 |
| 7 #include "chrome/browser/extensions/system_info_watcher.h" |
| 8 |
| 9 #include "base/timer.h" |
| 10 |
| 11 namespace extensions { |
| 12 |
| 13 class MockSystemInfoWatcher : public SystemInfoWatcher { |
| 14 public: |
| 15 MockSystemInfoWatcher(); |
| 16 virtual ~MockSystemInfoWatcher(); |
| 17 |
| 18 private: |
| 19 // SystemInfoWatcher implementation. |
| 20 virtual bool PlatformStartWatching(const std::string& event_name) OVERRIDE; |
| 21 virtual bool PlatformStopWatching(const std::string& event_name) OVERRIDE; |
| 22 |
| 23 // Called when the timer gets expired. It is used to emulate the random |
| 24 // system event. |
| 25 void OnTimeoutEvent(); |
| 26 |
| 27 base::RepeatingTimer<MockSystemInfoWatcher> timer_; |
| 28 }; |
| 29 |
| 30 } // namespace extensions |
| 31 |
| 32 #endif // CHROME_BROWSER_EXTENSIONS_MOCK_SYSTEM_INFO_WATCHER_H_ |
| 33 |
OLD | NEW |