commit 3ef9b935731a31b4e9cea85d39ef8a2b4806ae45
parent 43bd1b70823d3e397f071060b3a89924cb0fa758
Author: Dan Stillman <dstillman@zotero.org>
Date: Tue, 6 Sep 2016 01:32:59 -0400
Fix errors with deferred translator tests
In translation-server, the test timeout is overridden to 30 seconds, which was
also the deferred test delay, so there was a race condition that could cause
deferred tests to fail. This sets the deferred delay to 20 seconds.
Diffstat:
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/chrome/content/zotero/tools/testTranslators/translatorTester.js b/chrome/content/zotero/tools/testTranslators/translatorTester.js
@@ -235,7 +235,7 @@ Zotero_TranslatorTester = function(translator, type, debugCallback) {
}
};
-Zotero_TranslatorTester.DEFER_DELAY = 30000; // Delay for deferred tests
+Zotero_TranslatorTester.DEFER_DELAY = 20000; // Delay for deferred tests
/**
* Removes document objects, which contain cyclic references, and other fields to be ignored from items
@@ -401,7 +401,7 @@ Zotero_TranslatorTester.prototype.fetchPageAndRunTest = function(test, testDoneC
createInstance(Components.interfaces.nsITimer);
timer.initWithCallback({"notify":function() {
try {
- Zotero.Browser.deleteHiddenBrowser(hiddenBrowser);
+ if (hiddenBrowser) Zotero.Browser.deleteHiddenBrowser(hiddenBrowser);
} catch(e) {}
}}, TEST_RUN_TIMEOUT, Components.interfaces.nsITimer.TYPE_ONE_SHOT);
@@ -422,10 +422,7 @@ Zotero_TranslatorTester.prototype.fetchPageAndRunTest = function(test, testDoneC
+ (Zotero_TranslatorTester.DEFER_DELAY/1000)
+ " second(s) for page content to settle"
);
- Zotero.setTimeout(
- function() {runTest(hiddenBrowser.contentDocument) },
- Zotero_TranslatorTester.DEFER_DELAY, true
- );
+ Zotero.setTimeout(() => runTest(doc), Zotero_TranslatorTester.DEFER_DELAY);
} else {
runTest(doc);
}