| 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/extension_unittest.h" | 15 #include "chrome/common/extensions/extension_unittest.h" |
| 16 #include "chrome/common/extensions/feature_switch.h" | 16 #include "chrome/common/extensions/feature_switch.h" |
| 17 #include "chrome/test/base/scoped_testing_local_state.h" |
| 18 #include "content/public/test/mock_render_process_host.h" |
| 17 #include "content/public/test/test_browser_thread.h" | 19 #include "content/public/test/test_browser_thread.h" |
| 20 #include "content/public/test/test_renderer_host.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
| 19 | 22 |
| 20 class TestingProfile; | 23 class TestingProfile; |
| 21 | 24 |
| 22 namespace extensions { | 25 namespace extensions { |
| 23 class ManagementPolicy; | 26 class ManagementPolicy; |
| 24 } | 27 } |
| 25 | 28 |
| 26 class ExtensionServiceTestBase : public extensions::ExtensionTest { | 29 class ExtensionServiceTestBase : public extensions::ExtensionTest { |
| 27 public: | 30 public: |
| (...skipping 24 matching lines...) Expand all Loading... |
| 52 void set_extensions_enabled(bool enabled) { | 55 void set_extensions_enabled(bool enabled) { |
| 53 service_->set_extensions_enabled(enabled); | 56 service_->set_extensions_enabled(enabled); |
| 54 } | 57 } |
| 55 | 58 |
| 56 protected: | 59 protected: |
| 57 void InitializeExtensionServiceHelper(bool autoupdate_enabled); | 60 void InitializeExtensionServiceHelper(bool autoupdate_enabled); |
| 58 | 61 |
| 59 MessageLoop loop_; | 62 MessageLoop loop_; |
| 60 base::ShadowingAtExitManager at_exit_manager_; | 63 base::ShadowingAtExitManager at_exit_manager_; |
| 61 base::ScopedTempDir temp_dir_; | 64 base::ScopedTempDir temp_dir_; |
| 65 content::RenderViewHostTestEnabler rvh_enabler_; |
| 66 ScopedTestingLocalState local_state_; |
| 62 scoped_ptr<TestingProfile> profile_; | 67 scoped_ptr<TestingProfile> profile_; |
| 63 base::FilePath extensions_install_dir_; | 68 base::FilePath extensions_install_dir_; |
| 64 base::FilePath data_dir_; | 69 base::FilePath data_dir_; |
| 65 // Managed by extensions::ExtensionSystemFactory. | 70 // Managed by extensions::ExtensionSystemFactory. |
| 66 ExtensionService* service_; | 71 ExtensionService* service_; |
| 67 extensions::ManagementPolicy* management_policy_; | 72 extensions::ManagementPolicy* management_policy_; |
| 68 size_t expected_extensions_count_; | 73 size_t expected_extensions_count_; |
| 69 content::TestBrowserThread ui_thread_; | 74 content::TestBrowserThread ui_thread_; |
| 70 content::TestBrowserThread db_thread_; | 75 content::TestBrowserThread db_thread_; |
| 71 content::TestBrowserThread webkit_thread_; | 76 content::TestBrowserThread webkit_thread_; |
| 72 content::TestBrowserThread file_thread_; | 77 content::TestBrowserThread file_thread_; |
| 73 content::TestBrowserThread file_user_blocking_thread_; | 78 content::TestBrowserThread file_user_blocking_thread_; |
| 74 content::TestBrowserThread io_thread_; | 79 content::TestBrowserThread io_thread_; |
| 75 extensions::FeatureSwitch::ScopedOverride override_sideload_wipeout_; | 80 extensions::FeatureSwitch::ScopedOverride override_sideload_wipeout_; |
| 76 }; | 81 }; |
| 77 | 82 |
| 78 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_UNITTEST_H_ | 83 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_UNITTEST_H_ |
| OLD | NEW |