commit 45ddf9827ce9658576fbf4d30ac4193da421629b
parent 06fb74aafda57971f2c36a96c5553cf814bd9da9
Author: Dan Stillman <dstillman@zotero.org>
Date: Mon, 5 Feb 2018 23:09:17 -0500
Reset PDF tools path for tests in resetDB()
And include path on error when running PDF tool
Diffstat:
4 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/chrome/content/zotero/xpcom/fulltext.js b/chrome/content/zotero/xpcom/fulltext.js
@@ -446,7 +446,8 @@ Zotero.Fulltext = Zotero.FullText = new function(){
var totalPages = yield getTotalPagesFromFile(itemID);
}
catch (e) {
- Zotero.debug("Error running pdfinfo");
+ Zotero.debug("Error running " + _pdfInfo.path, 1);
+ Zotero.logError(e);
}
@@ -468,9 +469,8 @@ Zotero.Fulltext = Zotero.FullText = new function(){
yield Zotero.Utilities.Internal.exec(exec, args);
}
catch (e) {
- Components.utils.reportError(e);
- Zotero.debug("Error running pdftotext", 1);
- Zotero.debug(e, 1);
+ Zotero.debug("Error running " + exec.path, 1);
+ Zotero.logError(e);
return false;
}
diff --git a/test/content/support.js b/test/content/support.js
@@ -566,7 +566,7 @@ var removeDir = Zotero.Promise.coroutine(function* (dir) {
* @param {Object} [options] - Initialization options, as passed to Zotero.init(), overriding
* any that were set at startup
*/
-function resetDB(options = {}) {
+async function resetDB(options = {}) {
// Hack to avoid CustomizableUI warnings in console from icon.js
var toolbarIconAdded = Zotero.toolbarIconAdded;
resetPrefs();
@@ -575,18 +575,17 @@ function resetDB(options = {}) {
options.thisArg.timeout(60000);
}
var db = Zotero.DataDirectory.getDatabase();
- return Zotero.reinit(
+ await Zotero.reinit(
Zotero.Promise.coroutine(function* () {
yield OS.File.remove(db);
_defaultGroup = null;
}),
false,
options
- )
- .then(() => {
- Zotero.toolbarIconAdded = toolbarIconAdded;
- return Zotero.Schema.schemaUpdatePromise;
- });
+ );
+ Zotero.toolbarIconAdded = toolbarIconAdded;
+ await Zotero.Schema.schemaUpdatePromise;
+ initPDFToolsPath();
}
/**
diff --git a/test/tests/fulltextTest.js b/test/tests/fulltextTest.js
@@ -5,7 +5,6 @@ describe("Zotero.Fulltext", function () {
// Hidden browser, which requires a browser window, needed for charset detection
// (until we figure out a better way)
win = yield loadBrowserWindow();
- initPDFToolsPath();
});
after(function () {
if (win) {
diff --git a/test/tests/recognizePDFTest.js b/test/tests/recognizePDFTest.js
@@ -9,7 +9,6 @@ describe("PDF Recognition", function() {
yield Zotero.Promise.all([
loadZoteroPane().then(w => win = w)
]);
- initPDFToolsPath();
});
beforeEach(function* () {