OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include "base/files/file_enumerator.h" | 7 #include "base/files/file_enumerator.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/threading/sequenced_worker_pool.h" | 10 #include "base/threading/sequenced_worker_pool.h" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "chrome/browser/extensions/extension_garbage_collector.h" | 12 #include "chrome/browser/extensions/extension_garbage_collector.h" |
13 #include "chrome/browser/extensions/extension_service.h" | 13 #include "chrome/browser/extensions/extension_service.h" |
14 #include "chrome/browser/extensions/extension_service_test_base.h" | 14 #include "chrome/browser/extensions/extension_service_test_base.h" |
15 #include "chrome/browser/extensions/install_tracker.h" | 15 #include "chrome/browser/extensions/install_tracker.h" |
16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
17 #include "chrome/common/chrome_constants.h" | 17 #include "chrome/common/chrome_constants.h" |
18 #include "chrome/test/base/testing_profile.h" | 18 #include "chrome/test/base/testing_profile.h" |
19 #include "components/prefs/scoped_user_pref_update.h" | 19 #include "components/prefs/scoped_user_pref_update.h" |
20 #include "content/public/browser/browser_thread.h" | 20 #include "content/public/browser/browser_thread.h" |
21 #include "content/public/browser/plugin_service.h" | 21 #include "content/public/browser/plugin_service.h" |
22 #include "content/public/test/test_browser_thread_bundle.h" | 22 #include "content/public/test/test_browser_thread_bundle.h" |
23 #include "extensions/browser/extension_prefs.h" | 23 #include "extensions/browser/extension_prefs.h" |
| 24 #include "ppapi/features/features.h" |
24 | 25 |
25 namespace extensions { | 26 namespace extensions { |
26 | 27 |
27 class ExtensionGarbageCollectorUnitTest : public ExtensionServiceTestBase { | 28 class ExtensionGarbageCollectorUnitTest : public ExtensionServiceTestBase { |
28 protected: | 29 protected: |
29 void InitPluginService() { | 30 void InitPluginService() { |
30 #if defined(ENABLE_PLUGINS) | 31 #if BUILDFLAG(ENABLE_PLUGINS) |
31 content::PluginService::GetInstance()->Init(); | 32 content::PluginService::GetInstance()->Init(); |
32 #endif | 33 #endif |
33 } | 34 } |
34 | 35 |
35 // Garbage collection, in production, runs on multiple threads. This is | 36 // Garbage collection, in production, runs on multiple threads. This is |
36 // important to test to make sure we don't violate thread safety. Use a real | 37 // important to test to make sure we don't violate thread safety. Use a real |
37 // task runner for these tests. | 38 // task runner for these tests. |
38 // TODO (rdevlin.cronin): It's kind of hacky that we have to do these things | 39 // TODO (rdevlin.cronin): It's kind of hacky that we have to do these things |
39 // since we're using ExtensionServiceTestBase. Instead, we should probably do | 40 // since we're using ExtensionServiceTestBase. Instead, we should probably do |
40 // something like use an options flag, and handle it all in the base class. | 41 // something like use an options flag, and handle it all in the base class. |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 EXPECT_FALSE(base::PathExists(extensions_install_dir().AppendASCII( | 194 EXPECT_FALSE(base::PathExists(extensions_install_dir().AppendASCII( |
194 "hpiknbiabeeppbpihjehijgoemciehgk/3"))); | 195 "hpiknbiabeeppbpihjehijgoemciehgk/3"))); |
195 | 196 |
196 // Make sure update information got deleted. | 197 // Make sure update information got deleted. |
197 ExtensionPrefs* prefs = ExtensionPrefs::Get(profile_.get()); | 198 ExtensionPrefs* prefs = ExtensionPrefs::Get(profile_.get()); |
198 EXPECT_FALSE( | 199 EXPECT_FALSE( |
199 prefs->GetDelayedInstallInfo("bjafgdebaacbbbecmhlhpofkepfkgcpa")); | 200 prefs->GetDelayedInstallInfo("bjafgdebaacbbbecmhlhpofkepfkgcpa")); |
200 } | 201 } |
201 | 202 |
202 } // namespace extensions | 203 } // namespace extensions |
OLD | NEW |