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_EXTENSIONS_EXTENSION_SERVICE_UNITTEST_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_UNITTEST_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_UNITTEST_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_UNITTEST_H_ |
7 | 7 |
8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
14 #include "chrome/browser/extensions/extension_service.h" | 14 #include "chrome/browser/extensions/extension_service.h" |
15 #include "chrome/common/extensions/feature_switch.h" | 15 #include "chrome/common/extensions/feature_switch.h" |
| 16 #include "content/public/test/mock_render_process_host.h" |
16 #include "content/public/test/test_browser_thread.h" | 17 #include "content/public/test/test_browser_thread.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
18 | 19 |
19 class TestingProfile; | 20 class TestingProfile; |
20 | 21 |
21 namespace extensions { | 22 namespace extensions { |
22 class ManagementPolicy; | 23 class ManagementPolicy; |
23 } | 24 } |
24 | 25 |
25 class ExtensionServiceTestBase : public testing::Test { | 26 class ExtensionServiceTestBase : public testing::Test { |
(...skipping 27 matching lines...) Expand all Loading... |
53 void set_extensions_enabled(bool enabled) { | 54 void set_extensions_enabled(bool enabled) { |
54 service_->set_extensions_enabled(enabled); | 55 service_->set_extensions_enabled(enabled); |
55 } | 56 } |
56 | 57 |
57 protected: | 58 protected: |
58 void InitializeExtensionServiceHelper(bool autoupdate_enabled); | 59 void InitializeExtensionServiceHelper(bool autoupdate_enabled); |
59 | 60 |
60 MessageLoop loop_; | 61 MessageLoop loop_; |
61 base::ShadowingAtExitManager at_exit_manager_; | 62 base::ShadowingAtExitManager at_exit_manager_; |
62 base::ScopedTempDir temp_dir_; | 63 base::ScopedTempDir temp_dir_; |
| 64 content::MockRenderProcessHostFactory rph_factory_; |
63 scoped_ptr<TestingProfile> profile_; | 65 scoped_ptr<TestingProfile> profile_; |
64 base::FilePath extensions_install_dir_; | 66 base::FilePath extensions_install_dir_; |
65 base::FilePath data_dir_; | 67 base::FilePath data_dir_; |
66 // Managed by extensions::ExtensionSystemFactory. | 68 // Managed by extensions::ExtensionSystemFactory. |
67 ExtensionService* service_; | 69 ExtensionService* service_; |
68 extensions::ManagementPolicy* management_policy_; | 70 extensions::ManagementPolicy* management_policy_; |
69 size_t expected_extensions_count_; | 71 size_t expected_extensions_count_; |
70 content::TestBrowserThread ui_thread_; | 72 content::TestBrowserThread ui_thread_; |
71 content::TestBrowserThread db_thread_; | 73 content::TestBrowserThread db_thread_; |
72 content::TestBrowserThread webkit_thread_; | 74 content::TestBrowserThread webkit_thread_; |
73 content::TestBrowserThread file_thread_; | 75 content::TestBrowserThread file_thread_; |
74 content::TestBrowserThread file_user_blocking_thread_; | 76 content::TestBrowserThread file_user_blocking_thread_; |
75 content::TestBrowserThread io_thread_; | 77 content::TestBrowserThread io_thread_; |
76 extensions::FeatureSwitch::ScopedOverride override_sideload_wipeout_; | 78 extensions::FeatureSwitch::ScopedOverride override_sideload_wipeout_; |
77 }; | 79 }; |
78 | 80 |
79 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_UNITTEST_H_ | 81 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_UNITTEST_H_ |
OLD | NEW |