www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit a2d874c8bc9d0f1b8cc49460985e547200c57b59
parent c11f1069d7136b2c9c60d2cfa8445f67f8da765e
Author: Dan Stillman <dstillman@zotero.org>
Date:   Tue, 20 Jun 2017 00:51:38 -0400

Don't schedule feed checks during tests

Tests create lots of fake feeds with invalid URLs, so auto-updating
would otherwise hang and block the explicit feed updates done by other
tests.

Diffstat:
Mchrome/content/zotero/xpcom/data/feeds.js | 13+++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/chrome/content/zotero/xpcom/data/feeds.js b/chrome/content/zotero/xpcom/data/feeds.js @@ -32,9 +32,14 @@ Zotero.Feeds = new function() { this.init = function () { // Delay initialization for tests - _initPromise = Zotero.Schema.schemaUpdatePromise.delay(5000).then(() => { - this.scheduleNextFeedCheck().then(() => _initPromise = null); - }); + _initPromise = Zotero.Schema.schemaUpdatePromise.delay(5000) + .then(() => { + // Don't run feed checks randomly during tests + if (Zotero.test) return; + + return this.scheduleNextFeedCheck(); + }) + .then(() => _initPromise = null); Zotero.SyncedSettings.onSyncDownload.addListener(Zotero.Libraries.userLibraryID, 'feeds', (oldValue, newValue, conflict) => { @@ -52,7 +57,7 @@ Zotero.Feeds = new function() { if (_initPromise) { await _initPromise; } - Zotero.Feeds.updateFeeds(); + await Zotero.Feeds.updateFeeds(); } }, },