From 89a798b26f3f60ec862f1f7e59c9d8d5cdb5ed5f Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Thu, 31 Aug 2023 11:31:38 -0400 Subject: [PATCH] Revert "Switch back to @mozilla.org/browser/clh;1 and fix tests" This reverts commit 722287b81a5db3af6c8de5c22ac72ae633e9ef18. --- test/components/zotero-unit.js | 19 +++++-------------- test/content/runtests.html | 1 - test/runtests.sh | 2 +- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/test/components/zotero-unit.js b/test/components/zotero-unit.js index fa262f884d..354f1ae250 100644 --- a/test/components/zotero-unit.js +++ b/test/components/zotero-unit.js @@ -24,7 +24,6 @@ ***** 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; @@ -32,8 +31,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; @@ -42,27 +41,19 @@ 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 44dbdfcdd0..054d7200eb 100644 --- a/test/content/runtests.html +++ b/test/content/runtests.html @@ -1,4 +1,3 @@ - diff --git a/test/runtests.sh b/test/runtests.sh index d83914a3ba..7005f5817f 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" \ - -test "$TESTS" -grep "$GREP" -ZoteroTest $Z_ARGS + -chrome chrome://zotero-unit/content/runtests.html -test "$TESTS" -grep "$GREP" -ZoteroTest $Z_ARGS # Check for success test -e "$PROFILE/success"