зеркало из https://github.com/mozilla/pjs.git
Bug 319997 - Convert parser tests to use the frozen linkage, r=mrbkap
This commit is contained in:
Родитель
2e14eaf45f
Коммит
21de91b05c
|
@ -51,6 +51,7 @@
|
||||||
#include "nsIDocumentEncoder.h"
|
#include "nsIDocumentEncoder.h"
|
||||||
#include "nsString.h"
|
#include "nsString.h"
|
||||||
#include "nsIParser.h"
|
#include "nsIParser.h"
|
||||||
|
#include "nsHashtable.h"
|
||||||
|
|
||||||
class mozSanitizingHTMLSerializer : public nsIContentSerializer,
|
class mozSanitizingHTMLSerializer : public nsIContentSerializer,
|
||||||
public nsIHTMLContentSink,
|
public nsIHTMLContentSink,
|
||||||
|
|
|
@ -42,9 +42,15 @@ VPATH = @srcdir@
|
||||||
|
|
||||||
include $(DEPTH)/config/autoconf.mk
|
include $(DEPTH)/config/autoconf.mk
|
||||||
|
|
||||||
DIRS = outsinks \
|
DIRS = \
|
||||||
grabpage \
|
grabpage \
|
||||||
html \
|
html \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
|
ifndef MOZ_ENABLE_LIBXUL
|
||||||
|
DIRS += \
|
||||||
|
outsinks \
|
||||||
|
$(NULL)
|
||||||
|
endif
|
||||||
|
|
||||||
include $(topsrcdir)/config/rules.mk
|
include $(topsrcdir)/config/rules.mk
|
||||||
|
|
|
@ -43,7 +43,6 @@ VPATH = @srcdir@
|
||||||
include $(DEPTH)/config/autoconf.mk
|
include $(DEPTH)/config/autoconf.mk
|
||||||
|
|
||||||
PROGRAM = grabpage$(BIN_SUFFIX)
|
PROGRAM = grabpage$(BIN_SUFFIX)
|
||||||
MOZILLA_INTERNAL_API = 1
|
|
||||||
|
|
||||||
REQUIRES = xpcom \
|
REQUIRES = xpcom \
|
||||||
string \
|
string \
|
||||||
|
@ -53,6 +52,7 @@ REQUIRES = xpcom \
|
||||||
CPPSRCS = grabpage.cpp
|
CPPSRCS = grabpage.cpp
|
||||||
|
|
||||||
LIBS = \
|
LIBS = \
|
||||||
|
$(DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) \
|
||||||
$(XPCOM_LIBS) \
|
$(XPCOM_LIBS) \
|
||||||
$(NSPR_LIBS) \
|
$(NSPR_LIBS) \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
|
@ -37,6 +37,8 @@
|
||||||
#include "nsIStreamListener.h"
|
#include "nsIStreamListener.h"
|
||||||
#include "nsIInputStream.h"
|
#include "nsIInputStream.h"
|
||||||
#include "nsIURL.h"
|
#include "nsIURL.h"
|
||||||
|
#include "nsServiceManagerUtils.h"
|
||||||
|
#include "nsComponentManagerUtils.h"
|
||||||
|
|
||||||
#include "nsNetCID.h"
|
#include "nsNetCID.h"
|
||||||
#include "nsCOMPtr.h"
|
#include "nsCOMPtr.h"
|
||||||
|
@ -49,8 +51,7 @@ static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
|
||||||
static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
|
static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
|
||||||
static nsIEventQueue* gEventQ = nsnull;
|
static nsIEventQueue* gEventQ = nsnull;
|
||||||
|
|
||||||
#include "nsString.h"
|
#include "nsStringAPI.h"
|
||||||
#include "nsReadableUtils.h"
|
|
||||||
#include "nsCRT.h"
|
#include "nsCRT.h"
|
||||||
#include "prprf.h"
|
#include "prprf.h"
|
||||||
|
|
||||||
|
@ -178,7 +179,7 @@ public:
|
||||||
|
|
||||||
nsresult Init(nsILocalFile *aDirectory);
|
nsresult Init(nsILocalFile *aDirectory);
|
||||||
|
|
||||||
nsresult Grab(const nsAFlatCString& aURL);
|
nsresult Grab(const nsCString& aURL);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
nsILocalFile* NextFile(const char* aExtension);
|
nsILocalFile* NextFile(const char* aExtension);
|
||||||
|
@ -216,7 +217,7 @@ PageGrabber::NextFile(const char* aExtension)
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
PageGrabber::Grab(const nsAFlatCString& aURL)
|
PageGrabber::Grab(const nsCString& aURL)
|
||||||
{
|
{
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
// Create the Event Queue for this thread...
|
// Create the Event Queue for this thread...
|
||||||
|
@ -240,7 +241,7 @@ PageGrabber::Grab(const nsAFlatCString& aURL)
|
||||||
fputs(aURL.get(), stdout);
|
fputs(aURL.get(), stdout);
|
||||||
nsAutoString path;
|
nsAutoString path;
|
||||||
file->GetPath(path);
|
file->GetPath(path);
|
||||||
NS_ConvertUCS2toUTF8 cpath(path);
|
NS_ConvertUTF16toUTF8 cpath(path);
|
||||||
printf(" to %s\n", cpath.get());
|
printf(" to %s\n", cpath.get());
|
||||||
|
|
||||||
// Create the URL object...
|
// Create the URL object...
|
||||||
|
|
|
@ -42,8 +42,6 @@ VPATH = @srcdir@
|
||||||
|
|
||||||
include $(DEPTH)/config/autoconf.mk
|
include $(DEPTH)/config/autoconf.mk
|
||||||
|
|
||||||
MOZILLA_INTERNAL_API = 1
|
|
||||||
|
|
||||||
PROGRAM = TestParser$(BIN_SUFFIX)
|
PROGRAM = TestParser$(BIN_SUFFIX)
|
||||||
|
|
||||||
REQUIRES = xpcom \
|
REQUIRES = xpcom \
|
||||||
|
@ -57,6 +55,7 @@ CPPSRCS = \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
LIBS = \
|
LIBS = \
|
||||||
|
$(DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) \
|
||||||
$(XPCOM_LIBS) \
|
$(XPCOM_LIBS) \
|
||||||
$(NSPR_LIBS) \
|
$(NSPR_LIBS) \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
|
@ -37,10 +37,12 @@
|
||||||
|
|
||||||
#include "nsXPCOM.h"
|
#include "nsXPCOM.h"
|
||||||
#include "nsIComponentManager.h"
|
#include "nsIComponentManager.h"
|
||||||
|
#include "nsComponentManagerUtils.h"
|
||||||
#include "nsParserCIID.h"
|
#include "nsParserCIID.h"
|
||||||
#include "nsIParser.h"
|
#include "nsIParser.h"
|
||||||
#include "nsILoggingSink.h"
|
#include "nsILoggingSink.h"
|
||||||
#include "nsIInputStream.h"
|
#include "nsIInputStream.h"
|
||||||
|
#include "nsCOMPtr.h"
|
||||||
|
|
||||||
// Class IID's
|
// Class IID's
|
||||||
static NS_DEFINE_CID(kParserCID, NS_PARSER_CID);
|
static NS_DEFINE_CID(kParserCID, NS_PARSER_CID);
|
||||||
|
@ -94,7 +96,7 @@ nsresult ParseData(char* anInputStream,char* anOutputStream) {
|
||||||
while(!done) {
|
while(!done) {
|
||||||
length = PR_Read(in, buffer, sizeof(buffer));
|
length = PR_Read(in, buffer, sizeof(buffer));
|
||||||
if (length != 0) {
|
if (length != 0) {
|
||||||
stream.AppendWithConversion(buffer, length);
|
stream.Append(NS_ConvertUTF8toUTF16(buffer, length));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
done=PR_TRUE;
|
done=PR_TRUE;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче