Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(505)

Side by Side Diff: chrome/browser/extensions/extension_garbage_collector_chromeos_unittest.cc

Issue 714133002: Add more management policy checking after extension installed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix CrOS compile Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 // Version for current user that delayed install. 173 // Version for current user that delayed install.
174 base::FilePath path_id2_1 = CreateSharedExtensionDir( 174 base::FilePath path_id2_1 = CreateSharedExtensionDir(
175 kExtensionId2, "1.0", cache_dir()); 175 kExtensionId2, "1.0", cache_dir());
176 CreateSharedExtensionPrefs( 176 CreateSharedExtensionPrefs(
177 kExtensionId2, "1.0", chromeos::login::kStubUser, path_id2_1); 177 kExtensionId2, "1.0", chromeos::login::kStubUser, path_id2_1);
178 scoped_refptr<Extension> extension2 = CreateExtension(kExtensionId2, "1.0", 178 scoped_refptr<Extension> extension2 = CreateExtension(kExtensionId2, "1.0",
179 path_id2_1); 179 path_id2_1);
180 GetExtensionPrefs()->SetDelayedInstallInfo( 180 GetExtensionPrefs()->SetDelayedInstallInfo(
181 extension2.get(), 181 extension2.get(),
182 Extension::ENABLED, 182 Extension::ENABLED,
183 Extension::DISABLE_NONE,
183 kInstallFlagNone, 184 kInstallFlagNone,
184 ExtensionPrefs::DELAY_REASON_WAIT_FOR_IDLE, 185 ExtensionPrefs::DELAY_REASON_WAIT_FOR_IDLE,
185 syncer::StringOrdinal(), 186 syncer::StringOrdinal(),
186 std::string()); 187 std::string());
187 EXPECT_TRUE(base::PathExists(path_id2_1)); 188 EXPECT_TRUE(base::PathExists(path_id2_1));
188 189
189 GarbageCollectExtensions(); 190 GarbageCollectExtensions();
190 191
191 EXPECT_FALSE(base::PathExists(path_id1_1)); 192 EXPECT_FALSE(base::PathExists(path_id1_1));
192 EXPECT_FALSE(base::PathExists(path_id1_2)); 193 EXPECT_FALSE(base::PathExists(path_id1_2));
193 EXPECT_FALSE(base::PathExists(cache_dir().AppendASCII(kExtensionId1))); 194 EXPECT_FALSE(base::PathExists(cache_dir().AppendASCII(kExtensionId1)));
194 195
195 EXPECT_TRUE(base::PathExists(path_id2_1)); 196 EXPECT_TRUE(base::PathExists(path_id2_1));
196 197
197 const base::DictionaryValue* shared_extensions = local_state().GetDictionary( 198 const base::DictionaryValue* shared_extensions = local_state().GetDictionary(
198 ExtensionAssetsManagerChromeOS::kSharedExtensions); 199 ExtensionAssetsManagerChromeOS::kSharedExtensions);
199 ASSERT_TRUE(shared_extensions); 200 ASSERT_TRUE(shared_extensions);
200 201
201 EXPECT_FALSE(shared_extensions->HasKey(kExtensionId1)); 202 EXPECT_FALSE(shared_extensions->HasKey(kExtensionId1));
202 EXPECT_TRUE(shared_extensions->HasKey(kExtensionId2)); 203 EXPECT_TRUE(shared_extensions->HasKey(kExtensionId2));
203 } 204 }
204 205
205 } // namespace extensions 206 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698