| 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_EXTENSIONS_EXTENSION_SETTINGS_STORAGE_UNITTEST_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_STORAGE_UNITTEST_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_STORAGE_UNITTEST_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_STORAGE_UNITTEST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| 11 #include "base/bind.h" |
| 11 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/message_loop.h" | 14 #include "base/message_loop.h" |
| 14 #include "base/scoped_temp_dir.h" | 15 #include "base/scoped_temp_dir.h" |
| 15 #include "base/task.h" | 16 #include "base/task.h" |
| 16 #include "chrome/browser/extensions/extension_settings_backend.h" | 17 #include "chrome/browser/extensions/extension_settings_backend.h" |
| 18 #include "chrome/browser/extensions/extension_settings_frontend.h" |
| 19 #include "chrome/test/base/testing_profile.h" |
| 17 #include "content/browser/browser_thread.h" | 20 #include "content/browser/browser_thread.h" |
| 18 | 21 |
| 19 // Parameter type for the value-parameterized tests. | 22 // Parameter type for the value-parameterized tests. |
| 20 typedef ExtensionSettingsStorage* (*ExtensionSettingsStorageTestParam)( | 23 typedef ExtensionSettingsStorage* (*ExtensionSettingsStorageTestParam)( |
| 21 const FilePath& file_path, const std::string& extension_id); | 24 const FilePath& file_path, const std::string& extension_id); |
| 22 | 25 |
| 23 // Test fixture for ExtensionSettingsStorage tests. Tests are defined in | 26 // Test fixture for ExtensionSettingsStorage tests. Tests are defined in |
| 24 // extension_settings_storage_unittest.cc with configurations for both cached | 27 // extension_settings_storage_unittest.cc with configurations for both cached |
| 25 // and non-cached leveldb storage, and cached no-op storage. | 28 // and non-cached leveldb storage, and cached no-op storage. |
| 26 class ExtensionSettingsStorageTest | 29 class ExtensionSettingsStorageTest |
| (...skipping 27 matching lines...) Expand all Loading... |
| 54 std::set<std::string> empty_set_; | 57 std::set<std::string> empty_set_; |
| 55 std::set<std::string> set1_; | 58 std::set<std::string> set1_; |
| 56 std::set<std::string> set2_; | 59 std::set<std::string> set2_; |
| 57 std::set<std::string> set3_; | 60 std::set<std::string> set3_; |
| 58 std::set<std::string> set12_; | 61 std::set<std::string> set12_; |
| 59 std::set<std::string> set13_; | 62 std::set<std::string> set13_; |
| 60 std::set<std::string> set123_; | 63 std::set<std::string> set123_; |
| 61 | 64 |
| 62 scoped_ptr<DictionaryValue> empty_dict_; | 65 scoped_ptr<DictionaryValue> empty_dict_; |
| 63 scoped_ptr<DictionaryValue> dict1_; | 66 scoped_ptr<DictionaryValue> dict1_; |
| 67 scoped_ptr<DictionaryValue> dict3_; |
| 64 scoped_ptr<DictionaryValue> dict12_; | 68 scoped_ptr<DictionaryValue> dict12_; |
| 65 scoped_ptr<DictionaryValue> dict123_; | 69 scoped_ptr<DictionaryValue> dict123_; |
| 66 | 70 |
| 67 private: | 71 private: |
| 68 ScopedTempDir temp_dir_; | 72 ScopedTempDir temp_dir_; |
| 69 | 73 |
| 70 // Need these so that the DCHECKs for running on FILE or UI threads pass. | 74 // Need these so that the DCHECKs for running on FILE or UI threads pass. |
| 71 MessageLoop message_loop_; | 75 MessageLoop message_loop_; |
| 72 BrowserThread ui_thread_; | 76 BrowserThread ui_thread_; |
| 73 BrowserThread file_thread_; | 77 BrowserThread file_thread_; |
| 74 }; | 78 }; |
| 75 | 79 |
| 76 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_STORAGE_UNITTEST_H_ | 80 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_STORAGE_UNITTEST_H_ |
| OLD | NEW |