| 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 "base/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/prefs/scoped_user_pref_update.h" | 6 #include "base/prefs/scoped_user_pref_update.h" |
| 7 #include "base/prefs/testing_pref_service.h" | 7 #include "base/prefs/testing_pref_service.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/threading/sequenced_worker_pool.h" | 9 #include "base/threading/sequenced_worker_pool.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 CHECK_EQ(id, extension->id()); | 131 CHECK_EQ(id, extension->id()); |
| 132 | 132 |
| 133 return extension; | 133 return extension; |
| 134 } | 134 } |
| 135 | 135 |
| 136 ExtensionPrefs* GetExtensionPrefs() { | 136 ExtensionPrefs* GetExtensionPrefs() { |
| 137 return ExtensionPrefs::Get(profile_.get()); | 137 return ExtensionPrefs::Get(profile_.get()); |
| 138 } | 138 } |
| 139 | 139 |
| 140 chromeos::FakeUserManager* GetFakeUserManager() { | 140 chromeos::FakeUserManager* GetFakeUserManager() { |
| 141 return static_cast<chromeos::FakeUserManager*>( | 141 return static_cast<chromeos::FakeUserManager*>(chromeos::GetUserManager()); |
| 142 chromeos::UserManager::Get()); | |
| 143 } | 142 } |
| 144 | 143 |
| 145 private: | 144 private: |
| 146 scoped_ptr<chromeos::ScopedUserManagerEnabler> user_manager_enabler_; | 145 scoped_ptr<chromeos::ScopedUserManagerEnabler> user_manager_enabler_; |
| 147 TestingPrefServiceSimple local_state_; | 146 TestingPrefServiceSimple local_state_; |
| 148 base::ScopedTempDir cache_dir_; | 147 base::ScopedTempDir cache_dir_; |
| 149 }; | 148 }; |
| 150 | 149 |
| 151 // Test shared extensions clean up. | 150 // Test shared extensions clean up. |
| 152 TEST_F(ExtensionGarbageCollectorChromeOSUnitTest, SharedExtensions) { | 151 TEST_F(ExtensionGarbageCollectorChromeOSUnitTest, SharedExtensions) { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 | 188 |
| 190 const base::DictionaryValue* shared_extensions = local_state().GetDictionary( | 189 const base::DictionaryValue* shared_extensions = local_state().GetDictionary( |
| 191 ExtensionAssetsManagerChromeOS::kSharedExtensions); | 190 ExtensionAssetsManagerChromeOS::kSharedExtensions); |
| 192 ASSERT_TRUE(shared_extensions); | 191 ASSERT_TRUE(shared_extensions); |
| 193 | 192 |
| 194 EXPECT_FALSE(shared_extensions->HasKey(kExtensionId1)); | 193 EXPECT_FALSE(shared_extensions->HasKey(kExtensionId1)); |
| 195 EXPECT_TRUE(shared_extensions->HasKey(kExtensionId2)); | 194 EXPECT_TRUE(shared_extensions->HasKey(kExtensionId2)); |
| 196 } | 195 } |
| 197 | 196 |
| 198 } // namespace extensions | 197 } // namespace extensions |
| OLD | NEW |