| 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 "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 Loading... |
| 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, |
| 439 kMarkAcknowledged, | 440 kMarkAcknowledged, |
| 440 kRemoteInstall)); | 441 kRemoteInstall)); |
| 441 } | 442 } |
| 442 } | 443 } |
| 443 | 444 |
| 444 class ServiceForManifestTests : public MockService { | 445 class ServiceForManifestTests : public MockService { |
| 445 public: | 446 public: |
| 446 explicit ServiceForManifestTests(TestExtensionPrefs* prefs) | 447 explicit ServiceForManifestTests(TestExtensionPrefs* prefs) |
| 447 : MockService(prefs), | 448 : MockService(prefs), |
| 448 registry_(ExtensionRegistry::Get(profile())) { | 449 registry_(ExtensionRegistry::Get(profile())) { |
| (...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1185 PendingExtensionManager* pending_extension_manager = | 1186 PendingExtensionManager* pending_extension_manager = |
| 1186 service->pending_extension_manager(); | 1187 service->pending_extension_manager(); |
| 1187 pending_extension_manager->AddForTesting( | 1188 pending_extension_manager->AddForTesting( |
| 1188 PendingExtensionInfo(id, | 1189 PendingExtensionInfo(id, |
| 1189 std::string(), | 1190 std::string(), |
| 1190 test_url, | 1191 test_url, |
| 1191 version, | 1192 version, |
| 1192 &ShouldAlwaysInstall, | 1193 &ShouldAlwaysInstall, |
| 1193 kIsFromSync, | 1194 kIsFromSync, |
| 1194 Manifest::INTERNAL, | 1195 Manifest::INTERNAL, |
| 1196 Extension::NO_FLAGS, |
| 1195 kMarkAcknowledged, | 1197 kMarkAcknowledged, |
| 1196 kRemoteInstall)); | 1198 kRemoteInstall)); |
| 1197 } | 1199 } |
| 1198 | 1200 |
| 1199 // Call back the ExtensionUpdater with a 200 response and some test data | 1201 // Call back the ExtensionUpdater with a 200 response and some test data |
| 1200 base::FilePath extension_file_path(FILE_PATH_LITERAL("/whatever")); | 1202 base::FilePath extension_file_path(FILE_PATH_LITERAL("/whatever")); |
| 1201 fetcher = factory.GetFetcherByID(ExtensionDownloader::kExtensionFetcherId); | 1203 fetcher = factory.GetFetcherByID(ExtensionDownloader::kExtensionFetcherId); |
| 1202 EXPECT_TRUE(fetcher != NULL && fetcher->delegate() != NULL); | 1204 EXPECT_TRUE(fetcher != NULL && fetcher->delegate() != NULL); |
| 1203 EXPECT_TRUE(fetcher->GetLoadFlags() == kExpectedLoadFlags); | 1205 EXPECT_TRUE(fetcher->GetLoadFlags() == kExpectedLoadFlags); |
| 1204 | 1206 |
| (...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2260 // -prodversionmin (shouldn't update if browser version too old) | 2262 // -prodversionmin (shouldn't update if browser version too old) |
| 2261 // -manifests & updates arriving out of order / interleaved | 2263 // -manifests & updates arriving out of order / interleaved |
| 2262 // -malformed update url (empty, file://, has query, has a # fragment, etc.) | 2264 // -malformed update url (empty, file://, has query, has a # fragment, etc.) |
| 2263 // -An extension gets uninstalled while updates are in progress (so it doesn't | 2265 // -An extension gets uninstalled while updates are in progress (so it doesn't |
| 2264 // "come back from the dead") | 2266 // "come back from the dead") |
| 2265 // -An extension gets manually updated to v3 while we're downloading v2 (ie | 2267 // -An extension gets manually updated to v3 while we're downloading v2 (ie |
| 2266 // you don't get downgraded accidentally) | 2268 // you don't get downgraded accidentally) |
| 2267 // -An update manifest mentions multiple updates | 2269 // -An update manifest mentions multiple updates |
| 2268 | 2270 |
| 2269 } // namespace extensions | 2271 } // namespace extensions |
| OLD | NEW |