summaryrefslogtreecommitdiffstats
path: root/chrome/browser/prefs/pref_service_mock_builder.h
blob: bfa00764dfc06e32792a520295f4b7f1ad5ceae9 (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
// 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 CHROME_BROWSER_PREFS_PREF_SERVICE_MOCK_BUILDER_H_
#define CHROME_BROWSER_PREFS_PREF_SERVICE_MOCK_BUILDER_H_

#include "chrome/browser/prefs/pref_service_syncable_builder.h"

class PrefServiceSimple;
class PrefServiceSyncable;

// A helper that allows convenient building of custom PrefServices in tests.
class PrefServiceMockBuilder : public PrefServiceSyncableBuilder {
 public:
  PrefServiceMockBuilder();
  virtual ~PrefServiceMockBuilder();

  // Creates a PrefService for testing, invalidating the entire
  // builder configuration.
  virtual PrefServiceSimple* CreateSimple() OVERRIDE;
  virtual PrefServiceSyncable* CreateSyncable() OVERRIDE;

 private:
  virtual void ResetDefaultState() OVERRIDE;

  DISALLOW_COPY_AND_ASSIGN(PrefServiceMockBuilder);
};

#endif  // CHROME_BROWSER_PREFS_PREF_SERVICE_MOCK_BUILDER_H_