www

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

commit 754836c4289216bdf7c87fb44dfa99452d78d29e
parent 0117065a8ed8a2cfc04323d8f8dcdabecff8fe6a
Author: Simon Kornblith <simon@simonster.com>
Date:   Thu, 29 Mar 2012 20:35:27 -0400

Test fail if Z.selectItems() is called multiple times

Diffstat:
Mchrome/content/zotero/tools/testTranslators/translatorTester.js | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git a/chrome/content/zotero/tools/testTranslators/translatorTester.js b/chrome/content/zotero/tools/testTranslators/translatorTester.js @@ -404,12 +404,17 @@ Zotero_TranslatorTester.prototype.runTest = function(test, doc, testDoneCallback translate.setHandler("done", function(obj, returnValue) { me._checkResult(test, obj, returnValue, errorReturned, testDoneCallback); }); + var selectCalled = false; translate.setHandler("select", function(obj, items, callback) { if(test.items !== "multiple" && test.items.length <= 1) { testDoneCallback(me, test, "failed", "Zotero.selectItems() called, but only one item defined in test"); callback({}); + } else if(selectCalled) { + testDoneCallback(me, test, "failed", "Zotero.selectItems() called multiple times"); + callback({}); } + selectCalled = true; var newItems = {}; var haveItems = false; for(var i in items) {