diff --git a/mozilla/toolkit/components/commandlines/Makefile.in b/mozilla/toolkit/components/commandlines/Makefile.in index fa8a72f1215..64919ffd658 100644 --- a/mozilla/toolkit/components/commandlines/Makefile.in +++ b/mozilla/toolkit/components/commandlines/Makefile.in @@ -45,6 +45,7 @@ include $(DEPTH)/config/autoconf.mk DIRS = \ public \ src \ + test \ $(NULL) include $(topsrcdir)/config/rules.mk diff --git a/mozilla/toolkit/components/commandlines/src/nsCommandLine.cpp b/mozilla/toolkit/components/commandlines/src/nsCommandLine.cpp index b8e2ebdd354..b42b806cb40 100644 --- a/mozilla/toolkit/components/commandlines/src/nsCommandLine.cpp +++ b/mozilla/toolkit/components/commandlines/src/nsCommandLine.cpp @@ -39,6 +39,7 @@ #include "nsICategoryManager.h" #include "nsICommandLineHandler.h" +#include "nsIClassInfoImpl.h" #include "nsIDOMWindow.h" #include "nsIFile.h" #include "nsISimpleEnumerator.h" @@ -107,9 +108,9 @@ nsCommandLine::nsCommandLine() : } -NS_IMPL_ISUPPORTS2(nsCommandLine, - nsICommandLine, - nsICommandLineRunner) +NS_IMPL_ISUPPORTS2_CI(nsCommandLine, + nsICommandLine, + nsICommandLineRunner) NS_IMETHODIMP nsCommandLine::GetLength(PRInt32 *aResult) @@ -623,13 +624,21 @@ nsCommandLine::GetHelpText(nsACString& aResult) } NS_GENERIC_FACTORY_CONSTRUCTOR(nsCommandLine) +NS_DECL_CLASSINFO(nsCommandLine) static const nsModuleComponentInfo components[] = { { "nsCommandLine", { 0x23bcc750, 0xdc20, 0x460b, { 0xb2, 0xd4, 0x74, 0xd8, 0xf5, 0x8d, 0x36, 0x15 } }, "@mozilla.org/toolkit/command-line;1", - nsCommandLineConstructor + nsCommandLineConstructor, + nsnull, + nsnull, + nsnull, + NS_CI_INTERFACE_GETTER_NAME(nsCommandLine), + nsnull, + &NS_CLASSINFO_NAME(nsCommandLine), + 0 } }; diff --git a/mozilla/toolkit/components/commandlines/test/Makefile.in b/mozilla/toolkit/components/commandlines/test/Makefile.in new file mode 100644 index 00000000000..1e2e001845e --- /dev/null +++ b/mozilla/toolkit/components/commandlines/test/Makefile.in @@ -0,0 +1,53 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is +# Mozilla.org. +# Portions created by the Initial Developer are Copyright (C) 2005 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Boris Zbarsky (Original author) +# Jeff Walden +# +# Alternatively, the contents of this file may be used under the terms of +# either of the GNU General Public License Version 2 or later (the "GPL"), +# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +DEPTH = ../../../.. +topsrcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ + +include $(DEPTH)/config/autoconf.mk + +MODULE = test_harness_commandlines + +XPCSHELL_TESTS = \ + unit \ + $(NULL) + +include $(topsrcdir)/config/rules.mk diff --git a/mozilla/toolkit/components/commandlines/test/unit/test_classinfo.js b/mozilla/toolkit/components/commandlines/test/unit/test_classinfo.js new file mode 100644 index 00000000000..f20c8354185 --- /dev/null +++ b/mozilla/toolkit/components/commandlines/test/unit/test_classinfo.js @@ -0,0 +1,41 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Command Line tests. + * + * The Initial Developer of the Original Code is + * Alexander J. Vincent . + * Portions created by the Initial Developer are Copyright (C) 2007 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +function run_test() { + var clClass = Components.classes["@mozilla.org/toolkit/command-line;1"]; + var commandLine = clClass.createInstance(); + do_check_true("length" in commandLine); +}