| OLD | NEW |
| 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 <list> | 5 #include <list> |
| 6 #include <map> | 6 #include <map> |
| 7 #include <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 for (int i = 1; i <= count; ++i) { | 328 for (int i = 1; i <= count; ++i) { |
| 329 PendingExtensionInfo::ShouldAllowInstallPredicate should_allow_install = | 329 PendingExtensionInfo::ShouldAllowInstallPredicate should_allow_install = |
| 330 (i % 2 == 0) ? &ShouldInstallThemesOnly : &ShouldInstallExtensionsOnly; | 330 (i % 2 == 0) ? &ShouldInstallThemesOnly : &ShouldInstallExtensionsOnly; |
| 331 const bool kIsFromSync = true; | 331 const bool kIsFromSync = true; |
| 332 const bool kInstallSilently = true; | 332 const bool kInstallSilently = true; |
| 333 const bool kMarkAcknowledged = false; | 333 const bool kMarkAcknowledged = false; |
| 334 std::string id = id_util::GenerateId(base::StringPrintf("extension%i", i)); | 334 std::string id = id_util::GenerateId(base::StringPrintf("extension%i", i)); |
| 335 | 335 |
| 336 pending_extension_manager->AddForTesting( | 336 pending_extension_manager->AddForTesting( |
| 337 PendingExtensionInfo(id, | 337 PendingExtensionInfo(id, |
| 338 std::string(), |
| 338 update_url, | 339 update_url, |
| 339 Version(), | 340 Version(), |
| 340 should_allow_install, | 341 should_allow_install, |
| 341 kIsFromSync, | 342 kIsFromSync, |
| 342 kInstallSilently, | 343 kInstallSilently, |
| 343 Manifest::INTERNAL, | 344 Manifest::INTERNAL, |
| 344 Extension::NO_FLAGS, | 345 Extension::NO_FLAGS, |
| 345 kMarkAcknowledged)); | 346 kMarkAcknowledged)); |
| 346 } | 347 } |
| 347 } | 348 } |
| (...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 id, test_url, hash, version.GetString(), requests)); | 1016 id, test_url, hash, version.GetString(), requests)); |
| 1016 updater.downloader_->FetchUpdatedExtension(fetch.Pass()); | 1017 updater.downloader_->FetchUpdatedExtension(fetch.Pass()); |
| 1017 | 1018 |
| 1018 if (pending) { | 1019 if (pending) { |
| 1019 const bool kIsFromSync = true; | 1020 const bool kIsFromSync = true; |
| 1020 const bool kInstallSilently = true; | 1021 const bool kInstallSilently = true; |
| 1021 const bool kMarkAcknowledged = false; | 1022 const bool kMarkAcknowledged = false; |
| 1022 PendingExtensionManager* pending_extension_manager = | 1023 PendingExtensionManager* pending_extension_manager = |
| 1023 service->pending_extension_manager(); | 1024 service->pending_extension_manager(); |
| 1024 pending_extension_manager->AddForTesting( | 1025 pending_extension_manager->AddForTesting( |
| 1025 PendingExtensionInfo(id, test_url, version, | 1026 PendingExtensionInfo(id, |
| 1026 &ShouldAlwaysInstall, kIsFromSync, | 1027 std::string(), |
| 1028 test_url, |
| 1029 version, |
| 1030 &ShouldAlwaysInstall, |
| 1031 kIsFromSync, |
| 1027 kInstallSilently, | 1032 kInstallSilently, |
| 1028 Manifest::INTERNAL, | 1033 Manifest::INTERNAL, |
| 1029 Extension::NO_FLAGS, | 1034 Extension::NO_FLAGS, |
| 1030 kMarkAcknowledged)); | 1035 kMarkAcknowledged)); |
| 1031 } | 1036 } |
| 1032 | 1037 |
| 1033 // Call back the ExtensionUpdater with a 200 response and some test data | 1038 // Call back the ExtensionUpdater with a 200 response and some test data |
| 1034 base::FilePath extension_file_path(FILE_PATH_LITERAL("/whatever")); | 1039 base::FilePath extension_file_path(FILE_PATH_LITERAL("/whatever")); |
| 1035 fetcher = factory.GetFetcherByID(ExtensionDownloader::kExtensionFetcherId); | 1040 fetcher = factory.GetFetcherByID(ExtensionDownloader::kExtensionFetcherId); |
| 1036 EXPECT_TRUE(fetcher != NULL && fetcher->delegate() != NULL); | 1041 EXPECT_TRUE(fetcher != NULL && fetcher->delegate() != NULL); |
| (...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1778 // -prodversionmin (shouldn't update if browser version too old) | 1783 // -prodversionmin (shouldn't update if browser version too old) |
| 1779 // -manifests & updates arriving out of order / interleaved | 1784 // -manifests & updates arriving out of order / interleaved |
| 1780 // -malformed update url (empty, file://, has query, has a # fragment, etc.) | 1785 // -malformed update url (empty, file://, has query, has a # fragment, etc.) |
| 1781 // -An extension gets uninstalled while updates are in progress (so it doesn't | 1786 // -An extension gets uninstalled while updates are in progress (so it doesn't |
| 1782 // "come back from the dead") | 1787 // "come back from the dead") |
| 1783 // -An extension gets manually updated to v3 while we're downloading v2 (ie | 1788 // -An extension gets manually updated to v3 while we're downloading v2 (ie |
| 1784 // you don't get downgraded accidentally) | 1789 // you don't get downgraded accidentally) |
| 1785 // -An update manifest mentions multiple updates | 1790 // -An update manifest mentions multiple updates |
| 1786 | 1791 |
| 1787 } // namespace extensions | 1792 } // namespace extensions |
| OLD | NEW |