| 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_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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/at_exit.h" |
| 9 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| 10 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 11 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
| 13 #include "base/scoped_temp_dir.h" | 14 #include "base/scoped_temp_dir.h" |
| 14 #include "chrome/browser/extensions/extension_service.h" | 15 #include "chrome/browser/extensions/extension_service.h" |
| 15 #include "content/test/test_browser_thread.h" | 16 #include "content/test/test_browser_thread.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
| 17 | 18 |
| 18 class TestingProfile; | 19 class TestingProfile; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 41 | 42 |
| 42 virtual void SetUp(); | 43 virtual void SetUp(); |
| 43 | 44 |
| 44 void set_extensions_enabled(bool enabled) { | 45 void set_extensions_enabled(bool enabled) { |
| 45 service_->set_extensions_enabled(enabled); | 46 service_->set_extensions_enabled(enabled); |
| 46 } | 47 } |
| 47 | 48 |
| 48 protected: | 49 protected: |
| 49 void InitializeExtensionServiceHelper(bool autoupdate_enabled); | 50 void InitializeExtensionServiceHelper(bool autoupdate_enabled); |
| 50 | 51 |
| 52 base::ShadowingAtExitManager at_exit_manager_; |
| 51 ScopedTempDir temp_dir_; | 53 ScopedTempDir temp_dir_; |
| 52 scoped_ptr<TestingProfile> profile_; | 54 scoped_ptr<TestingProfile> profile_; |
| 53 FilePath extensions_install_dir_; | 55 FilePath extensions_install_dir_; |
| 54 FilePath data_dir_; | 56 FilePath data_dir_; |
| 55 // Owned by |profile_|. | 57 // Owned by |profile_|. |
| 56 ExtensionService* service_; | 58 ExtensionService* service_; |
| 57 size_t total_successes_; | 59 size_t total_successes_; |
| 58 MessageLoop loop_; | 60 MessageLoop loop_; |
| 59 content::TestBrowserThread ui_thread_; | 61 content::TestBrowserThread ui_thread_; |
| 60 content::TestBrowserThread db_thread_; | 62 content::TestBrowserThread db_thread_; |
| 61 content::TestBrowserThread webkit_thread_; | 63 content::TestBrowserThread webkit_thread_; |
| 62 content::TestBrowserThread file_thread_; | 64 content::TestBrowserThread file_thread_; |
| 63 content::TestBrowserThread io_thread_; | 65 content::TestBrowserThread io_thread_; |
| 64 }; | 66 }; |
| 65 | 67 |
| 66 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_UNITTEST_H_ | 68 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_UNITTEST_H_ |
| OLD | NEW |