summaryrefslogtreecommitdiffstats
path: root/sync/test/fake_extensions_activity_monitor.h
blob: 2beb64f1cb66fb9182cc39b5e8aa7ca8c27d377e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef SYNC_TEST_FAKE_EXTENSIONS_ACTIVITY_MONITOR_H_
#define SYNC_TEST_FAKE_EXTENSIONS_ACTIVITY_MONITOR_H_
#pragma once

#include "base/compiler_specific.h"
#include "base/threading/non_thread_safe.h"
#include "sync/util/extensions_activity_monitor.h"

namespace browser_sync {

// Fake non-thread-safe implementation of ExtensionsActivityMonitor
// suitable to be used in single-threaded sync tests.
class FakeExtensionsActivityMonitor : public ExtensionsActivityMonitor {
 public:
  FakeExtensionsActivityMonitor();
  virtual ~FakeExtensionsActivityMonitor();

  // ExtensionsActivityMonitor implementation.
  virtual void GetAndClearRecords(Records* buffer) OVERRIDE;
  virtual void PutRecords(const Records& records) OVERRIDE;

 private:
  Records records_;
  base::NonThreadSafe non_thread_safe_;
};

}  // namespace browser_sync

#endif  // SYNC_TEST_FAKE_EXTENSIONS_ACTIVITY_MONITOR_H_