OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_POLICY_PREFERENCES_MOCK_MAC_H_ | 5 #ifndef CHROME_BROWSER_POLICY_PREFERENCES_MOCK_MAC_H_ |
6 #define CHROME_BROWSER_POLICY_PREFERENCES_MOCK_MAC_H_ | 6 #define CHROME_BROWSER_POLICY_PREFERENCES_MOCK_MAC_H_ |
7 | 7 |
8 #include "base/mac/scoped_cftyperef.h" | 8 #include "base/mac/scoped_cftyperef.h" |
9 #include "chrome/browser/policy/preferences_mac.h" | 9 #include "chrome/browser/policy/preferences_mac.h" |
10 | 10 |
11 // Mock preferences wrapper for testing code that interacts with CFPreferences. | 11 // Mock preferences wrapper for testing code that interacts with CFPreferences. |
12 class MockPreferences : public MacPreferences { | 12 class MockPreferences : public MacPreferences { |
13 public: | 13 public: |
14 MockPreferences(); | 14 MockPreferences(); |
15 virtual ~MockPreferences(); | 15 virtual ~MockPreferences(); |
16 | 16 |
17 virtual Boolean AppSynchronize(CFStringRef applicationID) OVERRIDE; | 17 virtual Boolean AppSynchronize(CFStringRef applicationID) OVERRIDE; |
18 | 18 |
19 virtual CFPropertyListRef CopyAppValue(CFStringRef key, | 19 virtual CFPropertyListRef CopyAppValue(CFStringRef key, |
20 CFStringRef applicationID) OVERRIDE; | 20 CFStringRef applicationID) OVERRIDE; |
21 | 21 |
22 virtual Boolean AppValueIsForced(CFStringRef key, | 22 virtual Boolean AppValueIsForced(CFStringRef key, |
23 CFStringRef applicationID) OVERRIDE; | 23 CFStringRef applicationID) OVERRIDE; |
24 | 24 |
25 // Adds a preference item with the given info to the test set. | 25 // Adds a preference item with the given info to the test set. |
26 void AddTestItem(CFStringRef key, CFPropertyListRef value, bool is_forced); | 26 void AddTestItem(CFStringRef key, CFPropertyListRef value, bool is_forced); |
27 | 27 |
28 private: | 28 private: |
29 base::mac::ScopedCFTypeRef<CFMutableDictionaryRef> values_; | 29 base::ScopedCFTypeRef<CFMutableDictionaryRef> values_; |
30 base::mac::ScopedCFTypeRef<CFMutableSetRef> forced_; | 30 base::ScopedCFTypeRef<CFMutableSetRef> forced_; |
31 }; | 31 }; |
32 | 32 |
33 #endif // CHROME_BROWSER_POLICY_PREFERENCES_MOCK_MAC_H_ | 33 #endif // CHROME_BROWSER_POLICY_PREFERENCES_MOCK_MAC_H_ |
OLD | NEW |