blob: 2285d8e366a5a1f8e351693146ae58b172c9bed1 (
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
|
// Copyright (c) 2011 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.
#include "base/prefs/mock_pref_change_callback.h"
#include "base/bind.h"
MockPrefChangeCallback::MockPrefChangeCallback(PrefService* prefs)
: prefs_(prefs) {
}
MockPrefChangeCallback::~MockPrefChangeCallback() {}
PrefChangeRegistrar::NamedChangeCallback MockPrefChangeCallback::GetCallback() {
return base::Bind(&MockPrefChangeCallback::OnPreferenceChanged,
base::Unretained(this));
}
void MockPrefChangeCallback::Expect(const std::string& pref_name,
const Value* value) {
EXPECT_CALL(*this, OnPreferenceChanged(pref_name))
.With(PrefValueMatches(prefs_, pref_name, value));
}
|