www

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

commit 289983f4866a5cafe8587cb0186db3319abaedb1
parent 3238656ca0971d09e0a9c6712c348d1dfd3d65f3
Author: Simon Kornblith <simon@simonster.com>
Date:   Tue, 12 Jul 2011 07:41:51 +0000

Some very small modifications for translator test support in zotero-node that are probably never going to get used


Diffstat:
Mchrome/content/zotero/tools/testTranslators/testTranslators.js | 6++++--
Mchrome/content/zotero/tools/testTranslators/translatorTester.js | 2+-
Mchrome/content/zotero/xpcom/connector/translator.js | 2+-
Mchrome/content/zotero/xpcom/utilities.js | 5+----
4 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/chrome/content/zotero/tools/testTranslators/testTranslators.js b/chrome/content/zotero/tools/testTranslators/testTranslators.js @@ -316,10 +316,12 @@ function haveTranslators(translators, type) { /** * Runs translator tests recursively, after translatorTestViews has been populated */ -function runTranslatorTests(type) { +function runTranslatorTests(type, callback) { if(translatorTestViewsToRun[type].length) { var translatorTestView = translatorTestViewsToRun[type].shift(); - translatorTestView.runTests(function() { runTranslatorTests(type) }); + translatorTestView.runTests(function() { runTranslatorTests(type, callback) }); + } else if(callback) { + callback(); } } diff --git a/chrome/content/zotero/tools/testTranslators/translatorTester.js b/chrome/content/zotero/tools/testTranslators/translatorTester.js @@ -170,7 +170,7 @@ Zotero_TranslatorTester.prototype.fetchPageAndRunTest = function(test, testDoneC var hiddenBrowser = Zotero.HTTP.processDocuments(test.url, function(doc) { me.runTest(test, doc, function(obj, test, status, message) { - Zotero.Browser.deleteHiddenBrowser(hiddenBrowser); + if(hiddenBrowser) Zotero.Browser.deleteHiddenBrowser(hiddenBrowser); testDoneCallback(obj, test, status, message); }); }, diff --git a/chrome/content/zotero/xpcom/connector/translator.js b/chrome/content/zotero/xpcom/connector/translator.js @@ -344,7 +344,7 @@ Zotero.Translators.CodeGetter.prototype.getCodeFor = function(i) { || (this._debugMode && (!translator.hasOwnProperty("code") // or if in debug mode and the code we have came from the repo (which doesn't // include test cases) - || translator.codeSource === Zotero.Repo.SOURCE_REPO))) { + || (Zotero.Repo && translator.codeSource === Zotero.Repo.SOURCE_REPO)))) { // get next translator translator.getCode(function() { me.getCodeFor(i+1) }); return; diff --git a/chrome/content/zotero/xpcom/utilities.js b/chrome/content/zotero/xpcom/utilities.js @@ -705,10 +705,7 @@ Zotero.Utilities = { } try { - var xpathObject = rootDoc.evaluate(xpath, element, nsResolver, - (Zotero.isFx - ? Components.interfaces.nsIDOMXPathResult.ORDERED_NODE_ITERATOR_TYPE - : XPathResult.ORDERED_NODE_ITERATOR_TYPE), + var xpathObject = rootDoc.evaluate(xpath, element, nsResolver, 5, // 5 = ORDERED_NODE_ITERATOR_TYPE null); } catch(e) { // rethrow so that we get a stack