From da69bb246b0de186d016a72db859050e8e52a1ef Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Mon, 1 Apr 2024 11:37:38 -0400 Subject: [PATCH] Revert test runner changes --- test/components/zotero-unit.js | 19 ++++++++++++++----- test/content/runtests.html | 1 + test/runtests.sh | 2 +- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/test/components/zotero-unit.js b/test/components/zotero-unit.js index 354f1ae250..fa262f884d 100644 --- a/test/components/zotero-unit.js +++ b/test/components/zotero-unit.js @@ -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]); diff --git a/test/content/runtests.html b/test/content/runtests.html index 054d7200eb..44dbdfcdd0 100644 --- a/test/content/runtests.html +++ b/test/content/runtests.html @@ -1,3 +1,4 @@ + diff --git a/test/runtests.sh b/test/runtests.sh index 7005f5817f..d83914a3ba 100755 --- a/test/runtests.sh +++ b/test/runtests.sh @@ -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"