Update translatorTester for translation server support
This commit is contained in:
parent
9d98f765b2
commit
5b3b1f0f1b
1 changed files with 12 additions and 10 deletions
|
@ -30,11 +30,7 @@ var EXPORTED_SYMBOLS = ["Zotero_TranslatorTesters"];
|
||||||
// For debugging specific translators by label
|
// For debugging specific translators by label
|
||||||
var includeTranslators = [];
|
var includeTranslators = [];
|
||||||
|
|
||||||
try {
|
this.Zotero = Zotero;
|
||||||
Zotero;
|
|
||||||
} catch(e) {
|
|
||||||
var Zotero;
|
|
||||||
}
|
|
||||||
|
|
||||||
var Zotero_TranslatorTesters = new function() {
|
var Zotero_TranslatorTesters = new function() {
|
||||||
const TEST_TYPES = ["web", "import", "export", "search"];
|
const TEST_TYPES = ["web", "import", "export", "search"];
|
||||||
|
@ -46,12 +42,14 @@ var Zotero_TranslatorTesters = new function() {
|
||||||
this.runAllTests = function (numConcurrentTests, skipTranslators, writeDataCallback) {
|
this.runAllTests = function (numConcurrentTests, skipTranslators, writeDataCallback) {
|
||||||
var id = Math.random() * (100000000 - 1) + 1;
|
var id = Math.random() * (100000000 - 1) + 1;
|
||||||
|
|
||||||
|
if (!(typeof process === 'object' && process + '' === '[object process]')){
|
||||||
waitForDialog();
|
waitForDialog();
|
||||||
|
|
||||||
if(!Zotero) {
|
if(!Zotero) {
|
||||||
Zotero = Components.classes["@zotero.org/Zotero;1"]
|
Zotero = Components.classes["@zotero.org/Zotero;1"]
|
||||||
.getService(Components.interfaces.nsISupports).wrappedJSObject;
|
.getService(Components.interfaces.nsISupports).wrappedJSObject;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var testers = [];
|
var testers = [];
|
||||||
var waitingForTranslators = TEST_TYPES.length;
|
var waitingForTranslators = TEST_TYPES.length;
|
||||||
|
@ -760,3 +758,7 @@ Zotero_TranslatorTester._generateDiff = new function() {
|
||||||
return txt.substr(0, txt.length-1);
|
return txt.substr(0, txt.length-1);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (typeof process === 'object' && process + '' === '[object process]'){
|
||||||
|
module.exports = Zotero_TranslatorTesters;
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue