| 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 CHROME_BROWSER_PREFS_PREF_SERVICE_MOCK_BUILDER_H_ | 5 #ifndef CHROME_BROWSER_PREFS_PREF_SERVICE_MOCK_BUILDER_H_ |
| 6 #define CHROME_BROWSER_PREFS_PREF_SERVICE_MOCK_BUILDER_H_ | 6 #define CHROME_BROWSER_PREFS_PREF_SERVICE_MOCK_BUILDER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "chrome/common/persistent_pref_store.h" | 10 #include "chrome/common/persistent_pref_store.h" |
| 11 #include "chrome/common/pref_store.h" | 11 #include "chrome/common/pref_store.h" |
| 12 | 12 |
| 13 class CommandLine; | 13 class CommandLine; |
| 14 class FilePath; | 14 class FilePath; |
| 15 class PrefService; | 15 class PrefService; |
| 16 | 16 |
| 17 namespace base { | 17 namespace base { |
| 18 class MessageLoopProxy; | 18 class SequencedWorkerPool; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace policy { | 21 namespace policy { |
| 22 class PolicyService; | 22 class PolicyService; |
| 23 } | 23 } |
| 24 | 24 |
| 25 // A helper that allows convenient building of custom PrefServices in tests. | 25 // A helper that allows convenient building of custom PrefServices in tests. |
| 26 class PrefServiceMockBuilder { | 26 class PrefServiceMockBuilder { |
| 27 public: | 27 public: |
| 28 PrefServiceMockBuilder(); | 28 PrefServiceMockBuilder(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 44 policy::PolicyService* service); | 44 policy::PolicyService* service); |
| 45 #endif | 45 #endif |
| 46 | 46 |
| 47 // Specifies to use an actual command-line backed command-line pref store. | 47 // Specifies to use an actual command-line backed command-line pref store. |
| 48 PrefServiceMockBuilder& WithCommandLine(CommandLine* command_line); | 48 PrefServiceMockBuilder& WithCommandLine(CommandLine* command_line); |
| 49 | 49 |
| 50 // Specifies to use an actual file-backed user pref store. | 50 // Specifies to use an actual file-backed user pref store. |
| 51 PrefServiceMockBuilder& WithUserFilePrefs(const FilePath& prefs_file); | 51 PrefServiceMockBuilder& WithUserFilePrefs(const FilePath& prefs_file); |
| 52 PrefServiceMockBuilder& WithUserFilePrefs( | 52 PrefServiceMockBuilder& WithUserFilePrefs( |
| 53 const FilePath& prefs_file, | 53 const FilePath& prefs_file, |
| 54 base::MessageLoopProxy* message_loop_proxy); | 54 base::SequencedWorkerPool* blocking_pool); |
| 55 | 55 |
| 56 // Creates the PrefService, invalidating the entire builder configuration. | 56 // Creates the PrefService, invalidating the entire builder configuration. |
| 57 PrefService* Create(); | 57 PrefService* Create(); |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 scoped_refptr<PrefStore> managed_prefs_; | 60 scoped_refptr<PrefStore> managed_prefs_; |
| 61 scoped_refptr<PrefStore> extension_prefs_; | 61 scoped_refptr<PrefStore> extension_prefs_; |
| 62 scoped_refptr<PrefStore> command_line_prefs_; | 62 scoped_refptr<PrefStore> command_line_prefs_; |
| 63 scoped_refptr<PersistentPrefStore> user_prefs_; | 63 scoped_refptr<PersistentPrefStore> user_prefs_; |
| 64 scoped_refptr<PrefStore> recommended_prefs_; | 64 scoped_refptr<PrefStore> recommended_prefs_; |
| 65 | 65 |
| 66 DISALLOW_COPY_AND_ASSIGN(PrefServiceMockBuilder); | 66 DISALLOW_COPY_AND_ASSIGN(PrefServiceMockBuilder); |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 #endif // CHROME_BROWSER_PREFS_PREF_SERVICE_MOCK_BUILDER_H_ | 69 #endif // CHROME_BROWSER_PREFS_PREF_SERVICE_MOCK_BUILDER_H_ |
| OLD | NEW |