www

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

commit 4a4073652f26094822003e4dd29f3cb873e9d16e
parent c2d32c2e271114c41785226eb46f41332a66077c
Author: Simon Kornblith <simon@simonster.com>
Date:   Mon,  9 Mar 2015 17:06:01 -0400

updateBundledFiles before using translators and wait for completion

Diffstat:
Mtest/content/support.js | 10----------
Mtest/tests/lookup.js | 5+++--
Mtest/tests/recognizePDF.js | 9+++++----
3 files changed, 8 insertions(+), 16 deletions(-)

diff --git a/test/content/support.js b/test/content/support.js @@ -115,16 +115,6 @@ function waitForCallback(cb, interval, timeout) { } /** - * Returns a promise that is resolved once the translators are loaded. - */ -function waitForTranslators() { - return waitForCallback(function() { - // Just wait for the zotero.org translator to load - return !!Zotero.Translators.get("c82c574d-7fe8-49ca-a360-a05d6e34fec0"); - }); -} - -/** * Ensures that the PDF tools are installed, or installs them if not. * Returns a promise. */ diff --git a/test/tests/lookup.js b/test/tests/lookup.js @@ -9,10 +9,11 @@ describe("Add Item by Identifier", function() { var win; before(function() { this.timeout(5000); + // Load a Zotero pane and update the translators (needed to + // make sure they're available before we run the tests) return loadZoteroPane().then(function(w) { win = w; - }).then(function() { - return waitForTranslators(); + return Zotero.Schema.updateBundledFiles('translators', null, false); }); }); after(function() { diff --git a/test/tests/recognizePDF.js b/test/tests/recognizePDF.js @@ -4,11 +4,12 @@ describe("PDF Recognition", function() { var win; before(function() { this.timeout(60000); - return installPDFTools().then(function() { - return loadZoteroPane(); - }).then(function(w) { + // Load Zotero pane, install PDF tools, and load the + // translators + return Q.all([loadZoteroPane().then(function(w) { win = w; - }); + return Zotero.Schema.updateBundledFiles('translators', null, false); + }), installPDFTools()]); }); afterEach(function() { for(let win of getWindows("chrome://zotero/content/pdfProgress.xul")) {