From 0392492c8ee84c203e2127456271f357e8ac6b10 Mon Sep 17 00:00:00 2001 From: "sspitzer%netscape.com" Date: Thu, 27 May 1999 02:41:16 +0000 Subject: [PATCH] fixed this test to go through the component manager. turn it back on. git-svn-id: svn://10.0.0.236/trunk@32852 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/html/Makefile.in | 2 +- mozilla/layout/html/tests/Makefile.in | 1 - mozilla/layout/html/tests/TestCSSParser.cpp | 23 +++++++++++++++------ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/mozilla/layout/html/Makefile.in b/mozilla/layout/html/Makefile.in index 03188624065..e122af8e1bc 100644 --- a/mozilla/layout/html/Makefile.in +++ b/mozilla/layout/html/Makefile.in @@ -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 diff --git a/mozilla/layout/html/tests/Makefile.in b/mozilla/layout/html/tests/Makefile.in index 8ebaedd9c5f..56996ca23a1 100644 --- a/mozilla/layout/html/tests/Makefile.in +++ b/mozilla/layout/html/tests/Makefile.in @@ -36,7 +36,6 @@ include $(topsrcdir)/config/config.mk SIMPLE_PROGRAMS = $(addprefix $(OBJDIR)/, $(CPPSRCS:.cpp=)) LIBS = \ - -lraptorhtml \ -limg \ $(PNG_LIBS) \ $(JPEG_LIBS) \ diff --git a/mozilla/layout/html/tests/TestCSSParser.cpp b/mozilla/layout/html/tests/TestCSSParser.cpp index f0f7aade06f..63933b7945b 100644 --- a/mozilla/layout/html/tests/TestCSSParser.cpp +++ b/mozilla/layout/html/tests/TestCSSParser.cpp @@ -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 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();