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

Side by Side Diff: chrome/browser/extensions/updater/extension_updater_unittest.cc

Issue 2054773002: Replace the WAS_INSTALLED_BY_CUSTODIAN creation flag with a pref (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing the build Created 4 years, 6 months 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/updater/extension_updater.h" 5 #include "chrome/browser/extensions/updater/extension_updater.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <list> 10 #include <list>
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 crx_file::id_util::GenerateId(base::StringPrintf("extension%i", i)); 429 crx_file::id_util::GenerateId(base::StringPrintf("extension%i", i));
430 430
431 pending_extension_manager->AddForTesting( 431 pending_extension_manager->AddForTesting(
432 PendingExtensionInfo(id, 432 PendingExtensionInfo(id,
433 std::string(), 433 std::string(),
434 update_url, 434 update_url,
435 Version(), 435 Version(),
436 should_allow_install, 436 should_allow_install,
437 kIsFromSync, 437 kIsFromSync,
438 Manifest::INTERNAL, 438 Manifest::INTERNAL,
439 Extension::NO_FLAGS,
440 kMarkAcknowledged, 439 kMarkAcknowledged,
441 kRemoteInstall)); 440 kRemoteInstall));
442 } 441 }
443 } 442 }
444 443
445 class ServiceForManifestTests : public MockService { 444 class ServiceForManifestTests : public MockService {
446 public: 445 public:
447 explicit ServiceForManifestTests(TestExtensionPrefs* prefs) 446 explicit ServiceForManifestTests(TestExtensionPrefs* prefs)
448 : MockService(prefs), 447 : MockService(prefs),
449 registry_(ExtensionRegistry::Get(profile())) { 448 registry_(ExtensionRegistry::Get(profile())) {
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after
1186 PendingExtensionManager* pending_extension_manager = 1185 PendingExtensionManager* pending_extension_manager =
1187 service->pending_extension_manager(); 1186 service->pending_extension_manager();
1188 pending_extension_manager->AddForTesting( 1187 pending_extension_manager->AddForTesting(
1189 PendingExtensionInfo(id, 1188 PendingExtensionInfo(id,
1190 std::string(), 1189 std::string(),
1191 test_url, 1190 test_url,
1192 version, 1191 version,
1193 &ShouldAlwaysInstall, 1192 &ShouldAlwaysInstall,
1194 kIsFromSync, 1193 kIsFromSync,
1195 Manifest::INTERNAL, 1194 Manifest::INTERNAL,
1196 Extension::NO_FLAGS,
1197 kMarkAcknowledged, 1195 kMarkAcknowledged,
1198 kRemoteInstall)); 1196 kRemoteInstall));
1199 } 1197 }
1200 1198
1201 // Call back the ExtensionUpdater with a 200 response and some test data 1199 // Call back the ExtensionUpdater with a 200 response and some test data
1202 base::FilePath extension_file_path(FILE_PATH_LITERAL("/whatever")); 1200 base::FilePath extension_file_path(FILE_PATH_LITERAL("/whatever"));
1203 fetcher = factory.GetFetcherByID(ExtensionDownloader::kExtensionFetcherId); 1201 fetcher = factory.GetFetcherByID(ExtensionDownloader::kExtensionFetcherId);
1204 EXPECT_TRUE(fetcher != NULL && fetcher->delegate() != NULL); 1202 EXPECT_TRUE(fetcher != NULL && fetcher->delegate() != NULL);
1205 EXPECT_TRUE(fetcher->GetLoadFlags() == kExpectedLoadFlags); 1203 EXPECT_TRUE(fetcher->GetLoadFlags() == kExpectedLoadFlags);
1206 1204
(...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after
2262 // -prodversionmin (shouldn't update if browser version too old) 2260 // -prodversionmin (shouldn't update if browser version too old)
2263 // -manifests & updates arriving out of order / interleaved 2261 // -manifests & updates arriving out of order / interleaved
2264 // -malformed update url (empty, file://, has query, has a # fragment, etc.) 2262 // -malformed update url (empty, file://, has query, has a # fragment, etc.)
2265 // -An extension gets uninstalled while updates are in progress (so it doesn't 2263 // -An extension gets uninstalled while updates are in progress (so it doesn't
2266 // "come back from the dead") 2264 // "come back from the dead")
2267 // -An extension gets manually updated to v3 while we're downloading v2 (ie 2265 // -An extension gets manually updated to v3 while we're downloading v2 (ie
2268 // you don't get downgraded accidentally) 2266 // you don't get downgraded accidentally)
2269 // -An update manifest mentions multiple updates 2267 // -An update manifest mentions multiple updates
2270 2268
2271 } // namespace extensions 2269 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698