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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 ExtensionPrefs* GetExtensionPrefs() { | 136 ExtensionPrefs* GetExtensionPrefs() { |
137 return ExtensionPrefs::Get(profile_.get()); | 137 return ExtensionPrefs::Get(profile_.get()); |
138 } | 138 } |
139 | 139 |
140 chromeos::FakeChromeUserManager* GetFakeUserManager() { | 140 chromeos::FakeChromeUserManager* GetFakeUserManager() { |
141 return static_cast<chromeos::FakeChromeUserManager*>( | 141 return static_cast<chromeos::FakeChromeUserManager*>( |
142 user_manager::UserManager::Get()); | 142 user_manager::UserManager::Get()); |
143 } | 143 } |
144 | 144 |
145 private: | 145 private: |
146 scoped_ptr<chromeos::ScopedUserManagerEnabler> user_manager_enabler_; | 146 std::unique_ptr<chromeos::ScopedUserManagerEnabler> user_manager_enabler_; |
147 base::ScopedTempDir cache_dir_; | 147 base::ScopedTempDir cache_dir_; |
148 }; | 148 }; |
149 | 149 |
150 // Test shared extensions clean up. | 150 // Test shared extensions clean up. |
151 TEST_F(ExtensionGarbageCollectorChromeOSUnitTest, SharedExtensions) { | 151 TEST_F(ExtensionGarbageCollectorChromeOSUnitTest, SharedExtensions) { |
152 // Version for non-existing user. | 152 // Version for non-existing user. |
153 base::FilePath path_id1_1 = CreateSharedExtensionDir( | 153 base::FilePath path_id1_1 = CreateSharedExtensionDir( |
154 kExtensionId1, "1.0", cache_dir()); | 154 kExtensionId1, "1.0", cache_dir()); |
155 CreateSharedExtensionPrefs(kExtensionId1, "1.0", "test@test.com", path_id1_1); | 155 CreateSharedExtensionPrefs(kExtensionId1, "1.0", "test@test.com", path_id1_1); |
156 EXPECT_TRUE(base::PathExists(path_id1_1)); | 156 EXPECT_TRUE(base::PathExists(path_id1_1)); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 190 |
191 const base::DictionaryValue* shared_extensions = testing_local_state_.Get()-> | 191 const base::DictionaryValue* shared_extensions = testing_local_state_.Get()-> |
192 GetDictionary(ExtensionAssetsManagerChromeOS::kSharedExtensions); | 192 GetDictionary(ExtensionAssetsManagerChromeOS::kSharedExtensions); |
193 ASSERT_TRUE(shared_extensions); | 193 ASSERT_TRUE(shared_extensions); |
194 | 194 |
195 EXPECT_FALSE(shared_extensions->HasKey(kExtensionId1)); | 195 EXPECT_FALSE(shared_extensions->HasKey(kExtensionId1)); |
196 EXPECT_TRUE(shared_extensions->HasKey(kExtensionId2)); | 196 EXPECT_TRUE(shared_extensions->HasKey(kExtensionId2)); |
197 } | 197 } |
198 | 198 |
199 } // namespace extensions | 199 } // namespace extensions |
OLD | NEW |