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

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

Issue 2259383002: Consistently use namespaced base::Version in extensions code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 const bool kIsFromSync = true; 425 const bool kIsFromSync = true;
426 const bool kMarkAcknowledged = false; 426 const bool kMarkAcknowledged = false;
427 const bool kRemoteInstall = false; 427 const bool kRemoteInstall = false;
428 std::string id = 428 std::string id =
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 base::Version(),
436 should_allow_install, 436 should_allow_install,
437 kIsFromSync, 437 kIsFromSync,
438 Manifest::INTERNAL, 438 Manifest::INTERNAL,
439 Extension::NO_FLAGS, 439 Extension::NO_FLAGS,
440 kMarkAcknowledged, 440 kMarkAcknowledged,
441 kRemoteInstall)); 441 kRemoteInstall));
442 } 442 }
443 } 443 }
444 444
445 class ServiceForManifestTests : public MockService { 445 class ServiceForManifestTests : public MockService {
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after
1165 service->OverrideDownloaderDelegate(&delegate); 1165 service->OverrideDownloaderDelegate(&delegate);
1166 updater.Start(); 1166 updater.Start();
1167 updater.EnsureDownloaderCreated(); 1167 updater.EnsureDownloaderCreated();
1168 updater.downloader_->extensions_queue_.set_backoff_policy( 1168 updater.downloader_->extensions_queue_.set_backoff_policy(
1169 &kNoBackoffPolicy); 1169 &kNoBackoffPolicy);
1170 1170
1171 GURL test_url("http://localhost/extension.crx"); 1171 GURL test_url("http://localhost/extension.crx");
1172 1172
1173 std::string id = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; 1173 std::string id = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
1174 std::string hash; 1174 std::string hash;
1175 Version version("0.0.1"); 1175 base::Version version("0.0.1");
1176 std::set<int> requests; 1176 std::set<int> requests;
1177 requests.insert(0); 1177 requests.insert(0);
1178 std::unique_ptr<ExtensionDownloader::ExtensionFetch> fetch( 1178 std::unique_ptr<ExtensionDownloader::ExtensionFetch> fetch(
1179 new ExtensionDownloader::ExtensionFetch(id, test_url, hash, 1179 new ExtensionDownloader::ExtensionFetch(id, test_url, hash,
1180 version.GetString(), requests)); 1180 version.GetString(), requests));
1181 updater.downloader_->FetchUpdatedExtension(std::move(fetch)); 1181 updater.downloader_->FetchUpdatedExtension(std::move(fetch));
1182 1182
1183 if (pending) { 1183 if (pending) {
1184 const bool kIsFromSync = true; 1184 const bool kIsFromSync = true;
1185 const bool kMarkAcknowledged = false; 1185 const bool kMarkAcknowledged = false;
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
1275 NULL, 1275 NULL,
1276 downloader_factory); 1276 downloader_factory);
1277 updater.Start(); 1277 updater.Start();
1278 updater.EnsureDownloaderCreated(); 1278 updater.EnsureDownloaderCreated();
1279 updater.downloader_->extensions_queue_.set_backoff_policy( 1279 updater.downloader_->extensions_queue_.set_backoff_policy(
1280 &kNoBackoffPolicy); 1280 &kNoBackoffPolicy);
1281 1281
1282 GURL test_url(base::StringPrintf("%s/extension.crx", url_prefix.c_str())); 1282 GURL test_url(base::StringPrintf("%s/extension.crx", url_prefix.c_str()));
1283 std::string id = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; 1283 std::string id = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
1284 std::string hash; 1284 std::string hash;
1285 Version version("0.0.1"); 1285 base::Version version("0.0.1");
1286 std::set<int> requests; 1286 std::set<int> requests;
1287 requests.insert(0); 1287 requests.insert(0);
1288 std::unique_ptr<ExtensionDownloader::ExtensionFetch> fetch( 1288 std::unique_ptr<ExtensionDownloader::ExtensionFetch> fetch(
1289 new ExtensionDownloader::ExtensionFetch(id, test_url, hash, 1289 new ExtensionDownloader::ExtensionFetch(id, test_url, hash,
1290 version.GetString(), requests)); 1290 version.GetString(), requests));
1291 updater.downloader_->FetchUpdatedExtension(std::move(fetch)); 1291 updater.downloader_->FetchUpdatedExtension(std::move(fetch));
1292 1292
1293 fetcher = factory.GetFetcherByID(ExtensionDownloader::kExtensionFetcherId); 1293 fetcher = factory.GetFetcherByID(ExtensionDownloader::kExtensionFetcherId);
1294 EXPECT_TRUE(fetcher != NULL && fetcher->delegate() != NULL); 1294 EXPECT_TRUE(fetcher != NULL && fetcher->delegate() != NULL);
1295 EXPECT_EQ(kExpectedLoadFlags, fetcher->GetLoadFlags()); 1295 EXPECT_EQ(kExpectedLoadFlags, fetcher->GetLoadFlags());
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after
2263 // -prodversionmin (shouldn't update if browser version too old) 2263 // -prodversionmin (shouldn't update if browser version too old)
2264 // -manifests & updates arriving out of order / interleaved 2264 // -manifests & updates arriving out of order / interleaved
2265 // -malformed update url (empty, file://, has query, has a # fragment, etc.) 2265 // -malformed update url (empty, file://, has query, has a # fragment, etc.)
2266 // -An extension gets uninstalled while updates are in progress (so it doesn't 2266 // -An extension gets uninstalled while updates are in progress (so it doesn't
2267 // "come back from the dead") 2267 // "come back from the dead")
2268 // -An extension gets manually updated to v3 while we're downloading v2 (ie 2268 // -An extension gets manually updated to v3 while we're downloading v2 (ie
2269 // you don't get downgraded accidentally) 2269 // you don't get downgraded accidentally)
2270 // -An update manifest mentions multiple updates 2270 // -An update manifest mentions multiple updates
2271 2271
2272 } // namespace extensions 2272 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/unpacked_installer.cc ('k') | chrome/browser/extensions/updater/local_extension_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698