From cfe76a6f83b6d0413918db23cbc876660e5396a0 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 13 Nov 2016 04:54:57 -0500 Subject: [PATCH] Add Zotero.test, which is true during tests (Zotero.automatedTest is only true in Travis) --- chrome/content/zotero/xpcom/zotero.js | 1 + components/zotero-service.js | 3 +++ test/runtests.sh | 3 +-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index 4818bacf4..c868dd0ef 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -178,6 +178,7 @@ Components.utils.import("resource://gre/modules/osfile.jsm"); if (options) { let opts = [ 'openPane', + 'test', 'automatedTest', 'skipBundledFiles' ]; diff --git a/components/zotero-service.js b/components/zotero-service.js index 73bdab6e7..ce6ff8694 100644 --- a/components/zotero-service.js +++ b/components/zotero-service.js @@ -483,6 +483,9 @@ ZoteroCommandLineHandler.prototype = { } } + if (cmdLine.handleFlag("ZoteroTest", false)) { + zInitOptions.test = true; + } if (cmdLine.handleFlag("ZoteroAutomatedTest", false)) { zInitOptions.automatedTest = true; } diff --git a/test/runtests.sh b/test/runtests.sh index c6cb3ca62..4cc68f4ac 100755 --- a/test/runtests.sh +++ b/test/runtests.sh @@ -134,7 +134,6 @@ if [ -z $IS_CYGWIN ]; then echo "`MOZ_NO_REMOTE=1 NO_EM_RESTART=1 \"$FX_EXECUTABLE\" -v`" fi - if [ "$TRAVIS" = true ]; then FX_ARGS="$FX_ARGS -ZoteroAutomatedTest -ZoteroTestTimeout 10000" fi @@ -144,7 +143,7 @@ trap "{ rm -rf \"$PROFILE\"; }" EXIT makePath FX_PROFILE "$PROFILE" MOZ_NO_REMOTE=1 NO_EM_RESTART=1 "$FX_EXECUTABLE" -profile "$FX_PROFILE" \ - -chrome chrome://zotero-unit/content/runtests.html -test "$TESTS" -grep "$GREP" $FX_ARGS + -chrome chrome://zotero-unit/content/runtests.html -test "$TESTS" -grep "$GREP" -ZoteroTest $FX_ARGS # Check for success test -e "$PROFILE/success"