Get the plugin into the build and some extra work for instrumenting printing testing
Bug 164072 rs=kin r=dcone git-svn-id: svn://10.0.0.236/trunk@128756 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
@@ -18,15 +17,16 @@
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
DEPTH=..\..\..
|
||||
DEPTH = ../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
EXPORTS = \
|
||||
nsDebugCIID.h \
|
||||
$(NULL)
|
||||
DIRS += public src idl plugin
|
||||
|
||||
MODULE=debug
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
#
|
||||
# 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/NPL/
|
||||
#
|
||||
# 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 Netscape
|
||||
@@ -18,10 +17,20 @@
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
DEPTH=..\..
|
||||
DEPTH = ../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
DIRS= public src \
|
||||
idl
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
MODULE = debug
|
||||
DEFINES=-D_IMPL_NS_UI
|
||||
|
||||
XPIDLSRCS = \
|
||||
nsIDebugObject.idl \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
@@ -65,6 +65,27 @@ interface nsIDebugObject : nsISupports
|
||||
*/
|
||||
void CompareFrameModels(in wstring aBasePath,in wstring aVerPath,in wstring aBaseFile,in wstring aVerFile, in unsigned long aFlags);
|
||||
|
||||
|
||||
/**
|
||||
* Printing Runtime Error Checking
|
||||
*/
|
||||
const short PRT_RUNTIME_NONE = 0;
|
||||
const short PRT_RUNTIME_CHECKFORPRINTERS = 1;
|
||||
const short PRT_RUNTIME_CREATEPRTSESSION = 2;
|
||||
const short PRT_RUNTIME_INITPRTOBJ = 3;
|
||||
const short PRT_RUNTIME_CREATESPECFACTORY = 4;
|
||||
const short PRT_RUNTIME_NOPROMPTSERVICE = 5;
|
||||
const short PRT_RUNTIME_NODEVSPEC = 6;
|
||||
const short PRT_RUNTIME_NEXTPAGE = 7;
|
||||
const short PRT_RUNTIME_REFLOWDOCLIST = 8;
|
||||
const short PRT_RUNTIME_PREPAREDOC = 9;
|
||||
const short PRT_RUNTIME_BEGINDOC = 10;
|
||||
|
||||
attribute boolean doRuntimeTests; // indicates whether the runtime test will be run
|
||||
attribute short testId; // id of test to run
|
||||
attribute boolean printAsIs; // print asis when printing to a file
|
||||
attribute wstring printFileName; // name of output file
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
98
mozilla/extensions/layout-debug/plugin/Makefile.in
Normal file
98
mozilla/extensions/layout-debug/plugin/Makefile.in
Normal file
@@ -0,0 +1,98 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape 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/NPL/
|
||||
#
|
||||
# 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 Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
DEPTH = ../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = npdebug
|
||||
LIBRARY_NAME = npdebug
|
||||
RESFILE = npdebug.res
|
||||
DEFFILE = npdebug.def
|
||||
|
||||
REQUIRES= xpcom \
|
||||
dom \
|
||||
necko\
|
||||
string \
|
||||
widget \
|
||||
locale \
|
||||
view \
|
||||
pref \
|
||||
gfx2 \
|
||||
imglib2 \
|
||||
unicharutil \
|
||||
java \
|
||||
debug \
|
||||
plugin \
|
||||
$(NULL)
|
||||
|
||||
# plugins should always be shared, even in the "static" build
|
||||
FORCE_SHARED_LIB = 1
|
||||
|
||||
# Force use of PIC
|
||||
FORCE_USE_PIC = 1
|
||||
|
||||
NO_DIST_INSTALL = 1
|
||||
NO_INSTALL = 1
|
||||
|
||||
|
||||
XPIDLSRCS = nsIDebugPlugin.idl
|
||||
|
||||
CPPSRCS = plugin.cpp \
|
||||
nsScriptablePeer.cpp \
|
||||
np_entry.cpp \
|
||||
npn_gate.cpp \
|
||||
npp_gate.cpp \
|
||||
$(NULL)
|
||||
|
||||
LOCAL_INCLUDES = -I$(XPIDL_GEN_DIR) -I./include
|
||||
|
||||
EXTRA_DSO_LDOPTS += \
|
||||
-L$(DIST)/lib \
|
||||
$(MOZ_COMPONENT_XPCOM_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
CXXFLAGS += $(MOZ_TOOLKIT_REGISTRY_CFLAGS) $(MOZ_GTK_CFLAGS)
|
||||
|
||||
clobber::
|
||||
$(RM) *.sbr
|
||||
$(RM) $(XPDIST)\idl\nsIDebugPlugin.idl
|
||||
$(RM) $(XPDIST)\include\nsIDebugPlugin.h
|
||||
$(RM) $(DIST)\bin\plugins\$(LIBRARY_NAME).xpt
|
||||
$(RM) $(DIST)\bin\plugins\$(SHARED_LIBRARY)
|
||||
|
||||
install-plugin: $(SHARED_LIBRARY)
|
||||
ifdef SHARED_LIBRARY
|
||||
$(INSTALL) $(XPIDL_GEN_DIR)/$(LIBRARY_NAME).xpt $(DIST)/bin/plugins
|
||||
$(INSTALL) $(SHARED_LIBRARY) $(DIST)/bin/plugins
|
||||
endif
|
||||
|
||||
libs:: install-plugin
|
||||
|
||||
install:: $(SHARED_LIBRARY)
|
||||
ifdef SHARED_LIBRARY
|
||||
$(SYSINSTALL) $(IFLAGS2) $< $(DESTDIR)$(mozappdir)/plugins
|
||||
endif
|
||||
@@ -1,61 +0,0 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape 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/NPL/
|
||||
#
|
||||
# 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 Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
DEPTH=..\..\..\..
|
||||
|
||||
REQUIRES= xpcom \
|
||||
dom \
|
||||
necko\
|
||||
string \
|
||||
widget \
|
||||
locale \
|
||||
view \
|
||||
pref \
|
||||
gfx2 \
|
||||
imglib2 \
|
||||
unicharutil \
|
||||
java \
|
||||
debug \
|
||||
plugin \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\config.mak>
|
||||
|
||||
MAKE_OBJ_TYPE = LIB
|
||||
LIBRARY_NAME = plugingate
|
||||
LIB=.\$(OBJDIR)\$(LIBRARY_NAME).lib
|
||||
|
||||
CFLAGS = $(CFLAGS) -I..\include -I..\..\include
|
||||
|
||||
OBJS = \
|
||||
.\$(OBJDIR)\npn_gate.obj \
|
||||
.\$(OBJDIR)\npp_gate.obj \
|
||||
.\$(OBJDIR)\np_entry.obj \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
# it will export the lib to the dist/lib dir, so do not forget to remove it
|
||||
libs:: $(LIB)
|
||||
$(RM) $(DIST)\lib\$(LIBRARY_NAME).lib
|
||||
|
||||
clobber::
|
||||
$(RM) *.sbr
|
||||
@@ -1,7 +0,0 @@
|
||||
|
||||
|
||||
..\..\..\dist\WIN32_D.obj\bin\xpidl -m header -I idl nsIDebugPlugin.idl
|
||||
|
||||
|
||||
|
||||
..\..\..\dist\WIN32_D.obj\bin\xpidl -m typelib -I idl nsIDebugPlugin.idl
|
||||
@@ -1,80 +0,0 @@
|
||||
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape 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/NPL/
|
||||
*
|
||||
* 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
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* 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 NPL, 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 NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/**
|
||||
* The mother of all xpcom interfaces.
|
||||
* @status FROZEN
|
||||
*/
|
||||
|
||||
/* In order to get both the right typelib and the right header we force
|
||||
* the 'real' output from xpidl to be commentout out in the generated header
|
||||
* and includes a copy of the original nsISupports.h. This is all just to deal
|
||||
* with the Mac specific ": public __comobject" thing.
|
||||
*/
|
||||
|
||||
#include "nsrootidl.idl"
|
||||
|
||||
%{C++
|
||||
/*
|
||||
* Start commenting out the C++ versions of the below in the output header
|
||||
*/
|
||||
#if 0
|
||||
%}
|
||||
|
||||
[scriptable, uuid(00000000-0000-0000-c000-000000000046)]
|
||||
interface nsISupports {
|
||||
void QueryInterface(in nsIIDRef uuid,
|
||||
[iid_is(uuid),retval] out nsQIResult result);
|
||||
[noscript, notxpcom] nsrefcnt AddRef();
|
||||
[noscript, notxpcom] nsrefcnt Release();
|
||||
};
|
||||
|
||||
%{C++
|
||||
/*
|
||||
* End commenting out the C++ versions of the above in the output header
|
||||
*/
|
||||
#endif
|
||||
%}
|
||||
|
||||
|
||||
%{C++
|
||||
#include "nsISupportsBase.h"
|
||||
|
||||
#ifndef MOZILLA_STRICT_API
|
||||
#include "nsISupportsUtils.h"
|
||||
#endif
|
||||
%}
|
||||
@@ -1,114 +0,0 @@
|
||||
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape 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/NPL/
|
||||
*
|
||||
* 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
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Dan Rosen <dr@netscape.com>
|
||||
*
|
||||
* 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 NPL, 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 NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/**
|
||||
* Root idl declarations to be used by all.
|
||||
* @status FROZEN
|
||||
*/
|
||||
|
||||
%{C++
|
||||
|
||||
#include "nscore.h"
|
||||
#include "prtime.h"
|
||||
|
||||
/*
|
||||
* Start commenting out the C++ versions of the below in the output header
|
||||
*/
|
||||
#if 0
|
||||
%}
|
||||
|
||||
typedef boolean PRBool ;
|
||||
typedef octet PRUint8 ;
|
||||
typedef unsigned short PRUint16 ;
|
||||
typedef unsigned short PRUnichar;
|
||||
typedef unsigned long PRUint32 ;
|
||||
typedef unsigned long long PRUint64 ;
|
||||
typedef unsigned long long PRTime ;
|
||||
typedef short PRInt16 ;
|
||||
typedef long PRInt32 ;
|
||||
typedef long long PRInt64 ;
|
||||
|
||||
typedef unsigned long nsrefcnt ;
|
||||
typedef unsigned long nsresult ;
|
||||
|
||||
// XXX need this built into xpidl compiler so that it's really size_t or PRSize
|
||||
// and it's scriptable:
|
||||
typedef unsigned long size_t;
|
||||
|
||||
[ptr] native voidPtr(void);
|
||||
[ptr] native charPtr(char);
|
||||
[ptr] native unicharPtr(PRUnichar);
|
||||
|
||||
[ref, nsid] native nsIDRef(nsID);
|
||||
[ref, nsid] native nsIIDRef(nsIID);
|
||||
[ref, nsid] native nsCIDRef(nsCID);
|
||||
|
||||
[ptr, nsid] native nsIDPtr(nsID);
|
||||
[ptr, nsid] native nsIIDPtr(nsIID);
|
||||
[ptr, nsid] native nsCIDPtr(nsCID);
|
||||
|
||||
// NOTE: Be careful in using the following 3 types. The *Ref and *Ptr variants
|
||||
// are more commonly used (and better supported). Those variants require
|
||||
// nsMemory alloc'd copies when used as 'out' params while these types do not.
|
||||
// However, currently these types can not be used for 'in' params. And, methods
|
||||
// that use them as 'out' params *must* be declared [notxpcom] (with an explicit
|
||||
// return type of nsresult). This makes such methods implicitly not scriptable.
|
||||
// Use of these types in methods without a [notxpcom] declaration will cause
|
||||
// the xpidl compiler to raise an error.
|
||||
// See: http://bugzilla.mozilla.org/show_bug.cgi?id=93792
|
||||
|
||||
[nsid] native nsIID(nsIID);
|
||||
[nsid] native nsID(nsID);
|
||||
[nsid] native nsCID(nsCID);
|
||||
|
||||
[ptr] native nsQIResult(void);
|
||||
|
||||
[ref, domstring] native DOMString(ignored);
|
||||
[ref, domstring] native DOMStringRef(ignored);
|
||||
[ptr, domstring] native DOMStringPtr(ignored);
|
||||
|
||||
[ref, domstring] native AString(ignored);
|
||||
[ref, domstring] native AStringRef(ignored);
|
||||
[ptr, domstring] native AStringPtr(ignored);
|
||||
|
||||
%{C++
|
||||
/*
|
||||
* End commenting out the C++ versions of the above in the output header
|
||||
*/
|
||||
#endif
|
||||
%}
|
||||
@@ -1,85 +0,0 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape 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/NPL/
|
||||
#
|
||||
# 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 Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
DEPTH=..\..\..
|
||||
MODULE = npdebug
|
||||
REQUIRES= xpcom \
|
||||
dom \
|
||||
necko\
|
||||
string \
|
||||
widget \
|
||||
locale \
|
||||
view \
|
||||
pref \
|
||||
gfx2 \
|
||||
imglib2 \
|
||||
unicharutil \
|
||||
java \
|
||||
debug \
|
||||
plugin \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\config.mak>
|
||||
|
||||
|
||||
|
||||
|
||||
XPIDLSRCS = \
|
||||
.\nsIDebugPlugin.idl \
|
||||
$(NULL)
|
||||
|
||||
MAKE_OBJ_TYPE = DLL
|
||||
DLLNAME = npdebug
|
||||
RESFILE = npdebug.res
|
||||
DEFFILE = npdebug.def
|
||||
DLL=.\$(OBJDIR)\$(DLLNAME).dll
|
||||
|
||||
CFLAGS = $(CFLAGS) -I.\include
|
||||
|
||||
|
||||
OBJS = \
|
||||
.\$(OBJDIR)\plugin.obj \
|
||||
.\$(OBJDIR)\nsScriptablePeer.obj \
|
||||
$(NULL)
|
||||
|
||||
LLIBS = \
|
||||
.\common\$(OBJDIR)\plugingate.lib \
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
$(NULL)
|
||||
|
||||
WIN_LIBS = version.lib
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
# don't forget to remove files exported by default
|
||||
libs:: $(DLL)
|
||||
$(RM) $(XPDIST)\idl\nsIDebugPlugin.idl
|
||||
$(RM) $(XPDIST)\include\nsIDebugPlugin.h
|
||||
# $(RM) $(DIST)\bin\components\$(DLLNAME).xpt
|
||||
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(DIST)\bin\plugins
|
||||
|
||||
|
||||
clobber::
|
||||
$(RM) *.sbr
|
||||
$(RM) $(XPDIST)\idl\nsIDebugPlugin.idl
|
||||
$(RM) $(XPDIST)\include\nsIDebugPlugin.h
|
||||
$(RM) $(DIST)\bin\components\$(DLLNAME).xpt
|
||||
$(RM) $(DIST)\bin\plugins\$(DLLNAME).dll
|
||||
@@ -1,4 +1,4 @@
|
||||
LIBRARY NPSIMPLE
|
||||
LIBRARY npdebug
|
||||
|
||||
EXPORTS
|
||||
NP_GetEntryPoints @1
|
||||
|
||||
@@ -46,15 +46,15 @@ BEGIN
|
||||
BEGIN
|
||||
VALUE "Comments", "\0"
|
||||
VALUE "CompanyName", " \0"
|
||||
VALUE "FileDescription", "npdebug\0"
|
||||
VALUE "FileDescription", "Debugger Plug-in\0"
|
||||
VALUE "FileExtents", "spl\0"
|
||||
VALUE "FileOpenName", "npdebug\0"
|
||||
VALUE "FileOpenName", "Layout Debug Plug-in (*.*)\0"
|
||||
VALUE "FileVersion", "1, 0, 0, 1\0"
|
||||
VALUE "InternalName", "npdebug\0"
|
||||
VALUE "LegalCopyright", "Copyright © 2002\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
VALUE "MIMEType", "application/debug-plugin\0"
|
||||
VALUE "OriginalFilename", "npsimple.dll\0"
|
||||
VALUE "OriginalFilename", "npdebug.dll\0"
|
||||
VALUE "PrivateBuild", "\0"
|
||||
VALUE "ProductName", "Debug Example Plugin for Mozilla\0"
|
||||
VALUE "ProductVersion", "1, 0, 0, 1\0"
|
||||
|
||||
@@ -1,146 +0,0 @@
|
||||
/*
|
||||
* DO NOT EDIT. THIS FILE IS GENERATED FROM nsIDebugPlugin.idl
|
||||
*/
|
||||
|
||||
#ifndef __gen_nsIDebugPlugin_h__
|
||||
#define __gen_nsIDebugPlugin_h__
|
||||
|
||||
|
||||
#ifndef __gen_nsISupports_h__
|
||||
#include "nsISupports.h"
|
||||
#endif
|
||||
|
||||
/* For IDL files that don't want to include root IDL files. */
|
||||
#ifndef NS_NO_VTABLE
|
||||
#define NS_NO_VTABLE
|
||||
#endif
|
||||
|
||||
/* starting interface: nsIDebugPlugin */
|
||||
#define NS_IDEBUGPLUGIN_IID_STR "482e1890-1fe5-11d5-9cf8-0060b0fbd8ac"
|
||||
|
||||
#define NS_IDEBUGPLUGIN_IID \
|
||||
{0x482e1890, 0x1fe5, 0x11d5, \
|
||||
{ 0x9c, 0xf8, 0x00, 0x60, 0xb0, 0xfb, 0xd8, 0xac }}
|
||||
|
||||
class NS_NO_VTABLE nsIDebugPlugin : public nsISupports {
|
||||
public:
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IDEBUGPLUGIN_IID)
|
||||
|
||||
/* readonly attribute string version; */
|
||||
NS_IMETHOD GetVersion(char * *aVersion) = 0;
|
||||
|
||||
/* void CreateDirectory (in wstring aDirPath, in unsigned long aFlags, [retval] out long aResult); */
|
||||
NS_IMETHOD CreateDirectory(const PRUnichar *aDirPath, PRUint32 aFlags, PRInt32 *aResult) = 0;
|
||||
|
||||
/* void DumpLayout (in nsISupports aWindow, in wstring aFilePath, in wstring aFileName, in unsigned long aFlags, [retval] out long aResult); */
|
||||
NS_IMETHOD DumpLayout(nsISupports *aWindow, const PRUnichar *aFilePath, const PRUnichar *aFileName, PRUint32 aFlags, PRInt32 *aResult) = 0;
|
||||
|
||||
/* void StartDirectorySearch (in string aFilePath); */
|
||||
NS_IMETHOD StartDirectorySearch(const char *aFilePath) = 0;
|
||||
|
||||
/* void GetNextFileInDirectory ([retval] out string aFileName); */
|
||||
NS_IMETHOD GetNextFileInDirectory(char **aFileName) = 0;
|
||||
|
||||
/* void CompareLayoutFiles (in wstring aBasePath, in wstring aVerPath, in wstring aBaseFile, in wstring aVerFile, in unsigned long aFlags, [retval] out long aResult); */
|
||||
NS_IMETHOD CompareLayoutFiles(const PRUnichar *aBasePath, const PRUnichar *aVerPath, const PRUnichar *aBaseFile, const PRUnichar *aVerFile, PRUint32 aFlags, PRInt32 *aResult) = 0;
|
||||
|
||||
};
|
||||
|
||||
/* Use this macro when declaring classes that implement this interface. */
|
||||
#define NS_DECL_NSIDEBUGPLUGIN \
|
||||
NS_IMETHOD GetVersion(char * *aVersion); \
|
||||
NS_IMETHOD CreateDirectory(const PRUnichar *aDirPath, PRUint32 aFlags, PRInt32 *aResult); \
|
||||
NS_IMETHOD DumpLayout(nsISupports *aWindow, const PRUnichar *aFilePath, const PRUnichar *aFileName, PRUint32 aFlags, PRInt32 *aResult); \
|
||||
NS_IMETHOD StartDirectorySearch(const char *aFilePath); \
|
||||
NS_IMETHOD GetNextFileInDirectory(char **aFileName); \
|
||||
NS_IMETHOD CompareLayoutFiles(const PRUnichar *aBasePath, const PRUnichar *aVerPath, const PRUnichar *aBaseFile, const PRUnichar *aVerFile, PRUint32 aFlags, PRInt32 *aResult);
|
||||
|
||||
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
|
||||
#define NS_FORWARD_NSIDEBUGPLUGIN(_to) \
|
||||
NS_IMETHOD GetVersion(char * *aVersion) { return _to GetVersion(aVersion); } \
|
||||
NS_IMETHOD CreateDirectory(const PRUnichar *aDirPath, PRUint32 aFlags, PRInt32 *aResult) { return _to CreateDirectory(aDirPath, aFlags, aResult); } \
|
||||
NS_IMETHOD DumpLayout(nsISupports *aWindow, const PRUnichar *aFilePath, const PRUnichar *aFileName, PRUint32 aFlags, PRInt32 *aResult) { return _to DumpLayout(aWindow, aFilePath, aFileName, aFlags, aResult); } \
|
||||
NS_IMETHOD StartDirectorySearch(const char *aFilePath) { return _to StartDirectorySearch(aFilePath); } \
|
||||
NS_IMETHOD GetNextFileInDirectory(char **aFileName) { return _to GetNextFileInDirectory(aFileName); } \
|
||||
NS_IMETHOD CompareLayoutFiles(const PRUnichar *aBasePath, const PRUnichar *aVerPath, const PRUnichar *aBaseFile, const PRUnichar *aVerFile, PRUint32 aFlags, PRInt32 *aResult) { return _to CompareLayoutFiles(aBasePath, aVerPath, aBaseFile, aVerFile, aFlags, aResult); }
|
||||
|
||||
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
|
||||
#define NS_FORWARD_SAFE_NSIDEBUGPLUGIN(_to) \
|
||||
NS_IMETHOD GetVersion(char * *aVersion) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetVersion(aVersion); } \
|
||||
NS_IMETHOD CreateDirectory(const PRUnichar *aDirPath, PRUint32 aFlags, PRInt32 *aResult) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateDirectory(aDirPath, aFlags, aResult); } \
|
||||
NS_IMETHOD DumpLayout(nsISupports *aWindow, const PRUnichar *aFilePath, const PRUnichar *aFileName, PRUint32 aFlags, PRInt32 *aResult) { return !_to ? NS_ERROR_NULL_POINTER : _to->DumpLayout(aWindow, aFilePath, aFileName, aFlags, aResult); } \
|
||||
NS_IMETHOD StartDirectorySearch(const char *aFilePath) { return !_to ? NS_ERROR_NULL_POINTER : _to->StartDirectorySearch(aFilePath); } \
|
||||
NS_IMETHOD GetNextFileInDirectory(char **aFileName) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetNextFileInDirectory(aFileName); } \
|
||||
NS_IMETHOD CompareLayoutFiles(const PRUnichar *aBasePath, const PRUnichar *aVerPath, const PRUnichar *aBaseFile, const PRUnichar *aVerFile, PRUint32 aFlags, PRInt32 *aResult) { return !_to ? NS_ERROR_NULL_POINTER : _to->CompareLayoutFiles(aBasePath, aVerPath, aBaseFile, aVerFile, aFlags, aResult); }
|
||||
|
||||
#if 0
|
||||
/* Use the code below as a template for the implementation class for this interface. */
|
||||
|
||||
/* Header file */
|
||||
class nsDebugPlugin : public nsIDebugPlugin
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIDEBUGPLUGIN
|
||||
|
||||
nsDebugPlugin();
|
||||
virtual ~nsDebugPlugin();
|
||||
/* additional members */
|
||||
};
|
||||
|
||||
/* Implementation file */
|
||||
NS_IMPL_ISUPPORTS1(nsDebugPlugin, nsIDebugPlugin)
|
||||
|
||||
nsDebugPlugin::nsDebugPlugin()
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
/* member initializers and constructor code */
|
||||
}
|
||||
|
||||
nsDebugPlugin::~nsDebugPlugin()
|
||||
{
|
||||
/* destructor code */
|
||||
}
|
||||
|
||||
/* readonly attribute string version; */
|
||||
NS_IMETHODIMP nsDebugPlugin::GetVersion(char * *aVersion)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* void CreateDirectory (in wstring aDirPath, in unsigned long aFlags, [retval] out long aResult); */
|
||||
NS_IMETHODIMP nsDebugPlugin::CreateDirectory(const PRUnichar *aDirPath, PRUint32 aFlags, PRInt32 *aResult)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* void DumpLayout (in nsISupports aWindow, in wstring aFilePath, in wstring aFileName, in unsigned long aFlags, [retval] out long aResult); */
|
||||
NS_IMETHODIMP nsDebugPlugin::DumpLayout(nsISupports *aWindow, const PRUnichar *aFilePath, const PRUnichar *aFileName, PRUint32 aFlags, PRInt32 *aResult)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* void StartDirectorySearch (in string aFilePath); */
|
||||
NS_IMETHODIMP nsDebugPlugin::StartDirectorySearch(const char *aFilePath)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* void GetNextFileInDirectory ([retval] out string aFileName); */
|
||||
NS_IMETHODIMP nsDebugPlugin::GetNextFileInDirectory(char **aFileName)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* void CompareLayoutFiles (in wstring aBasePath, in wstring aVerPath, in wstring aBaseFile, in wstring aVerFile, in unsigned long aFlags, [retval] out long aResult); */
|
||||
NS_IMETHODIMP nsDebugPlugin::CompareLayoutFiles(const PRUnichar *aBasePath, const PRUnichar *aVerPath, const PRUnichar *aBaseFile, const PRUnichar *aVerFile, PRUint32 aFlags, PRInt32 *aResult)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* End of implementation class template. */
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __gen_nsIDebugPlugin_h__ */
|
||||
@@ -30,5 +30,28 @@ interface nsIDebugPlugin : nsISupports {
|
||||
void StartDirectorySearch(in string aFilePath);
|
||||
void GetNextFileInDirectory([retval] out string aFileName);
|
||||
void CompareLayoutFiles(in wstring aBasePath,in wstring aVerPath,in wstring aBaseFile,in wstring aVerFile,in unsigned long aFlags,[retval] out long aResult);
|
||||
void PluginShutdown();
|
||||
|
||||
/**
|
||||
* Printing Runtime Error Checking
|
||||
*/
|
||||
const short PRT_RUNTIME_NONE = 0;
|
||||
const short PRT_RUNTIME_CHECKFORPRINTERS = 1;
|
||||
const short PRT_RUNTIME_CREATEPRTSESSION = 2;
|
||||
const short PRT_RUNTIME_INITPRTOBJ = 3;
|
||||
const short PRT_RUNTIME_CREATESPECFACTORY = 4;
|
||||
const short PRT_RUNTIME_NOPROMPTSERVICE = 5;
|
||||
const short PRT_RUNTIME_NODEVSPEC = 6;
|
||||
const short PRT_RUNTIME_NEXTPAGE = 7;
|
||||
const short PRT_RUNTIME_REFLOWDOCLIST = 8;
|
||||
const short PRT_RUNTIME_PREPAREDOC = 9;
|
||||
const short PRT_RUNTIME_BEGINDOC = 10;
|
||||
|
||||
attribute boolean doRuntimeTests; // indicates whether the runtime test will be run
|
||||
attribute short testId; // id of test to run
|
||||
attribute boolean printAsIs; // print asis when printing to a file
|
||||
attribute wstring printFileName; // name of output file
|
||||
|
||||
void SetBoolPref(in wstring aPrefName, in boolean aVal);
|
||||
|
||||
};
|
||||
|
||||
@@ -53,31 +53,16 @@ static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
|
||||
nsScriptablePeer::nsScriptablePeer(nsPluginInstance* aPlugin)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
mPlugin = aPlugin;
|
||||
mRefCnt = 0;
|
||||
}
|
||||
|
||||
nsScriptablePeer::~nsScriptablePeer()
|
||||
{
|
||||
}
|
||||
|
||||
// AddRef, Release and QueryInterface are common methods and must
|
||||
// be implemented for any interface
|
||||
NS_IMETHODIMP_(nsrefcnt) nsScriptablePeer::AddRef()
|
||||
{
|
||||
++mRefCnt;
|
||||
return mRefCnt;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP_(nsrefcnt) nsScriptablePeer::Release()
|
||||
{
|
||||
--mRefCnt;
|
||||
if (mRefCnt == 0) {
|
||||
delete this;
|
||||
return 0;
|
||||
}
|
||||
return mRefCnt;
|
||||
}
|
||||
NS_IMPL_ADDREF(nsScriptablePeer)
|
||||
NS_IMPL_RELEASE(nsScriptablePeer)
|
||||
|
||||
// here nsScriptablePeer should return three interfaces it can be asked for by their iid's
|
||||
// static casts are necessary to ensure that correct pointer is returned
|
||||
@@ -113,24 +98,21 @@ NS_IMETHODIMP nsScriptablePeer::QueryInterface(const nsIID& aIID, void** aInstan
|
||||
NS_IMETHODIMP nsScriptablePeer::GetVersion(char * *aVersion)
|
||||
{
|
||||
if (mPlugin)
|
||||
mPlugin->getVersion(aVersion);
|
||||
mPlugin->GetVersion(aVersion);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsScriptablePeer::CreateDirectory(const PRUnichar *aFilePath,PRUint32 aFlags, PRInt32 *aResult)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
PRBool retVal;
|
||||
|
||||
if ( mPlugin ) {
|
||||
mPlugin->CreateDirectory(aFilePath,aFlags,&retVal);
|
||||
return mPlugin->CreateDirectory(aFilePath,aFlags,&retVal);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
NS_IMETHODIMP nsScriptablePeer::DumpLayout(nsISupports *aWindow, const PRUnichar *aFilePath, const PRUnichar *aFileName,
|
||||
PRUint32 aFlags, PRInt32 *aResult)
|
||||
{
|
||||
@@ -174,7 +156,7 @@ NS_IMETHODIMP nsScriptablePeer::StartDirectorySearch(const char *aFilePath)
|
||||
{
|
||||
|
||||
if (mPlugin)
|
||||
mPlugin->StartDirectorySearch(aFilePath);
|
||||
return mPlugin->StartDirectorySearch(aFilePath);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@@ -184,8 +166,85 @@ NS_IMETHODIMP nsScriptablePeer::GetNextFileInDirectory(char **aFilePath)
|
||||
{
|
||||
|
||||
if (mPlugin)
|
||||
mPlugin->GetNextFileInDirectory(aFilePath);
|
||||
|
||||
return mPlugin->GetNextFileInDirectory(aFilePath);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsScriptablePeer::SetBoolPref(const PRUnichar *aPrefName, PRBool aVal)
|
||||
{
|
||||
if (mPlugin)
|
||||
return mPlugin->SetBoolPref(aPrefName, aVal);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* attribute boolean doRuntimeTests; */
|
||||
NS_IMETHODIMP
|
||||
nsScriptablePeer::GetDoRuntimeTests(PRBool *aDoRuntimeTests)
|
||||
{
|
||||
if (mPlugin)
|
||||
return mPlugin->GetDoRuntimeTests(aDoRuntimeTests);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
NS_IMETHODIMP
|
||||
nsScriptablePeer::SetDoRuntimeTests(PRBool aDoRuntimeTests)
|
||||
{
|
||||
if (mPlugin)
|
||||
return mPlugin->SetDoRuntimeTests(aDoRuntimeTests);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* attribute short testId; */
|
||||
NS_IMETHODIMP
|
||||
nsScriptablePeer::GetTestId(PRInt16 *aTestId)
|
||||
{
|
||||
if (mPlugin)
|
||||
return mPlugin->GetTestId(aTestId);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
NS_IMETHODIMP
|
||||
nsScriptablePeer::SetTestId(PRInt16 aTestId)
|
||||
{
|
||||
if (mPlugin)
|
||||
return mPlugin->SetTestId(aTestId);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* attribute boolean printAsIs; */
|
||||
NS_IMETHODIMP
|
||||
nsScriptablePeer::GetPrintAsIs(PRBool *aPrintAsIs)
|
||||
{
|
||||
if (mPlugin)
|
||||
return mPlugin->GetPrintAsIs(aPrintAsIs);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
NS_IMETHODIMP
|
||||
nsScriptablePeer::SetPrintAsIs(PRBool aPrintAsIs)
|
||||
{
|
||||
if (mPlugin)
|
||||
return mPlugin->SetPrintAsIs(aPrintAsIs);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* attribute wstring printFileName; */
|
||||
NS_IMETHODIMP nsScriptablePeer::GetPrintFileName(PRUnichar * *aPrintFileName)
|
||||
{
|
||||
if (mPlugin)
|
||||
return mPlugin->GetPrintFileName(aPrintFileName);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
NS_IMETHODIMP nsScriptablePeer::SetPrintFileName(const PRUnichar * aPrintFileName)
|
||||
{
|
||||
if (mPlugin)
|
||||
return mPlugin->SetPrintFileName(aPrintFileName);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* void PluginShutdown (); */
|
||||
NS_IMETHODIMP nsScriptablePeer::PluginShutdown()
|
||||
{
|
||||
mPlugin = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -86,16 +86,7 @@ public:
|
||||
~nsScriptablePeer();
|
||||
|
||||
public:
|
||||
// methods from nsISupports
|
||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
NS_IMETHOD_(nsrefcnt) AddRef();
|
||||
NS_IMETHOD_(nsrefcnt) Release();
|
||||
|
||||
protected:
|
||||
nsrefcnt mRefCnt;
|
||||
|
||||
public:
|
||||
// native methods callable from JavaScript
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIDEBUGPLUGIN
|
||||
|
||||
protected:
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#include "nsMemory.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsString.h"
|
||||
#include "nsIPref.h"
|
||||
|
||||
// service manager which will give the access to all public browser services
|
||||
// we will use memory service as an illustration
|
||||
@@ -56,8 +57,8 @@ nsIServiceManager * gServiceManager = NULL;
|
||||
// Unix needs this
|
||||
#ifdef XP_UNIX
|
||||
#define MIME_TYPES_HANDLED "application/debug-plugin"
|
||||
#define PLUGIN_NAME "Debug Plugin"
|
||||
#define PLUGIN_DESCRIPTION "Debug Plugin"
|
||||
#define PLUGIN_NAME "Layout Debug Plugin"
|
||||
#define PLUGIN_DESCRIPTION "Layout Debug Plugin"
|
||||
|
||||
char* NPP_GetMIMEDescription(void)
|
||||
{
|
||||
@@ -103,6 +104,9 @@ nsPluginInstanceBase * NS_NewPluginInstance(nsPluginCreateData * aCreateDataStru
|
||||
return NULL;
|
||||
|
||||
nsPluginInstance * plugin = new nsPluginInstance(aCreateDataStruct->instance);
|
||||
if (plugin) {
|
||||
plugin->init(nsnull);
|
||||
}
|
||||
return plugin;
|
||||
}
|
||||
|
||||
@@ -131,15 +135,21 @@ nsPluginInstance::~nsPluginInstance()
|
||||
|
||||
NPBool nsPluginInstance::init(NPWindow* aWindow)
|
||||
{
|
||||
mDebugObj = do_GetService("@mozilla.org/debug/debugobject;1");
|
||||
|
||||
if(aWindow == NULL)
|
||||
return FALSE;
|
||||
|
||||
mInitialized = TRUE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void nsPluginInstance::shut()
|
||||
{
|
||||
mScriptablePeer->PluginShutdown();
|
||||
|
||||
mDebugObj = nsnull;
|
||||
mInitialized = FALSE;
|
||||
}
|
||||
|
||||
@@ -148,7 +158,8 @@ NPBool nsPluginInstance::isInitialized()
|
||||
return mInitialized;
|
||||
}
|
||||
|
||||
void nsPluginInstance::getVersion(char* *aVersion)
|
||||
NS_IMETHODIMP
|
||||
nsPluginInstance::GetVersion(char * *aVersion)
|
||||
{
|
||||
const char *ua = NPN_UserAgent(mInstance);
|
||||
char*& version = *aVersion;
|
||||
@@ -171,86 +182,76 @@ void nsPluginInstance::getVersion(char* *aVersion)
|
||||
|
||||
// release service
|
||||
NS_IF_RELEASE(nsMemoryService);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------
|
||||
|
||||
void nsPluginInstance::OutPutLayoutFrames(nsISupports *aWindow, const PRUnichar *aFilePath, const PRUnichar *aFileName, PRUint32 aFlags , PRInt32 *aRetVal)
|
||||
void
|
||||
nsPluginInstance::OutPutLayoutFrames(nsISupports *aWindow, const PRUnichar *aFilePath, const PRUnichar *aFileName, PRUint32 aFlags , PRInt32 *aRetVal)
|
||||
{
|
||||
nsIDebugObject *theDebugObject=NULL;
|
||||
|
||||
*aRetVal = NS_ERROR_FAILURE;
|
||||
|
||||
if (gServiceManager) {
|
||||
// get service using its contract id and use it to allocate the memory
|
||||
gServiceManager->GetServiceByContractID("@mozilla.org/debug/debugobject;1", NS_GET_IID(nsIDebugObject), (void **)&theDebugObject);
|
||||
if(theDebugObject){
|
||||
*aRetVal = theDebugObject->DumpContent(aWindow,aFilePath,aFileName,aFlags);
|
||||
}
|
||||
if(mDebugObj){
|
||||
*aRetVal = mDebugObj->DumpContent(aWindow,aFilePath,aFileName,aFlags);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------
|
||||
|
||||
void nsPluginInstance::CreateDirectory(const PRUnichar *aBasePath, PRUint32 aFlags, PRInt32 *aRetVal)
|
||||
NS_IMETHODIMP
|
||||
nsPluginInstance::CreateDirectory(const PRUnichar *aBasePath, PRUint32 aFlags, PRInt32 *aRetVal)
|
||||
{
|
||||
nsIDebugObject *theDebugObject=NULL;
|
||||
|
||||
*aRetVal = NS_ERROR_FAILURE;
|
||||
|
||||
if (gServiceManager) {
|
||||
// get service using its contract id and use it to allocate the memory
|
||||
gServiceManager->GetServiceByContractID("@mozilla.org/debug/debugobject;1", NS_GET_IID(nsIDebugObject), (void **)&theDebugObject);
|
||||
if(theDebugObject){
|
||||
*aRetVal = theDebugObject->CreateDirectory(aBasePath, aFlags);
|
||||
}
|
||||
if(mDebugObj){
|
||||
*aRetVal = mDebugObj->CreateDirectory(aBasePath, aFlags);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------
|
||||
|
||||
void nsPluginInstance::CompareLayoutFrames(const PRUnichar *aBasePath, const PRUnichar *aVerPath,
|
||||
void
|
||||
nsPluginInstance::CompareLayoutFrames(const PRUnichar *aBasePath, const PRUnichar *aVerPath,
|
||||
const PRUnichar *aBaseFile, const PRUnichar *aVerFile, PRUint32 aFlags, PRInt32 *aRetVal)
|
||||
{
|
||||
nsIDebugObject *theDebugObject=NULL;
|
||||
|
||||
*aRetVal = NS_ERROR_FAILURE;
|
||||
|
||||
if (gServiceManager) {
|
||||
// get service using its contract id and use it to allocate the memory
|
||||
gServiceManager->GetServiceByContractID("@mozilla.org/debug/debugobject;1", NS_GET_IID(nsIDebugObject), (void **)&theDebugObject);
|
||||
if(theDebugObject){
|
||||
*aRetVal = theDebugObject->CompareFrameModels(aBasePath,aVerPath,aBaseFile,aVerFile,aFlags);
|
||||
}
|
||||
if(mDebugObj){
|
||||
*aRetVal = mDebugObj->CompareFrameModels(aBasePath,aVerPath,aBaseFile,aVerFile,aFlags);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------
|
||||
|
||||
void
|
||||
NS_IMETHODIMP
|
||||
nsPluginInstance::StartDirectorySearch(const char *aFilePath)
|
||||
{
|
||||
nsXPIDLCString dirPath;
|
||||
nsresult rv;
|
||||
|
||||
nsCOMPtr<nsILocalFile> theDir = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID);
|
||||
rv = NS_InitFileFromURLSpec(theDir, nsDependentCString(aFilePath));
|
||||
|
||||
if (NS_FAILED(rv)){
|
||||
nsCString dirStr(aFilePath);
|
||||
nsCOMPtr<nsIFile> theDir;
|
||||
rv = NS_GetFileFromURLSpec(dirStr, getter_AddRefs(theDir));
|
||||
if (NS_FAILED(rv)) {
|
||||
printf("nsPluginInstance::StartDirectorySearch failed on creation of nsIFile [%s]\n", aFilePath);
|
||||
mIter = 0;
|
||||
return;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
rv = theDir->GetDirectoryEntries(getter_AddRefs(mIter));
|
||||
if (NS_FAILED(rv)){
|
||||
printf("nsPluginInstance::StartDirectorySearch failed on GetDirectoryEntries of nsIFile [%s]\n", aFilePath);
|
||||
mIter = 0;
|
||||
return;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------
|
||||
|
||||
void
|
||||
NS_IMETHODIMP
|
||||
nsPluginInstance::GetNextFileInDirectory(char **aDirName)
|
||||
{
|
||||
PRBool hasMore;
|
||||
@@ -260,7 +261,7 @@ char* URLName;
|
||||
|
||||
*aDirName = 0;
|
||||
if ( 0 ==mIter ){
|
||||
return;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
while ( NS_SUCCEEDED(mIter->HasMoreElements(&hasMore)) ){
|
||||
@@ -292,8 +293,105 @@ char* URLName;
|
||||
nsMemory::Free(afilepath);
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPluginInstance::CompareLayoutFiles(const PRUnichar *aBasePath, const PRUnichar *aVerPath,
|
||||
const PRUnichar *aBaseFile, const PRUnichar *aVerFile, PRUint32 aFlags, PRInt32 *aResult)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPluginInstance::DumpLayout(nsISupports *aWindow, const PRUnichar *aFilePath, const PRUnichar *aFileName,
|
||||
PRUint32 aFlags, PRInt32 *aResult)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* void PluginShutdown (); */
|
||||
NS_IMETHODIMP
|
||||
nsPluginInstance::PluginShutdown()
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPluginInstance::SetBoolPref(const PRUnichar *aPrefName, PRBool aVal)
|
||||
{
|
||||
nsCOMPtr<nsIPref> prefs(do_GetService(NS_PREF_CONTRACTID));
|
||||
if (prefs) {
|
||||
nsCString prefName;
|
||||
prefName.AssignWithConversion(aPrefName);
|
||||
prefs->SetBoolPref(prefName.get(), aVal);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* attribute boolean doRuntimeTests; */
|
||||
NS_IMETHODIMP
|
||||
nsPluginInstance::GetDoRuntimeTests(PRBool *aDoRuntimeTests)
|
||||
{
|
||||
if (mDebugObj)
|
||||
return mDebugObj->GetDoRuntimeTests(aDoRuntimeTests);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
NS_IMETHODIMP
|
||||
nsPluginInstance::SetDoRuntimeTests(PRBool aDoRuntimeTests)
|
||||
{
|
||||
if (mDebugObj)
|
||||
return mDebugObj->SetDoRuntimeTests(aDoRuntimeTests);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* attribute short testId; */
|
||||
NS_IMETHODIMP
|
||||
nsPluginInstance::GetTestId(PRInt16 *aTestId)
|
||||
{
|
||||
if (mDebugObj)
|
||||
return mDebugObj->GetTestId(aTestId);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
NS_IMETHODIMP
|
||||
nsPluginInstance::SetTestId(PRInt16 aTestId)
|
||||
{
|
||||
if (mDebugObj)
|
||||
return mDebugObj->SetTestId(aTestId);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* attribute boolean printAsIs; */
|
||||
NS_IMETHODIMP
|
||||
nsPluginInstance::GetPrintAsIs(PRBool *aPrintAsIs)
|
||||
{
|
||||
if (mDebugObj)
|
||||
return mDebugObj->GetPrintAsIs(aPrintAsIs);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
NS_IMETHODIMP
|
||||
nsPluginInstance::SetPrintAsIs(PRBool aPrintAsIs)
|
||||
{
|
||||
if (mDebugObj)
|
||||
return mDebugObj->SetPrintAsIs(aPrintAsIs);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* attribute wstring printFileName; */
|
||||
NS_IMETHODIMP nsPluginInstance::GetPrintFileName(PRUnichar * *aPrintFileName)
|
||||
{
|
||||
if (mDebugObj)
|
||||
return mDebugObj->GetPrintFileName(aPrintFileName);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
NS_IMETHODIMP nsPluginInstance::SetPrintFileName(const PRUnichar * aPrintFileName)
|
||||
{
|
||||
if (mDebugObj)
|
||||
return mDebugObj->SetPrintFileName(aPrintFileName);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------
|
||||
|
||||
@@ -371,3 +469,5 @@ nsIDebugPlugin* nsPluginInstance::getScriptablePeer()
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include "nsIFile.h"
|
||||
#include "nsILocalFile.h"
|
||||
#include "nsISimpleEnumerator.h"
|
||||
#include "nsIDebugObject.h"
|
||||
|
||||
class nsPluginInstance : public nsPluginInstanceBase
|
||||
{
|
||||
@@ -60,22 +61,20 @@ public:
|
||||
NPError GetValue(NPPVariable variable, void *value);
|
||||
|
||||
// locals
|
||||
void getVersion(char* *aVersion);
|
||||
void CreateDirectory(const PRUnichar *aFilePath, PRUint32 aFlags, PRInt32 *aRetVal);
|
||||
void OutPutLayoutFrames(nsISupports *aWindow,const PRUnichar *aFilePath, const PRUnichar *aFileName, PRUint32 aFlags, PRInt32 *aRetVal);
|
||||
void CompareLayoutFrames(const PRUnichar *aBasePath, const PRUnichar *aVerPath,
|
||||
const PRUnichar *aBaseFile, const PRUnichar *aVerFile, PRUint32 aFlags, PRInt32 *aRetVal);
|
||||
void StartDirectorySearch(const char *aFilePath);
|
||||
void GetNextFileInDirectory(char **aFilePath);
|
||||
nsIDebugPlugin* getScriptablePeer();
|
||||
|
||||
NS_DECL_NSIDEBUGPLUGIN
|
||||
|
||||
private:
|
||||
NPP mInstance;
|
||||
NPBool mInitialized;
|
||||
nsIDebugPlugin * mScriptablePeer;
|
||||
nsCOMPtr<nsISimpleEnumerator> mIter;
|
||||
|
||||
|
||||
nsCOMPtr<nsIDebugObject> mDebugObj;
|
||||
public:
|
||||
char mString[128];
|
||||
};
|
||||
|
||||
428
mozilla/extensions/layout-debug/plugin/printRuntimeTests.html
Normal file
428
mozilla/extensions/layout-debug/plugin/printRuntimeTests.html
Normal file
@@ -0,0 +1,428 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Debug Plug-in Test</TITLE>
|
||||
</HEAD>
|
||||
|
||||
|
||||
|
||||
<BODY bgcolor="#c0d0f0" onload="clearAllPrefs();" onunload="clearAllPrefs();">
|
||||
<center>
|
||||
<h2>Printing XPConnect Scriptable Debug Plug-in Regression Page</h2>
|
||||
</center>
|
||||
<embed type="application/debug-plugin" width=1 height=1 hidden="true"><br>
|
||||
<script>
|
||||
var gDebugIFace = Components.interfaces.nsIDebugObject;
|
||||
var embed = document.embeds[0];
|
||||
var started = false;
|
||||
var theWindow;
|
||||
var fileDirectory;
|
||||
var baseExt;
|
||||
var verExt;
|
||||
var baseDir;
|
||||
var verDir;
|
||||
var testType;
|
||||
var changed = false;
|
||||
var lb,mb,pb,sb,stb,tb;
|
||||
var origLeft;
|
||||
var origTop;
|
||||
var origWidth;
|
||||
var origHeight;
|
||||
var dirType;
|
||||
var curIndex;
|
||||
var startIndex;
|
||||
var endIndex;
|
||||
var dumpStyle;
|
||||
|
||||
var gPrtInx = 0;
|
||||
var gDoingSecondFS = false;
|
||||
var gTestTotal = 0;
|
||||
var gTestCnt = 0;
|
||||
var gBaseDir = "";
|
||||
var gOrigBaseDir = "/printing";
|
||||
|
||||
var gLocation = "";
|
||||
|
||||
var myArray = [gDebugIFace.PRT_RUNTIME_CHECKFORPRINTERS,
|
||||
gDebugIFace.PRT_RUNTIME_CREATEPRTSESSION,
|
||||
gDebugIFace.PRT_RUNTIME_INITPRTOBJ,
|
||||
gDebugIFace.PRT_RUNTIME_CREATESPECFACTORY,
|
||||
gDebugIFace.PRT_RUNTIME_NOPROMPTSERVICE,
|
||||
gDebugIFace.PRT_RUNTIME_NODEVSPEC,
|
||||
gDebugIFace.PRT_RUNTIME_NEXTPAGE,
|
||||
gDebugIFace.PRT_RUNTIME_REFLOWDOCLIST,
|
||||
gDebugIFace.PRT_RUNTIME_PREPAREDOC,
|
||||
gDebugIFace.PRT_RUNTIME_BEGINDOC,
|
||||
];
|
||||
|
||||
var myDesc = ["Check for no Printers",
|
||||
"Creating Print Session",
|
||||
"Initializing Print Obj",
|
||||
"Create DC Spec Factory",
|
||||
"No Prompt Service",
|
||||
"No Device Spec",
|
||||
"After Next Page",
|
||||
"After Reflow Doc List",
|
||||
"Prepare Document",
|
||||
"Begin Document",
|
||||
];
|
||||
|
||||
var myURLs = [
|
||||
"long_pages/2_pages.html",
|
||||
"misc/scaled_scrollbars.html",
|
||||
"misc/embed_obj_tag.html",
|
||||
"misc/abs_pos.html",
|
||||
"misc/page_with_long_title.html",
|
||||
"misc/font_size_scaling.html",
|
||||
"iframe_2nd_page/index.html",
|
||||
"zeropos_iframes/index.html",
|
||||
"hidden_iframe/index.html",
|
||||
"frameset/frameset1/simple_main.html",
|
||||
"frameset/frameset2/simple_main.html",
|
||||
"noframes/simple_main.html",
|
||||
"shrink_to_fit/test1/simple_main.html",
|
||||
"shrink_to_fit/test2/simple_main.html",
|
||||
"shrink_to_fit/test3/simple_main.html",
|
||||
"shrink_to_fit/test4/index.html",
|
||||
"shrink_to_fit/test5/simple_main.html",
|
||||
"shrink_to_fit/test6/index.html",
|
||||
"shrink_to_fit/test7/simple_main.html",
|
||||
];
|
||||
|
||||
var myIsFRMSets = [
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
];
|
||||
|
||||
var gTestInx = 0;
|
||||
|
||||
//=============================================================================
|
||||
function getFileNameNoExt(str)
|
||||
{
|
||||
var start = str.lastIndexOf("/");
|
||||
var end = str.lastIndexOf(".");
|
||||
return str.substr(start, end-start);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
function getFileName(str)
|
||||
{
|
||||
var start = str.lastIndexOf("/") + 1;
|
||||
return str.substr(start, str.length-start);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
function clearAllPrefs()
|
||||
{
|
||||
var i;
|
||||
ClearOutput();
|
||||
embed.SetBoolPref("print.show_print_progress", true);
|
||||
WriteOutput("Done Initializing...", false, true, true);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
function ClearOutput()
|
||||
{
|
||||
var textarea = document.getElementById('output');
|
||||
textarea.value = "";
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
function WriteOutput( aText, aReplace, aToStatus, aToOutPut )
|
||||
{
|
||||
|
||||
var textarea = document.getElementById('output');
|
||||
var statusarea = document.getElementById('status');
|
||||
|
||||
if ( aToStatus ) {
|
||||
statusarea.value = aText;
|
||||
}
|
||||
|
||||
if (aToOutPut) {
|
||||
if( aReplace ) {
|
||||
textarea.value = aText;
|
||||
} else {
|
||||
textarea.value = textarea.value + "\n" + aText;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
function placeWindows(aOutputWindow, aTestWindow)
|
||||
{
|
||||
var top = window.screen.availTop;
|
||||
var left = window.screen.availLeft;
|
||||
var height = window.screen.availHeight;
|
||||
var width = window.screen.availWidth;
|
||||
if (height > 1000) {
|
||||
height = 800;
|
||||
} else {
|
||||
height = height - 200;
|
||||
}
|
||||
if (width > 800) {
|
||||
width = 800;
|
||||
}
|
||||
|
||||
// size the window to the largest possible
|
||||
aTestWindow.moveTo(left,200);
|
||||
aTestWindow.resizeTo(width,height);
|
||||
|
||||
aOutputWindow.focus();
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
function startErrorTests()
|
||||
{
|
||||
ClearOutput();
|
||||
gTestInx = 0;
|
||||
runTests();
|
||||
document.getElementById('nxtErrBtn').removeAttribute("disabled");
|
||||
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
function runTests()
|
||||
{
|
||||
|
||||
try {
|
||||
embed.doRuntimeTests = true;
|
||||
WriteOutput((gTestInx+1) + "/"+myArray.length+" - "+myDesc[gTestInx], false, true, true);
|
||||
embed.testId = myArray[gTestInx];
|
||||
window.print();
|
||||
} catch(e) {}
|
||||
|
||||
embed.doRuntimeTests = false;
|
||||
embed.SetBoolPref("print.show_print_progress", true);
|
||||
|
||||
gTestInx++;
|
||||
if (gTestInx == myArray.length) {
|
||||
document.getElementById('nxtErrBtn').setAttribute("disabled","true");
|
||||
WriteOutput("Print Error Tests Complete.", false, true, true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
function indvTest()
|
||||
{
|
||||
var inx = document.getElementById('indexValue').value;
|
||||
if (inx < 1 || inx > myArray.length) {
|
||||
alert("Test # must be > 0 and <= "+myArray.length);
|
||||
return;
|
||||
}
|
||||
// adjust for index starting at zero
|
||||
inx--;
|
||||
|
||||
try {
|
||||
ClearOutput();
|
||||
WriteOutput("Individual Test: "+myDesc[inx], false, true, true);
|
||||
embed.doRuntimeTests = true;
|
||||
embed.testId = myArray[inx];
|
||||
window.print();
|
||||
} catch(e) {}
|
||||
window.setTimeout("clearIndvTest()", 10000);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
function clearIndvTest()
|
||||
{
|
||||
WriteOutput("Individual Test - Clearing Test:"+myDesc[inx], false, true, true);
|
||||
embed.doRuntimeTests = false;
|
||||
embed.SetBoolPref("print.show_print_progress", true);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
function doPrintTests()
|
||||
{
|
||||
embed.testId = gDebugIFace.PRT_RUNTIME_NONE;
|
||||
if (myIsFRMSets.length != myURLs.length) {
|
||||
alert("myIsFRMSets length is different from myURLs\nNot running tests.");
|
||||
return
|
||||
}
|
||||
|
||||
var drive = document.getElementById('driveloc').value;
|
||||
var custom = document.getElementById('drivecustom').value;
|
||||
if (drive == "custom") {
|
||||
gLocation = "file:///"+custom+"/mozilla/layout/html/tests/printer/";
|
||||
gBaseDir = "/"+gOrigBaseDir;
|
||||
} else {
|
||||
gLocation = "file:///"+drive+"/mozilla/layout/html/tests/printer/";
|
||||
gBaseDir = drive+gOrigBaseDir;
|
||||
}
|
||||
|
||||
ClearOutput();
|
||||
|
||||
WriteOutput("Creating Dir: "+gBaseDir, false, true, true);
|
||||
|
||||
var dirURL = "file:///" + gBaseDir;
|
||||
var err = embed.CreateDirectory(dirURL,0);
|
||||
if (err != 0) {
|
||||
alert("Couldn`t create directory["+dirURL+"]");
|
||||
} else {
|
||||
WriteOutput("Created directory: "+gBaseDir, false, false, true);
|
||||
}
|
||||
|
||||
gTestTotal = 0;
|
||||
gTestCnt = 0;
|
||||
var i;
|
||||
for (i=0;i<myIsFRMSets.length;i++) {
|
||||
if (myIsFRMSets[i]) {
|
||||
gTestTotal++;
|
||||
}
|
||||
gTestTotal++;
|
||||
}
|
||||
|
||||
embed.doRuntimeTests = true;
|
||||
document.getElementById('stoptests').removeAttribute("disabled");
|
||||
embed.SetBoolPref("print.show_print_progress", false);
|
||||
gPrtInx = 0;
|
||||
gDoingSecondFS = false;
|
||||
doNextPrintTests();
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
|
||||
function doNextPrintTests()
|
||||
{
|
||||
if (gPrtInx == myURLs.length) {
|
||||
if (theWindow) {
|
||||
theWindow.close();
|
||||
theWindow = null;
|
||||
}
|
||||
embed.SetBoolPref("print.always_print_silent", false);
|
||||
embed.printFileName = null;
|
||||
WriteOutput("Done.", false, true, true);
|
||||
embed.SetBoolPref("print.show_print_progress", true);
|
||||
document.getElementById('stoptests').setAttribute("disabled","true");
|
||||
embed.doRuntimeTests = false;
|
||||
return;
|
||||
}
|
||||
|
||||
var outputName = gBaseDir+"/test"+gTestCnt;
|
||||
|
||||
var extraTxt = "";
|
||||
if (myIsFRMSets[gPrtInx]) {
|
||||
embed.printAsIs = gDoingSecondFS;
|
||||
extraTxt = gDoingSecondFS?" (As Is)":" (Each Separately)";
|
||||
//outputName += gDoingSecondFS?"_AsIs":"_EachSep";
|
||||
}
|
||||
outputName += ".ps";
|
||||
embed.printFileName = outputName;
|
||||
|
||||
var testName = getFileName(myURLs[gPrtInx]);
|
||||
WriteOutput("Writing to: "+outputName, false, true, false);
|
||||
WriteOutput((gTestCnt+1) + "/"+gTestTotal+" - "+testName+" -> "+outputName+extraTxt, false, false, true);
|
||||
|
||||
theWindow = window.open(gLocation+myURLs[gPrtInx], 0);
|
||||
window.setTimeout("doPrintWindow();", 2000);
|
||||
if (gPrtInx == 0) {
|
||||
embed.SetBoolPref("print.always_print_silent", true);
|
||||
placeWindows(window, theWindow);
|
||||
}
|
||||
|
||||
if (!gDoingSecondFS && myIsFRMSets[gPrtInx]) {
|
||||
gDoingSecondFS = true;
|
||||
} else {
|
||||
gDoingSecondFS = false;
|
||||
gPrtInx++;
|
||||
}
|
||||
gTestCnt++;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
function doPrintWindow()
|
||||
{
|
||||
theWindow.print();
|
||||
window.setTimeout("doNextPrintTests();", 2000);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
function doCloseWindow()
|
||||
{
|
||||
//theWindow.close();
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
function doStopTests()
|
||||
{
|
||||
embed.doRuntimeTests = false;
|
||||
WriteOutput("Tests Stoppped...", false, true, true);
|
||||
document.getElementById('stoptests').setAttribute("disabled","true");
|
||||
gPrtInx = myURLs.length;
|
||||
window.clearTimeout();
|
||||
if (theWindow) {
|
||||
theWindow.close();
|
||||
theWindow = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<center>
|
||||
<form>
|
||||
<table>
|
||||
<tr>
|
||||
<td colspan=2 align=center style="background-color:#cFdFfF">Error Tests</td>
|
||||
<td></td>
|
||||
<td colspan=2 align=center style="background-color:#cFdFfF">Print out Tests</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type=button id=errorBtn value="Start Error Tests" onclick='startErrorTests()'></td>
|
||||
<td><input type=button id=nxtErrBtn value="Next Error Test" onclick='runTests()' disabled>
|
||||
<input type=text id=indexValue value="" size=2>
|
||||
<input type=button id=indvTstBtn value="Indv Test" onclick='indvTest()'><br>
|
||||
<td> </td>
|
||||
<td><input type=button value="Print Tests" onclick='doPrintTests()'></td>
|
||||
<td><input type=button id=stoptests value="Stop Print" onclick='doStopTests()' disabled></td>
|
||||
</tr>
|
||||
<tr><td></td><td></td><td></td>
|
||||
<td colspan=2>
|
||||
<table>
|
||||
<tr>
|
||||
<td align=right>Drive:</td>
|
||||
<td>
|
||||
<select id=driveloc>
|
||||
<option value="S:" selected>S:</option>
|
||||
<option value="custom">Custom</option>
|
||||
<option value="C:">C:</option>
|
||||
<option value="D:">D:</option>
|
||||
<option value="E:">E:</option>
|
||||
<option value="F:">F:</option>
|
||||
<option value="G:">G:</option>
|
||||
</select><br>
|
||||
</td>
|
||||
<td align=right>Custom:</td>
|
||||
<td><input type=text value="" id=drivecustom></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td></tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<input type=text id="status" value="OUTPUT IDLE" size=60 style="border: black 1px solid;background-color:lightgray;text-align:center;">
|
||||
<textarea id="output" style="width:700; height:200;">
|
||||
</textarea>
|
||||
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -1,6 +1,6 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by npDebug.rc
|
||||
// Used by npdebug.rc
|
||||
//
|
||||
#define IDD_MAIN 101
|
||||
#define IDC_BUTTON_GO 1002
|
||||
|
||||
@@ -84,7 +84,7 @@ var myArray = new Array(15);
|
||||
|
||||
function CompareFiles(aBaseDir,aVerDir,aBaselineFile,aVerFile)
|
||||
{
|
||||
err = embed.CompareLayoutFiles(aBaseDir,aVerDir,aBaselineFile,aVerFile,1);
|
||||
var err = embed.CompareLayoutFiles(aBaseDir,aVerDir,aBaselineFile,aVerFile,1);
|
||||
|
||||
if(err == 0) {
|
||||
WriteOutput("File \" "+aVerFile + "\" PASSED",false,"success",true,true );
|
||||
@@ -97,7 +97,7 @@ function CompareFiles(aBaseDir,aVerDir,aBaselineFile,aVerFile)
|
||||
|
||||
function ClearOutput()
|
||||
{
|
||||
textarea = document.getElementById('output');
|
||||
var textarea = document.getElementById('output');
|
||||
textarea.innerHTML = "";
|
||||
}
|
||||
|
||||
@@ -106,10 +106,10 @@ function ClearOutput()
|
||||
function WriteOutput( aText, aReplace, aTextColor,aToStatus, aToOutPut )
|
||||
{
|
||||
|
||||
textarea = document.getElementById('output');
|
||||
statusarea = document.getElementById('status');
|
||||
var textarea = document.getElementById('output');
|
||||
var statusarea = document.getElementById('status');
|
||||
|
||||
thecolor = "<font color=black>";
|
||||
var thecolor = "<font color=black>";
|
||||
if(aTextColor == "failure")
|
||||
thecolor = "<font color=red>";
|
||||
if(aTextColor == "success")
|
||||
@@ -155,10 +155,10 @@ function placeWindows(aOutputWindow,aTestWindow)
|
||||
aOutputWindow.statusbar.visible = false;
|
||||
aOutputWindow.toolbar.visible = false;
|
||||
|
||||
top = window.screen.availTop;
|
||||
left = window.screen.availLeft;
|
||||
height = window.screen.availHeight;
|
||||
width = window.screen.availWidth;
|
||||
var top = window.screen.availTop;
|
||||
var left = window.screen.availLeft;
|
||||
var height = window.screen.availHeight;
|
||||
var width = window.screen.availWidth;
|
||||
if (height > 1000) {
|
||||
height = 800;
|
||||
} else {
|
||||
@@ -238,6 +238,8 @@ function DumpDirectoryies(aTestType)
|
||||
baseExt = ".bas";
|
||||
verExt = ".ver";
|
||||
|
||||
var dirURL;
|
||||
var err;
|
||||
// create the output directories
|
||||
if ( testType == 1 ) {
|
||||
dirURL = "file:///"+ baseDir;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
@@ -18,19 +17,20 @@
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
DEPTH=..\..\..
|
||||
DEPTH = ../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DEFINES=-D_IMPL_NS_UI
|
||||
MODULE=debug
|
||||
MODULE = debug
|
||||
|
||||
XPIDLSRCS = \
|
||||
.\nsIDebugObject.idl \
|
||||
$(NULL)
|
||||
EXPORTS = \
|
||||
nsDebugCIID.h \
|
||||
$(NULL)
|
||||
|
||||
EXPORTS= \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
71
mozilla/extensions/layout-debug/src/Makefile.in
Normal file
71
mozilla/extensions/layout-debug/src/Makefile.in
Normal file
@@ -0,0 +1,71 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape 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/NPL/
|
||||
#
|
||||
# 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 Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
DEPTH = ../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = debug
|
||||
LIBRARY_NAME = gkdebug
|
||||
EXPORT_LIBRARY = 1
|
||||
IS_COMPONENT = 1
|
||||
MODULE_NAME = nsDebugModule
|
||||
|
||||
REQUIRES= xpcom \
|
||||
string \
|
||||
debugobject\
|
||||
windowwatcher\
|
||||
docshell\
|
||||
string \
|
||||
dom\
|
||||
gfx\
|
||||
content\
|
||||
necko\
|
||||
layout\
|
||||
widget \
|
||||
locale \
|
||||
view \
|
||||
pref \
|
||||
gfx2 \
|
||||
imglib2 \
|
||||
unicharutil \
|
||||
$(NULL)
|
||||
|
||||
CPPSRCS = \
|
||||
nsDebugObject.cpp \
|
||||
nsDebugFactory.cpp \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_DSO_LDOPTS = \
|
||||
$(LIBS_DIRS) \
|
||||
$(MOZ_UNICHARUTIL_LIBS) \
|
||||
$(MOZ_COMPONENT_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
libs::
|
||||
|
||||
clobber::
|
||||
rm -f $(DIST)\lib\library
|
||||
@@ -1,72 +0,0 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape 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/NPL/
|
||||
#
|
||||
# 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 Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
DEPTH=..\..\..
|
||||
|
||||
MODULE=debug
|
||||
|
||||
|
||||
REQUIRES= xpcom \
|
||||
string \
|
||||
debugobject\
|
||||
windowwatcher\
|
||||
docshell\
|
||||
string \
|
||||
dom\
|
||||
gfx\
|
||||
content\
|
||||
necko\
|
||||
layout\
|
||||
widget \
|
||||
locale \
|
||||
view \
|
||||
pref \
|
||||
gfx2 \
|
||||
imglib2 \
|
||||
unicharutil \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\config.mak>
|
||||
|
||||
LIBRARY_NAME=gkdebug
|
||||
MODULE_NAME=nsDebugModule
|
||||
|
||||
|
||||
CPP_OBJS=.\$(OBJDIR)\nsDebugObject.obj \
|
||||
.\$(OBJDIR)\nsDebugFactory.obj \
|
||||
$(NULL)
|
||||
|
||||
|
||||
LCFLAGS = \
|
||||
$(LCFLAGS) \
|
||||
$(DEFINES) \
|
||||
$(NULL)
|
||||
|
||||
LLIBS= \
|
||||
$(DIST)\lib\util.lib \
|
||||
$(DIST)\lib\xpcom.lib
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
libs::
|
||||
|
||||
clobber::
|
||||
rm -f $(DIST)\lib\library
|
||||
@@ -38,6 +38,7 @@
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsISupports.h"
|
||||
#include "nsDebugObject.h"
|
||||
|
||||
#include "nsXPIDLString.h"
|
||||
#include "nsReadableUtils.h"
|
||||
@@ -45,7 +46,6 @@
|
||||
#include "nsIWindowWatcher.h"
|
||||
#include "nsVoidArray.h"
|
||||
#include "prmem.h"
|
||||
#include "nsDebugObject.h"
|
||||
#include "nsIDocShellTreeItem.h"
|
||||
#include "nsIDOMWindowInternal.h"
|
||||
#include "nsIPresShell.h"
|
||||
@@ -61,8 +61,11 @@
|
||||
#include "nsIFrameUtil.h"
|
||||
#include "nsLayoutCID.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsIFile.h"
|
||||
#include "nsIPref.h"
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsDebugObject, nsIDebugObject)
|
||||
|
||||
static NS_DEFINE_IID(kFrameUtilCID, NS_FRAME_UTIL_CID);
|
||||
static NS_DEFINE_IID(kIFrameUtilIID, NS_IFRAME_UTIL_IID);
|
||||
|
||||
@@ -70,7 +73,11 @@ static NS_DEFINE_IID(kIFrameUtilIID, NS_IFRAME_UTIL_IID);
|
||||
* See documentation in nsDebugObject.h
|
||||
* @update 5/16/02 dwc
|
||||
*/
|
||||
nsDebugObject::nsDebugObject()
|
||||
nsDebugObject::nsDebugObject() :
|
||||
mRuntimeTestIsOn(PR_FALSE),
|
||||
mPrintAsIs(PR_FALSE),
|
||||
mRuntimeTestId(nsIDebugObject::PRT_RUNTIME_NONE),
|
||||
mFileName(nsnull)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
@@ -81,7 +88,9 @@ nsDebugObject::nsDebugObject()
|
||||
*/
|
||||
nsDebugObject::~nsDebugObject()
|
||||
{
|
||||
|
||||
if (mFileName) {
|
||||
nsMemory::Free(mFileName);
|
||||
}
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------
|
||||
@@ -92,20 +101,24 @@ NS_IMETHODIMP
|
||||
nsDebugObject::CreateDirectory( const PRUnichar *aFilePath, PRUint32 aFlags)
|
||||
{
|
||||
nsresult rv,result = NS_ERROR_FAILURE;
|
||||
nsCAutoString dirPathAS;
|
||||
PRBool exists = PR_TRUE;
|
||||
|
||||
// see if the directory exists, if not create it
|
||||
dirPathAS.AssignWithConversion(aFilePath);
|
||||
char* dirPath = ToNewCString(dirPathAS);
|
||||
|
||||
nsCOMPtr<nsILocalFile> localFile = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID);
|
||||
rv = NS_InitFileFromURLSpec( localFile,nsDependentCString(dirPath));
|
||||
if ( rv == NS_OK) {
|
||||
nsCString dirStr;
|
||||
dirStr.AssignWithConversion(aFilePath);
|
||||
nsCOMPtr<nsIFile> localFile;
|
||||
rv = NS_GetFileFromURLSpec(dirStr, getter_AddRefs(localFile));
|
||||
if ( NS_SUCCEEDED(rv) ) {
|
||||
rv = localFile->Exists(&exists);
|
||||
if (!exists){
|
||||
rv = localFile->Create(nsIFile::DIRECTORY_TYPE, 0600);
|
||||
if (NS_FAILED(rv)) {
|
||||
printf("Failed to create directory [%s]\n", NS_LossyConvertUCS2toASCII(nsAutoString(aFilePath)).get());
|
||||
}
|
||||
} else {
|
||||
printf("OK - Directory Exists [%s]\n", NS_LossyConvertUCS2toASCII(nsAutoString(aFilePath)).get());
|
||||
}
|
||||
} else {
|
||||
printf("Failed to init path for local file in CreateDirectory [%s]\n", NS_LossyConvertUCS2toASCII(nsAutoString(aFilePath)).get());
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -219,3 +232,64 @@ FILE *bp,*vp;
|
||||
return result;
|
||||
}
|
||||
|
||||
/* attribute boolean doRuntimeTests; */
|
||||
NS_IMETHODIMP
|
||||
nsDebugObject::GetDoRuntimeTests(PRBool *aDoRuntimeTests)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aDoRuntimeTests);
|
||||
*aDoRuntimeTests = mRuntimeTestIsOn;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP
|
||||
nsDebugObject::SetDoRuntimeTests(PRBool aDoRuntimeTests)
|
||||
{
|
||||
mRuntimeTestIsOn = aDoRuntimeTests;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* attribute short testId; */
|
||||
NS_IMETHODIMP
|
||||
nsDebugObject::GetTestId(PRInt16 *aTestId)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aTestId);
|
||||
*aTestId = mRuntimeTestId;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP
|
||||
nsDebugObject::SetTestId(PRInt16 aTestId)
|
||||
{
|
||||
mRuntimeTestId = aTestId;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* attribute boolean printAsIs; */
|
||||
NS_IMETHODIMP
|
||||
nsDebugObject::GetPrintAsIs(PRBool *aPrintAsIs)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aPrintAsIs);
|
||||
*aPrintAsIs = mPrintAsIs;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP
|
||||
nsDebugObject::SetPrintAsIs(PRBool aPrintAsIs)
|
||||
{
|
||||
mPrintAsIs = aPrintAsIs;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* attribute wstring printFileName; */
|
||||
NS_IMETHODIMP nsDebugObject::GetPrintFileName(PRUnichar * *aPrintFileName)
|
||||
{
|
||||
*aPrintFileName = nsCRT::strdup(mFileName);
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP nsDebugObject::SetPrintFileName(const PRUnichar * aPrintFileName)
|
||||
{
|
||||
if (mFileName) {
|
||||
nsMemory::Free(mFileName);
|
||||
}
|
||||
mFileName = nsCRT::strdup(aPrintFileName);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -36,6 +36,11 @@ public:
|
||||
nsDebugObject();
|
||||
virtual ~nsDebugObject();
|
||||
|
||||
protected:
|
||||
PRBool mRuntimeTestIsOn;
|
||||
PRBool mPrintAsIs;
|
||||
PRInt16 mRuntimeTestId;
|
||||
PRUnichar* mFileName;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsISupports.h"
|
||||
#include "nsDebugObject.h"
|
||||
|
||||
#include "nsXPIDLString.h"
|
||||
#include "nsReadableUtils.h"
|
||||
@@ -45,7 +46,6 @@
|
||||
#include "nsIWindowWatcher.h"
|
||||
#include "nsVoidArray.h"
|
||||
#include "prmem.h"
|
||||
#include "nsDebugObject.h"
|
||||
#include "nsIDocShellTreeItem.h"
|
||||
#include "nsIDOMWindowInternal.h"
|
||||
#include "nsIPresShell.h"
|
||||
@@ -61,8 +61,11 @@
|
||||
#include "nsIFrameUtil.h"
|
||||
#include "nsLayoutCID.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsIFile.h"
|
||||
#include "nsIPref.h"
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsDebugObject, nsIDebugObject)
|
||||
|
||||
static NS_DEFINE_IID(kFrameUtilCID, NS_FRAME_UTIL_CID);
|
||||
static NS_DEFINE_IID(kIFrameUtilIID, NS_IFRAME_UTIL_IID);
|
||||
|
||||
@@ -70,7 +73,11 @@ static NS_DEFINE_IID(kIFrameUtilIID, NS_IFRAME_UTIL_IID);
|
||||
* See documentation in nsDebugObject.h
|
||||
* @update 5/16/02 dwc
|
||||
*/
|
||||
nsDebugObject::nsDebugObject()
|
||||
nsDebugObject::nsDebugObject() :
|
||||
mRuntimeTestIsOn(PR_FALSE),
|
||||
mPrintAsIs(PR_FALSE),
|
||||
mRuntimeTestId(nsIDebugObject::PRT_RUNTIME_NONE),
|
||||
mFileName(nsnull)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
@@ -81,7 +88,9 @@ nsDebugObject::nsDebugObject()
|
||||
*/
|
||||
nsDebugObject::~nsDebugObject()
|
||||
{
|
||||
|
||||
if (mFileName) {
|
||||
nsMemory::Free(mFileName);
|
||||
}
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------
|
||||
@@ -92,20 +101,24 @@ NS_IMETHODIMP
|
||||
nsDebugObject::CreateDirectory( const PRUnichar *aFilePath, PRUint32 aFlags)
|
||||
{
|
||||
nsresult rv,result = NS_ERROR_FAILURE;
|
||||
nsCAutoString dirPathAS;
|
||||
PRBool exists = PR_TRUE;
|
||||
|
||||
// see if the directory exists, if not create it
|
||||
dirPathAS.AssignWithConversion(aFilePath);
|
||||
char* dirPath = ToNewCString(dirPathAS);
|
||||
|
||||
nsCOMPtr<nsILocalFile> localFile = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID);
|
||||
rv = NS_InitFileFromURLSpec( localFile,nsDependentCString(dirPath));
|
||||
if ( rv == NS_OK) {
|
||||
nsCString dirStr;
|
||||
dirStr.AssignWithConversion(aFilePath);
|
||||
nsCOMPtr<nsIFile> localFile;
|
||||
rv = NS_GetFileFromURLSpec(dirStr, getter_AddRefs(localFile));
|
||||
if ( NS_SUCCEEDED(rv) ) {
|
||||
rv = localFile->Exists(&exists);
|
||||
if (!exists){
|
||||
rv = localFile->Create(nsIFile::DIRECTORY_TYPE, 0600);
|
||||
if (NS_FAILED(rv)) {
|
||||
printf("Failed to create directory [%s]\n", NS_LossyConvertUCS2toASCII(nsAutoString(aFilePath)).get());
|
||||
}
|
||||
} else {
|
||||
printf("OK - Directory Exists [%s]\n", NS_LossyConvertUCS2toASCII(nsAutoString(aFilePath)).get());
|
||||
}
|
||||
} else {
|
||||
printf("Failed to init path for local file in CreateDirectory [%s]\n", NS_LossyConvertUCS2toASCII(nsAutoString(aFilePath)).get());
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -219,3 +232,64 @@ FILE *bp,*vp;
|
||||
return result;
|
||||
}
|
||||
|
||||
/* attribute boolean doRuntimeTests; */
|
||||
NS_IMETHODIMP
|
||||
nsDebugObject::GetDoRuntimeTests(PRBool *aDoRuntimeTests)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aDoRuntimeTests);
|
||||
*aDoRuntimeTests = mRuntimeTestIsOn;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP
|
||||
nsDebugObject::SetDoRuntimeTests(PRBool aDoRuntimeTests)
|
||||
{
|
||||
mRuntimeTestIsOn = aDoRuntimeTests;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* attribute short testId; */
|
||||
NS_IMETHODIMP
|
||||
nsDebugObject::GetTestId(PRInt16 *aTestId)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aTestId);
|
||||
*aTestId = mRuntimeTestId;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP
|
||||
nsDebugObject::SetTestId(PRInt16 aTestId)
|
||||
{
|
||||
mRuntimeTestId = aTestId;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* attribute boolean printAsIs; */
|
||||
NS_IMETHODIMP
|
||||
nsDebugObject::GetPrintAsIs(PRBool *aPrintAsIs)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aPrintAsIs);
|
||||
*aPrintAsIs = mPrintAsIs;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP
|
||||
nsDebugObject::SetPrintAsIs(PRBool aPrintAsIs)
|
||||
{
|
||||
mPrintAsIs = aPrintAsIs;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* attribute wstring printFileName; */
|
||||
NS_IMETHODIMP nsDebugObject::GetPrintFileName(PRUnichar * *aPrintFileName)
|
||||
{
|
||||
*aPrintFileName = nsCRT::strdup(mFileName);
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP nsDebugObject::SetPrintFileName(const PRUnichar * aPrintFileName)
|
||||
{
|
||||
if (mFileName) {
|
||||
nsMemory::Free(mFileName);
|
||||
}
|
||||
mFileName = nsCRT::strdup(aPrintFileName);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -36,6 +36,11 @@ public:
|
||||
nsDebugObject();
|
||||
virtual ~nsDebugObject();
|
||||
|
||||
protected:
|
||||
PRBool mRuntimeTestIsOn;
|
||||
PRBool mPrintAsIs;
|
||||
PRInt16 mRuntimeTestId;
|
||||
PRUnichar* mFileName;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user