OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef SYNC_TEST_FAKE_EXTENSIONS_ACTIVITY_MONITOR_H_ | 5 #ifndef SYNC_TEST_FAKE_EXTENSIONS_ACTIVITY_MONITOR_H_ |
6 #define SYNC_TEST_FAKE_EXTENSIONS_ACTIVITY_MONITOR_H_ | 6 #define SYNC_TEST_FAKE_EXTENSIONS_ACTIVITY_MONITOR_H_ |
7 #pragma once | |
8 | 7 |
9 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
10 #include "base/threading/non_thread_safe.h" | 9 #include "base/threading/non_thread_safe.h" |
11 #include "sync/util/extensions_activity_monitor.h" | 10 #include "sync/util/extensions_activity_monitor.h" |
12 | 11 |
13 namespace syncer { | 12 namespace syncer { |
14 | 13 |
15 // Fake non-thread-safe implementation of ExtensionsActivityMonitor | 14 // Fake non-thread-safe implementation of ExtensionsActivityMonitor |
16 // suitable to be used in single-threaded sync tests. | 15 // suitable to be used in single-threaded sync tests. |
17 class FakeExtensionsActivityMonitor | 16 class FakeExtensionsActivityMonitor |
18 : public ExtensionsActivityMonitor, | 17 : public ExtensionsActivityMonitor, |
19 public base::NonThreadSafe { | 18 public base::NonThreadSafe { |
20 public: | 19 public: |
21 FakeExtensionsActivityMonitor(); | 20 FakeExtensionsActivityMonitor(); |
22 virtual ~FakeExtensionsActivityMonitor(); | 21 virtual ~FakeExtensionsActivityMonitor(); |
23 | 22 |
24 // ExtensionsActivityMonitor implementation. | 23 // ExtensionsActivityMonitor implementation. |
25 virtual void GetAndClearRecords(Records* buffer) OVERRIDE; | 24 virtual void GetAndClearRecords(Records* buffer) OVERRIDE; |
26 virtual void PutRecords(const Records& records) OVERRIDE; | 25 virtual void PutRecords(const Records& records) OVERRIDE; |
27 | 26 |
28 private: | 27 private: |
29 Records records_; | 28 Records records_; |
30 }; | 29 }; |
31 | 30 |
32 } // namespace syncer | 31 } // namespace syncer |
33 | 32 |
34 #endif // SYNC_TEST_FAKE_EXTENSIONS_ACTIVITY_MONITOR_H_ | 33 #endif // SYNC_TEST_FAKE_EXTENSIONS_ACTIVITY_MONITOR_H_ |
OLD | NEW |