| 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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 : ui_thread_(BrowserThread::UI, &loop_), | 451 : ui_thread_(BrowserThread::UI, &loop_), |
| 452 file_thread_(BrowserThread::FILE, &loop_), | 452 file_thread_(BrowserThread::FILE, &loop_), |
| 453 io_thread_(BrowserThread::IO, &loop_) { | 453 io_thread_(BrowserThread::IO, &loop_) { |
| 454 } | 454 } |
| 455 | 455 |
| 456 virtual ~ExtensionUpdaterTest() { | 456 virtual ~ExtensionUpdaterTest() { |
| 457 } | 457 } |
| 458 | 458 |
| 459 virtual void SetUp() OVERRIDE { | 459 virtual void SetUp() OVERRIDE { |
| 460 prefs_.reset(new TestExtensionPrefs(loop_.message_loop_proxy())); | 460 prefs_.reset(new TestExtensionPrefs(loop_.message_loop_proxy())); |
| 461 extensions::ManifestHandler::Register( | 461 (new extensions::UpdateURLHandler)->Register(); |
| 462 extension_manifest_keys::kUpdateURL, | |
| 463 make_linked_ptr(new extensions::UpdateURLHandler)); | |
| 464 } | 462 } |
| 465 | 463 |
| 466 virtual void TearDown() OVERRIDE { | 464 virtual void TearDown() OVERRIDE { |
| 467 // Some tests create URLRequestContextGetters, whose destruction must run | 465 // Some tests create URLRequestContextGetters, whose destruction must run |
| 468 // on the IO thread. Make sure the IO loop spins before shutdown so that | 466 // on the IO thread. Make sure the IO loop spins before shutdown so that |
| 469 // those objects are released. | 467 // those objects are released. |
| 470 RunUntilIdle(); | 468 RunUntilIdle(); |
| 471 prefs_.reset(); | 469 prefs_.reset(); |
| 470 ManifestHandler::ClearRegistryForTesting(); |
| 472 } | 471 } |
| 473 | 472 |
| 474 void RunUntilIdle() { | 473 void RunUntilIdle() { |
| 475 prefs_->pref_service()->CommitPendingWrite(); | 474 prefs_->pref_service()->CommitPendingWrite(); |
| 476 loop_.RunUntilIdle(); | 475 loop_.RunUntilIdle(); |
| 477 } | 476 } |
| 478 | 477 |
| 479 void SimulateTimerFired(ExtensionUpdater* updater) { | 478 void SimulateTimerFired(ExtensionUpdater* updater) { |
| 480 EXPECT_TRUE(updater->timer_.IsRunning()); | 479 EXPECT_TRUE(updater->timer_.IsRunning()); |
| 481 updater->timer_.Stop(); | 480 updater->timer_.Stop(); |
| (...skipping 1212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1694 // -prodversionmin (shouldn't update if browser version too old) | 1693 // -prodversionmin (shouldn't update if browser version too old) |
| 1695 // -manifests & updates arriving out of order / interleaved | 1694 // -manifests & updates arriving out of order / interleaved |
| 1696 // -malformed update url (empty, file://, has query, has a # fragment, etc.) | 1695 // -malformed update url (empty, file://, has query, has a # fragment, etc.) |
| 1697 // -An extension gets uninstalled while updates are in progress (so it doesn't | 1696 // -An extension gets uninstalled while updates are in progress (so it doesn't |
| 1698 // "come back from the dead") | 1697 // "come back from the dead") |
| 1699 // -An extension gets manually updated to v3 while we're downloading v2 (ie | 1698 // -An extension gets manually updated to v3 while we're downloading v2 (ie |
| 1700 // you don't get downgraded accidentally) | 1699 // you don't get downgraded accidentally) |
| 1701 // -An update manifest mentions multiple updates | 1700 // -An update manifest mentions multiple updates |
| 1702 | 1701 |
| 1703 } // namespace extensions | 1702 } // namespace extensions |
| OLD | NEW |