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

Unified Diff: chrome/browser/extensions/updater/extension_updater_unittest.cc

Issue 2562963003: Fix DCHECK failure in extension_updater when scheduling first check (Closed)
Patch Set: fix nits Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/updater/extension_updater.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/updater/extension_updater_unittest.cc
diff --git a/chrome/browser/extensions/updater/extension_updater_unittest.cc b/chrome/browser/extensions/updater/extension_updater_unittest.cc
index 09858072061cf73f5d6584d538bd70eb5d0ef5d3..205f05add127d6830ddd344861ee09f4037634dd 100644
--- a/chrome/browser/extensions/updater/extension_updater_unittest.cc
+++ b/chrome/browser/extensions/updater/extension_updater_unittest.cc
@@ -57,10 +57,12 @@
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
+#include "extensions/browser/pref_names.h"
#include "extensions/browser/updater/extension_downloader.h"
#include "extensions/browser/updater/extension_downloader_delegate.h"
#include "extensions/browser/updater/manifest_fetch_data.h"
#include "extensions/browser/updater/request_queue_impl.h"
+#include "extensions/common/constants.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_urls.h"
#include "extensions/common/manifest_constants.h"
@@ -2259,6 +2261,22 @@ TEST_F(ExtensionUpdaterTest, TestUninstallWhileUpdateCheck) {
ASSERT_FALSE(service.GetExtensionById(id, false));
}
+// Tests that we don't get a DCHECK failure when the next check time saved in
+// prefs happens to be within one second of startup.
+TEST_F(ExtensionUpdaterTest, TestPersistedNextCheckTime) {
+ base::Time next_check_time =
+ base::Time::Now() + base::TimeDelta::FromMilliseconds(500);
+ prefs_->pref_service()->SetInt64(pref_names::kNextUpdateCheck,
+ next_check_time.ToInternalValue());
+ ServiceForManifestTests service(prefs_.get());
+ ExtensionUpdater updater(&service, service.extension_prefs(),
+ service.pref_service(), service.profile(),
+ kDefaultUpdateFrequencySeconds, nullptr,
+ service.GetDownloaderFactory());
+ updater.Start();
+ updater.Stop();
+}
+
// TODO(asargent) - (http://crbug.com/12780) add tests for:
// -prodversionmin (shouldn't update if browser version too old)
// -manifests & updates arriving out of order / interleaved
« no previous file with comments | « chrome/browser/extensions/updater/extension_updater.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698