| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_EXTENSIONS_TEST_EXTENSION_PREFS_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_PREFS_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_PREFS_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_PREFS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
| 12 #include "base/scoped_temp_dir.h" | 12 #include "base/scoped_temp_dir.h" |
| 13 #include "chrome/common/extensions/extension.h" | 13 #include "chrome/common/extensions/extension.h" |
| 14 | 14 |
| 15 class DictionaryValue; | 15 class DictionaryValue; |
| 16 class ExtensionPrefs; | 16 class ExtensionPrefs; |
| 17 class ExtensionPrefValueMap; |
| 17 class PrefService; | 18 class PrefService; |
| 18 | 19 |
| 19 // This is a test class intended to make it easier to work with ExtensionPrefs | 20 // This is a test class intended to make it easier to work with ExtensionPrefs |
| 20 // in tests. | 21 // in tests. |
| 21 class TestExtensionPrefs { | 22 class TestExtensionPrefs { |
| 22 public: | 23 public: |
| 23 TestExtensionPrefs(); | 24 TestExtensionPrefs(); |
| 24 virtual ~TestExtensionPrefs(); | 25 virtual ~TestExtensionPrefs(); |
| 25 | 26 |
| 26 ExtensionPrefs* prefs() { return prefs_.get(); } | 27 ExtensionPrefs* prefs() { return prefs_.get(); } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 37 | 38 |
| 38 // Similar to AddExtension, but takes a dictionary with manifest values. | 39 // Similar to AddExtension, but takes a dictionary with manifest values. |
| 39 scoped_refptr<Extension> AddExtensionWithManifest( | 40 scoped_refptr<Extension> AddExtensionWithManifest( |
| 40 const DictionaryValue& manifest, Extension::Location location); | 41 const DictionaryValue& manifest, Extension::Location location); |
| 41 | 42 |
| 42 // Similar to AddExtension, this adds a new test Extension. This is useful for | 43 // Similar to AddExtension, this adds a new test Extension. This is useful for |
| 43 // cases when you don't need the Extension object, but just the id it was | 44 // cases when you don't need the Extension object, but just the id it was |
| 44 // assigned. | 45 // assigned. |
| 45 std::string AddExtensionAndReturnId(std::string name); | 46 std::string AddExtensionAndReturnId(std::string name); |
| 46 | 47 |
| 48 PrefService* CreateIncognitoPrefService() const; |
| 49 |
| 47 protected: | 50 protected: |
| 48 ScopedTempDir temp_dir_; | 51 ScopedTempDir temp_dir_; |
| 49 FilePath preferences_file_; | 52 FilePath preferences_file_; |
| 50 FilePath extensions_dir_; | 53 FilePath extensions_dir_; |
| 51 scoped_ptr<PrefService> pref_service_; | 54 scoped_ptr<PrefService> pref_service_; |
| 52 scoped_ptr<ExtensionPrefs> prefs_; | 55 scoped_ptr<ExtensionPrefs> prefs_; |
| 56 scoped_ptr<ExtensionPrefValueMap> extension_pref_value_map_; |
| 53 | 57 |
| 54 private: | 58 private: |
| 55 DISALLOW_COPY_AND_ASSIGN(TestExtensionPrefs); | 59 DISALLOW_COPY_AND_ASSIGN(TestExtensionPrefs); |
| 56 }; | 60 }; |
| 57 | 61 |
| 58 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_PREFS_H_ | 62 #endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_PREFS_H_ |
| OLD | NEW |