зеркало из https://github.com/mozilla/pjs.git
Bug 371052 - Implement nsIClassInfo on nsCommandLine
p=Alex Vincent <ajvincent@gmail.com> r=bsmedberg
This commit is contained in:
Родитель
4d80df843c
Коммит
a5d8a2cf1e
|
@ -45,6 +45,7 @@ include $(DEPTH)/config/autoconf.mk
|
|||
DIRS = \
|
||||
public \
|
||||
src \
|
||||
test \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -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
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -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 <bzbarsky@mit.edu> (Original author)
|
||||
# Jeff Walden <jwalden+code@mit.edu>
|
||||
#
|
||||
# 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
|
|
@ -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 <ajvincent@gmail.com>.
|
||||
* 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);
|
||||
}
|
Загрузка…
Ссылка в новой задаче