mirror of
https://github.com/zotero/zotero.git
synced 2026-10-04 02:31:47 +00:00
Allow tests to be deferred by adding "defer": true to test JSON.
This commit is contained in:
parent
e116f7a174
commit
3c33768116
1 changed files with 11 additions and 4 deletions
|
|
@ -187,12 +187,19 @@ Zotero_TranslatorTester.prototype._runTestsRecursively = function(testDoneCallba
|
|||
*/
|
||||
Zotero_TranslatorTester.prototype.fetchPageAndRunTest = function(test, testDoneCallback) {
|
||||
var me = this;
|
||||
var runTest = function(doc) {
|
||||
me.runTest(test, doc, function(obj, test, status, message) {
|
||||
if(hiddenBrowser) Zotero.Browser.deleteHiddenBrowser(hiddenBrowser);
|
||||
testDoneCallback(obj, test, status, message);
|
||||
});
|
||||
};
|
||||
var hiddenBrowser = Zotero.HTTP.processDocuments(test.url,
|
||||
function(doc) {
|
||||
me.runTest(test, doc, function(obj, test, status, message) {
|
||||
if(hiddenBrowser) Zotero.Browser.deleteHiddenBrowser(hiddenBrowser);
|
||||
testDoneCallback(obj, test, status, message);
|
||||
});
|
||||
if(test.defer) {
|
||||
Zotero.setTimeout(function() { runTest(doc) }, 10000, true);
|
||||
} else {
|
||||
runTest(doc);
|
||||
}
|
||||
},
|
||||
null,
|
||||
function(e) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue