| 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 "chrome/browser/extensions/extension_garbage_collector_chromeos.h" | 5 #include "chrome/browser/extensions/extension_garbage_collector_chromeos.h" | 
| 6 | 6 | 
| 7 #include <string> | 7 #include <string> | 
| 8 #include <vector> | 8 #include <vector> | 
| 9 | 9 | 
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" | 
| (...skipping 15 matching lines...) Expand all  Loading... | 
| 26 #include "components/prefs/testing_pref_service.h" | 26 #include "components/prefs/testing_pref_service.h" | 
| 27 #include "components/signin/core/account_id/account_id.h" | 27 #include "components/signin/core/account_id/account_id.h" | 
| 28 #include "components/user_manager/user_manager.h" | 28 #include "components/user_manager/user_manager.h" | 
| 29 #include "components/user_manager/user_names.h" | 29 #include "components/user_manager/user_names.h" | 
| 30 #include "content/public/browser/browser_thread.h" | 30 #include "content/public/browser/browser_thread.h" | 
| 31 #include "content/public/browser/plugin_service.h" | 31 #include "content/public/browser/plugin_service.h" | 
| 32 #include "content/public/test/test_utils.h" | 32 #include "content/public/test/test_utils.h" | 
| 33 #include "extensions/browser/extension_prefs.h" | 33 #include "extensions/browser/extension_prefs.h" | 
| 34 #include "extensions/browser/install_flag.h" | 34 #include "extensions/browser/install_flag.h" | 
| 35 #include "extensions/common/manifest_constants.h" | 35 #include "extensions/common/manifest_constants.h" | 
|  | 36 #include "ppapi/features/features.h" | 
| 36 | 37 | 
| 37 namespace { | 38 namespace { | 
| 38 const char kExtensionId1[] = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; | 39 const char kExtensionId1[] = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; | 
| 39 const char kExtensionId2[] = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"; | 40 const char kExtensionId2[] = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"; | 
| 40 }  // namespace | 41 }  // namespace | 
| 41 | 42 | 
| 42 namespace extensions { | 43 namespace extensions { | 
| 43 | 44 | 
| 44 class ExtensionGarbageCollectorChromeOSUnitTest | 45 class ExtensionGarbageCollectorChromeOSUnitTest | 
| 45     : public ExtensionServiceTestBase { | 46     : public ExtensionServiceTestBase { | 
| 46  protected: | 47  protected: | 
| 47   const base::FilePath& cache_dir() { return cache_dir_.GetPath(); } | 48   const base::FilePath& cache_dir() { return cache_dir_.GetPath(); } | 
| 48 | 49 | 
| 49   void SetUp() override { | 50   void SetUp() override { | 
| 50 #if defined(ENABLE_PLUGINS) | 51 #if BUILDFLAG(ENABLE_PLUGINS) | 
| 51     content::PluginService::GetInstance()->Init(); | 52     content::PluginService::GetInstance()->Init(); | 
| 52 #endif | 53 #endif | 
| 53     InitializeGoodInstalledExtensionService(); | 54     InitializeGoodInstalledExtensionService(); | 
| 54 | 55 | 
| 55     // Need real IO thread. | 56     // Need real IO thread. | 
| 56     service_->SetFileTaskRunnerForTesting( | 57     service_->SetFileTaskRunnerForTesting( | 
| 57         content::BrowserThread::GetBlockingPool() | 58         content::BrowserThread::GetBlockingPool() | 
| 58             ->GetSequencedTaskRunnerWithShutdownBehavior( | 59             ->GetSequencedTaskRunnerWithShutdownBehavior( | 
| 59                 content::BrowserThread::GetBlockingPool() | 60                 content::BrowserThread::GetBlockingPool() | 
| 60                     ->GetNamedSequenceToken("ext_install-"), | 61                     ->GetNamedSequenceToken("ext_install-"), | 
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 190 | 191 | 
| 191   const base::DictionaryValue* shared_extensions = testing_local_state_.Get()-> | 192   const base::DictionaryValue* shared_extensions = testing_local_state_.Get()-> | 
| 192       GetDictionary(ExtensionAssetsManagerChromeOS::kSharedExtensions); | 193       GetDictionary(ExtensionAssetsManagerChromeOS::kSharedExtensions); | 
| 193   ASSERT_TRUE(shared_extensions); | 194   ASSERT_TRUE(shared_extensions); | 
| 194 | 195 | 
| 195   EXPECT_FALSE(shared_extensions->HasKey(kExtensionId1)); | 196   EXPECT_FALSE(shared_extensions->HasKey(kExtensionId1)); | 
| 196   EXPECT_TRUE(shared_extensions->HasKey(kExtensionId2)); | 197   EXPECT_TRUE(shared_extensions->HasKey(kExtensionId2)); | 
| 197 } | 198 } | 
| 198 | 199 | 
| 199 }  // namespace extensions | 200 }  // namespace extensions | 
| OLD | NEW | 
|---|