Revert test runner changes

This commit is contained in:
Abe Jellinek 2024-04-01 11:37:38 -04:00
parent 2e9d7db0e8
commit da69bb246b
3 changed files with 16 additions and 6 deletions

View file

@ -24,6 +24,7 @@
***** END LICENSE BLOCK *****
*/
Components.utils.import("resource://gre/modules/ComponentUtils.jsm");
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
function ZoteroUnit() {
this.wrappedJSObject = this;
@ -31,8 +32,8 @@ function ZoteroUnit() {
ZoteroUnit.prototype = {
/* nsICommandLineHandler */
handle:function(cmdLine) {
this.tests = cmdLine.handleFlagWithParam("test", false);
this.noquit = cmdLine.handleFlag("noquit", false);
this.tests = cmdLine.handleFlagWithParam("test", false);
this.noquit = cmdLine.handleFlag("noquit", false);
this.makeTestData = cmdLine.handleFlag("makeTestData", false);
this.noquit = !this.makeTestData && this.noquit;
this.runTests = !this.makeTestData;
@ -41,19 +42,27 @@ ZoteroUnit.prototype = {
this.stopAt = cmdLine.handleFlagWithParam("stopAtTestFile", false);
this.grep = cmdLine.handleFlagWithParam("grep", false);
this.timeout = cmdLine.handleFlagWithParam("ZoteroTestTimeout", false);
if (this.tests) {
Services.ww.openWindow(
null,
"chrome://zotero-unit/content/runtests.html",
"_blank",
"chrome,dialog=no,all",
Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray)
);
cmdLine.preventDefault = true;
}
},
dump:function(x) {
dump(x);
},
contractID: "@mozilla.org/commandlinehandler/general-startup;1?type=zotero-unit",
classDescription: "Zotero Unit Command Line Handler",
classID: Components.ID("{b8570031-be5e-46e8-9785-38cd50a5d911}"),
service: true,
_xpcom_categories: [{category:"command-line-handler", entry:"m-zotero-unit"}],
QueryInterface: ChromeUtils.generateQI([Components.interfaces.nsICommandLineHandler])
};
var NSGetFactory = ComponentUtils.generateNSGetFactory([ZoteroUnit]);

View file

@ -1,3 +1,4 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"></meta>

View file

@ -168,7 +168,7 @@ ZOTERO_TEST=1 "$ROOT_DIR/app/scripts/dir_build" -q
makePath FX_PROFILE "$PROFILE"
MOZ_NO_REMOTE=1 NO_EM_RESTART=1 "$Z_EXECUTABLE" -profile "$FX_PROFILE" \
-chrome chrome://zotero-unit/content/runtests.html -test "$TESTS" -grep "$GREP" -ZoteroTest $Z_ARGS
-test "$TESTS" -grep "$GREP" -ZoteroTest $Z_ARGS
# Check for success
test -e "$PROFILE/success"