Add Zotero.test, which is true during tests

(Zotero.automatedTest is only true in Travis)
This commit is contained in:
Dan Stillman 2016-11-13 04:54:57 -05:00
parent 4082ff9e8c
commit cfe76a6f83
3 changed files with 5 additions and 2 deletions

View File

@ -178,6 +178,7 @@ Components.utils.import("resource://gre/modules/osfile.jsm");
if (options) { if (options) {
let opts = [ let opts = [
'openPane', 'openPane',
'test',
'automatedTest', 'automatedTest',
'skipBundledFiles' 'skipBundledFiles'
]; ];

View File

@ -483,6 +483,9 @@ ZoteroCommandLineHandler.prototype = {
} }
} }
if (cmdLine.handleFlag("ZoteroTest", false)) {
zInitOptions.test = true;
}
if (cmdLine.handleFlag("ZoteroAutomatedTest", false)) { if (cmdLine.handleFlag("ZoteroAutomatedTest", false)) {
zInitOptions.automatedTest = true; zInitOptions.automatedTest = true;
} }

View File

@ -134,7 +134,6 @@ if [ -z $IS_CYGWIN ]; then
echo "`MOZ_NO_REMOTE=1 NO_EM_RESTART=1 \"$FX_EXECUTABLE\" -v`" echo "`MOZ_NO_REMOTE=1 NO_EM_RESTART=1 \"$FX_EXECUTABLE\" -v`"
fi fi
if [ "$TRAVIS" = true ]; then if [ "$TRAVIS" = true ]; then
FX_ARGS="$FX_ARGS -ZoteroAutomatedTest -ZoteroTestTimeout 10000" FX_ARGS="$FX_ARGS -ZoteroAutomatedTest -ZoteroTestTimeout 10000"
fi fi
@ -144,7 +143,7 @@ trap "{ rm -rf \"$PROFILE\"; }" EXIT
makePath FX_PROFILE "$PROFILE" makePath FX_PROFILE "$PROFILE"
MOZ_NO_REMOTE=1 NO_EM_RESTART=1 "$FX_EXECUTABLE" -profile "$FX_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 # Check for success
test -e "$PROFILE/success" test -e "$PROFILE/success"