| 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 25 matching lines...) Expand all Loading... |
| 36 #include "chrome/browser/extensions/updater/extension_downloader.h" | 36 #include "chrome/browser/extensions/updater/extension_downloader.h" |
| 37 #include "chrome/browser/extensions/updater/extension_downloader_delegate.h" | 37 #include "chrome/browser/extensions/updater/extension_downloader_delegate.h" |
| 38 #include "chrome/browser/extensions/updater/extension_updater.h" | 38 #include "chrome/browser/extensions/updater/extension_updater.h" |
| 39 #include "chrome/browser/extensions/updater/manifest_fetch_data.h" | 39 #include "chrome/browser/extensions/updater/manifest_fetch_data.h" |
| 40 #include "chrome/browser/extensions/updater/request_queue_impl.h" | 40 #include "chrome/browser/extensions/updater/request_queue_impl.h" |
| 41 #include "chrome/browser/google/google_util.h" | 41 #include "chrome/browser/google/google_util.h" |
| 42 #include "chrome/browser/prefs/pref_service_syncable.h" | 42 #include "chrome/browser/prefs/pref_service_syncable.h" |
| 43 #include "chrome/common/chrome_notification_types.h" | 43 #include "chrome/common/chrome_notification_types.h" |
| 44 #include "chrome/common/extensions/extension.h" | 44 #include "chrome/common/extensions/extension.h" |
| 45 #include "chrome/common/extensions/extension_manifest_constants.h" | 45 #include "chrome/common/extensions/extension_manifest_constants.h" |
| 46 #include "chrome/common/extensions/manifest_handler.h" | |
| 47 #include "chrome/common/extensions/manifest_url_handler.h" | |
| 48 #include "chrome/common/omaha_query_params/omaha_query_params.h" | 46 #include "chrome/common/omaha_query_params/omaha_query_params.h" |
| 49 #include "chrome/common/pref_names.h" | 47 #include "chrome/common/pref_names.h" |
| 50 #include "chrome/test/base/testing_profile.h" | 48 #include "chrome/test/base/testing_profile.h" |
| 51 #include "content/public/browser/notification_details.h" | 49 #include "content/public/browser/notification_details.h" |
| 52 #include "content/public/browser/notification_observer.h" | 50 #include "content/public/browser/notification_observer.h" |
| 53 #include "content/public/browser/notification_registrar.h" | 51 #include "content/public/browser/notification_registrar.h" |
| 54 #include "content/public/browser/notification_service.h" | 52 #include "content/public/browser/notification_service.h" |
| 55 #include "content/public/browser/notification_source.h" | 53 #include "content/public/browser/notification_source.h" |
| 56 #include "content/public/test/test_browser_thread.h" | 54 #include "content/public/test/test_browser_thread.h" |
| 57 #include "extensions/common/id_util.h" | 55 #include "extensions/common/id_util.h" |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 ExtensionUpdaterTest() | 477 ExtensionUpdaterTest() |
| 480 : ui_thread_(BrowserThread::UI, &loop_), | 478 : ui_thread_(BrowserThread::UI, &loop_), |
| 481 file_thread_(BrowserThread::FILE, &loop_), | 479 file_thread_(BrowserThread::FILE, &loop_), |
| 482 io_thread_(BrowserThread::IO, &loop_) { | 480 io_thread_(BrowserThread::IO, &loop_) { |
| 483 } | 481 } |
| 484 | 482 |
| 485 virtual ~ExtensionUpdaterTest() { | 483 virtual ~ExtensionUpdaterTest() { |
| 486 } | 484 } |
| 487 | 485 |
| 488 virtual void SetUp() OVERRIDE { | 486 virtual void SetUp() OVERRIDE { |
| 487 testing::Test::SetUp(); |
| 489 prefs_.reset(new TestExtensionPrefs(loop_.message_loop_proxy())); | 488 prefs_.reset(new TestExtensionPrefs(loop_.message_loop_proxy())); |
| 490 (new extensions::UpdateURLHandler)->Register(); | |
| 491 } | 489 } |
| 492 | 490 |
| 493 virtual void TearDown() OVERRIDE { | 491 virtual void TearDown() OVERRIDE { |
| 494 // Some tests create URLRequestContextGetters, whose destruction must run | 492 // Some tests create URLRequestContextGetters, whose destruction must run |
| 495 // on the IO thread. Make sure the IO loop spins before shutdown so that | 493 // on the IO thread. Make sure the IO loop spins before shutdown so that |
| 496 // those objects are released. | 494 // those objects are released. |
| 497 RunUntilIdle(); | 495 RunUntilIdle(); |
| 498 prefs_.reset(); | 496 prefs_.reset(); |
| 499 ManifestHandler::ClearRegistryForTesting(); | 497 testing::Test::TearDown(); |
| 500 } | 498 } |
| 501 | 499 |
| 502 void RunUntilIdle() { | 500 void RunUntilIdle() { |
| 503 prefs_->pref_service()->CommitPendingWrite(); | 501 prefs_->pref_service()->CommitPendingWrite(); |
| 504 loop_.RunUntilIdle(); | 502 loop_.RunUntilIdle(); |
| 505 } | 503 } |
| 506 | 504 |
| 507 void SimulateTimerFired(ExtensionUpdater* updater) { | 505 void SimulateTimerFired(ExtensionUpdater* updater) { |
| 508 EXPECT_TRUE(updater->timer_.IsRunning()); | 506 EXPECT_TRUE(updater->timer_.IsRunning()); |
| 509 updater->timer_.Stop(); | 507 updater->timer_.Stop(); |
| (...skipping 1228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1738 // -prodversionmin (shouldn't update if browser version too old) | 1736 // -prodversionmin (shouldn't update if browser version too old) |
| 1739 // -manifests & updates arriving out of order / interleaved | 1737 // -manifests & updates arriving out of order / interleaved |
| 1740 // -malformed update url (empty, file://, has query, has a # fragment, etc.) | 1738 // -malformed update url (empty, file://, has query, has a # fragment, etc.) |
| 1741 // -An extension gets uninstalled while updates are in progress (so it doesn't | 1739 // -An extension gets uninstalled while updates are in progress (so it doesn't |
| 1742 // "come back from the dead") | 1740 // "come back from the dead") |
| 1743 // -An extension gets manually updated to v3 while we're downloading v2 (ie | 1741 // -An extension gets manually updated to v3 while we're downloading v2 (ie |
| 1744 // you don't get downgraded accidentally) | 1742 // you don't get downgraded accidentally) |
| 1745 // -An update manifest mentions multiple updates | 1743 // -An update manifest mentions multiple updates |
| 1746 | 1744 |
| 1747 } // namespace extensions | 1745 } // namespace extensions |
| OLD | NEW |