fixed this test to go through the component manager. turn it back on.

This commit is contained in:
sspitzer%netscape.com 1999-05-27 02:41:16 +00:00
Родитель 35a17d67b0
Коммит c1c89f9464
3 изменённых файлов: 18 добавлений и 8 удалений

Просмотреть файл

@ -25,7 +25,7 @@ include $(DEPTH)/config/autoconf.mk
DIRS = base content document forms style table
ifdef ENABLE_TESTS
#DIRS += tests
DIRS += tests
endif
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -36,7 +36,6 @@ include $(topsrcdir)/config/config.mk
SIMPLE_PROGRAMS = $(addprefix $(OBJDIR)/, $(CPPSRCS:.cpp=))
LIBS = \
-lraptorhtml \
-limg \
$(PNG_LIBS) \
$(JPEG_LIBS) \

Просмотреть файл

@ -31,21 +31,29 @@
#include "nsIServiceManager.h"
#include "nsIEventQueueService.h"
#include "nsLayoutCID.h"
#include "nsCOMPtr.h"
#ifdef XP_PC
#define NETLIB_DLL "netlib.dll"
#define XPCOM_DLL "xpcom32.dll"
#define LAYOUT_DLL "raptorhtml.dll"
#else
#ifdef XP_MAC
#include "nsMacRepository.h"
#else
#define NETLIB_DLL "libnetlib.so"
#define XPCOM_DLL "libxpcom.so"
#define LAYOUT_DLL "libraptorhtml.so"
#endif
#endif
static NS_DEFINE_IID(kNetServiceCID, NS_NETSERVICE_CID);
static NS_DEFINE_IID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
static NS_DEFINE_IID(kIEventQueueServiceIID, NS_IEVENTQUEUESERVICE_IID);
static NS_DEFINE_CID(kCSSParserCID, NS_CSSPARSER_CID);
static NS_DEFINE_IID(kICSSParserIID, NS_ICSS_PARSER_IID);
// XXX end bad code
static void Usage(void)
@ -57,6 +65,7 @@ int main(int argc, char** argv)
{
nsComponentManager::RegisterComponent(kEventQueueServiceCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE);
nsComponentManager::RegisterComponent(kNetServiceCID, NULL, NULL, NETLIB_DLL, PR_FALSE, PR_FALSE);
nsComponentManager::RegisterComponent(kCSSParserCID, NULL, NULL, LAYOUT_DLL, PR_FALSE, PR_FALSE);
nsresult rv;
PRBool verbose = PR_FALSE;
@ -94,9 +103,13 @@ int main(int argc, char** argv)
}
// Create parser
nsICSSParser* css;
rv = NS_NewCSSParser(&css);
if (NS_OK != rv) {
nsCOMPtr<nsICSSParser> css;
rv = nsComponentManager::CreateInstance(kCSSParserCID,
nsnull,
kICSSParserIID,
getter_AddRefs(css));
if (NS_FAILED(rv)) {
printf("can't create css parser: %d\n", rv);
return -1;
}
@ -162,8 +175,6 @@ int main(int argc, char** argv)
}
}
css->Release();
/* Release the event queue for the thread */
if (nsnull != pEventQService) {
pEventQService->DestroyThreadEventQueue();