From 86dc3dbb6dd340a692cf2f015cf1cbe440e4877f Mon Sep 17 00:00:00 2001 From: "edburns%acm.org" Date: Mon, 23 Feb 2004 06:26:54 +0000 Subject: [PATCH] Make webclient compile with Mozilla 1.6. Unit tests still don't run. M README - update instructions for building and running source and unit tests M build.properties.sample - you need junit.jar M webclient/build-tests.xml - reformat M webclient/build.xml - add "prepare" target to set the PATH_SEP M webclient/src_ie/BookmarksImpl.cpp M webclient/src_ie/CurrentPageImpl.cpp M webclient/src_ie/HistoryImpl.cpp - Account for new javah header names M webclient/src_moz/Makefile.in - account for new location of jawt.lib in J2SDK 1.4.2 M webclient/src_moz/NativeEventThread.cpp +#include "nsEmbedAPI.h" // for NS_HandleEmbeddingEvent M webclient/src_moz/NavigationActionEvents.cpp - result is an nsIInputStream M webclient/src_moz/WrapperFactoryImpl.cpp +#include // for nsDependentCString and the compile is more strict now. M webclient/src_moz/dom_util.cpp - signature change git-svn-id: svn://10.0.0.236/trunk@153091 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/java/README | 24 ++- mozilla/java/build.properties.sample | 3 + mozilla/java/webclient/build-tests.xml | 157 +----------------- mozilla/java/webclient/build.xml | 25 ++- .../java/webclient/src_ie/BookmarksImpl.cpp | 2 +- .../java/webclient/src_ie/CurrentPageImpl.cpp | 2 +- mozilla/java/webclient/src_ie/HistoryImpl.cpp | 2 +- mozilla/java/webclient/src_moz/Makefile.in | 2 +- .../webclient/src_moz/NativeEventThread.cpp | 1 + .../src_moz/NavigationActionEvents.cpp | 4 +- .../webclient/src_moz/WrapperFactoryImpl.cpp | 2 +- mozilla/java/webclient/src_moz/dom_util.cpp | 2 +- 12 files changed, 53 insertions(+), 173 deletions(-) diff --git a/mozilla/java/README b/mozilla/java/README index 64c70bde04e..2f85d58c114 100644 --- a/mozilla/java/README +++ b/mozilla/java/README @@ -1,4 +1,4 @@ -20030713 +20040222 This README documents the Java Enhancers to the Mozilla web browser. @@ -10,9 +10,10 @@ Requirements: * J2SDK 1.3.1 or later -* Apache ant +* Apache ant 1.4.1 or later. If running under J2SDK 1.4.2 or later, you + need ant 1.6.1, due to javah issues. -* Successfully built debug enabled Mozilla 1.4 tree +* Successfully built debug enabled Mozilla 1.6 tree How To Build: @@ -46,6 +47,23 @@ compile.debug=true * run "ant" in the mozilla/java directory. This will build webclient and all dependent libraries. +How to run the Junit tests: + +* Make sure junit.jar is properly set in your mozilla/java/build.properties + +* Make sure junit.jar is installed in your $ANT_HOME/lib directory + +* Set the following variables in your environment + +NSPR_LOG_MODULES="webclient:4,webclientstub:4" +NSPR_LOG_FILE="logfile.txt" + +* cd to mozilla/java/webclient + +* run ant test + +How to run the test browser (broken as of this writing): + * cd to mozilla/java/webclient/src_moz and run the "runem" batch file to run the test browser. diff --git a/mozilla/java/build.properties.sample b/mozilla/java/build.properties.sample index e3aeafe06b1..6e74a773a76 100644 --- a/mozilla/java/build.properties.sample +++ b/mozilla/java/build.properties.sample @@ -9,3 +9,6 @@ build.win32.classes=true # On win32, make sure to use \\ for \ build.home=/home/edburns/Projects/mozilla/NETSCAPE_7_0_RTM_RELEASE/mozilla/dist/classes + +# dependent jars +junit.jar= diff --git a/mozilla/java/webclient/build-tests.xml b/mozilla/java/webclient/build-tests.xml index d14891e403a..c3b6f4ea208 100644 --- a/mozilla/java/webclient/build-tests.xml +++ b/mozilla/java/webclient/build-tests.xml @@ -1,156 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/mozilla/java/webclient/build.xml b/mozilla/java/webclient/build.xml index 0dac594de29..62d53cbfdff 100644 --- a/mozilla/java/webclient/build.xml +++ b/mozilla/java/webclient/build.xml @@ -60,8 +60,24 @@ + + + + + + + + + + + + + + + + + depends="prepare,compile.classes_spec,compile.src_share,compile.src_moz,compile.src_ie,create.webclient.scripts"/> @@ -148,18 +164,15 @@ - + diff --git a/mozilla/java/webclient/src_ie/BookmarksImpl.cpp b/mozilla/java/webclient/src_ie/BookmarksImpl.cpp index 35a71ca4747..012177600a6 100644 --- a/mozilla/java/webclient/src_ie/BookmarksImpl.cpp +++ b/mozilla/java/webclient/src_ie/BookmarksImpl.cpp @@ -20,7 +20,7 @@ * Contributor(s): Glenn Barney */ -#include "BookmarksImpl.h" +#include "org_mozilla_webclient_impl_wrapper_0005fnative_BookmarksImpl.h" JNIEXPORT void JNICALL diff --git a/mozilla/java/webclient/src_ie/CurrentPageImpl.cpp b/mozilla/java/webclient/src_ie/CurrentPageImpl.cpp index c9ef809300f..6f95a3ba669 100644 --- a/mozilla/java/webclient/src_ie/CurrentPageImpl.cpp +++ b/mozilla/java/webclient/src_ie/CurrentPageImpl.cpp @@ -25,7 +25,7 @@ * CurrentPageImpl.cpp */ -#include "CurrentPageImpl.h" +#include "org_mozilla_webclient_impl_wrapper_0005fnative_CurrentPageImpl.h" diff --git a/mozilla/java/webclient/src_ie/HistoryImpl.cpp b/mozilla/java/webclient/src_ie/HistoryImpl.cpp index aa0498ef422..70fcb01d445 100644 --- a/mozilla/java/webclient/src_ie/HistoryImpl.cpp +++ b/mozilla/java/webclient/src_ie/HistoryImpl.cpp @@ -21,7 +21,7 @@ * Ron Capelli */ -#include "HistoryImpl.h" +#include "org_mozilla_webclient_impl_wrapper_0005fnative_HistoryImpl.h" #include "ie_util.h" #include "ie_globals.h" diff --git a/mozilla/java/webclient/src_moz/Makefile.in b/mozilla/java/webclient/src_moz/Makefile.in index 22030a1dcb4..00eb6ac9059 100644 --- a/mozilla/java/webclient/src_moz/Makefile.in +++ b/mozilla/java/webclient/src_moz/Makefile.in @@ -143,7 +143,7 @@ EXTRA_LIBS += \ ifeq ($(OS_ARCH),WINNT) EXTRA_LIBS += \ $(DIST)/lib/wc_share.lib \ - $(MOZ_JDKHOME)/jre/lib/jawt.lib \ + $(MOZ_JDKHOME)/lib/jawt.lib \ $(NULL) endif diff --git a/mozilla/java/webclient/src_moz/NativeEventThread.cpp b/mozilla/java/webclient/src_moz/NativeEventThread.cpp index e61a7f08f91..9ba45cadb38 100644 --- a/mozilla/java/webclient/src_moz/NativeEventThread.cpp +++ b/mozilla/java/webclient/src_moz/NativeEventThread.cpp @@ -50,6 +50,7 @@ #include "nsISHistory.h" // for sHistory #include "nsIThread.h" // for PRThread #include "nsIDocShell.h" +#include "nsEmbedAPI.h" // for NS_HandleEmbeddingEvent #include "nsIBaseWindow.h" #include "nsIDocShellTreeItem.h" #include "nsIEventQueueService.h" diff --git a/mozilla/java/webclient/src_moz/NavigationActionEvents.cpp b/mozilla/java/webclient/src_moz/NavigationActionEvents.cpp index d852cf9b68c..a42423a74c6 100644 --- a/mozilla/java/webclient/src_moz/NavigationActionEvents.cpp +++ b/mozilla/java/webclient/src_moz/NavigationActionEvents.cpp @@ -263,7 +263,7 @@ wsPostEvent::handleEvent () nsCOMPtr doc; nsCOMPtr content; nsCOMPtr lh; - nsCOMPtr result; + nsCOMPtr result; rv = mInitContext->docShell->GetPresShell(getter_AddRefs(presShell)); if (NS_FAILED(rv) || !presShell) { @@ -275,7 +275,7 @@ wsPostEvent::handleEvent () return (void *) rv; } - rv = doc->GetRootContent(getter_AddRefs(content)); + content = doc->GetRootContent(); if (NS_FAILED(rv) || !content) { return (void *) rv; } diff --git a/mozilla/java/webclient/src_moz/WrapperFactoryImpl.cpp b/mozilla/java/webclient/src_moz/WrapperFactoryImpl.cpp index e87407cef80..9538bf73366 100644 --- a/mozilla/java/webclient/src_moz/WrapperFactoryImpl.cpp +++ b/mozilla/java/webclient/src_moz/WrapperFactoryImpl.cpp @@ -36,6 +36,7 @@ #include #include // for NS_InitEmbedding #include +#include // for nsDependentCString #include // for PR_SetEnv @@ -256,7 +257,6 @@ Java_org_mozilla_webclient_impl_wrapper_1native_WrapperFactoryImpl_nativeTermina if (NS_FAILED(rv)) { ::util_ThrowExceptionToJava(env, "NS_TermEmbedding() failed."); - return (jint) rv; } PR_LOG(prLogModuleInfo, PR_LOG_DEBUG, diff --git a/mozilla/java/webclient/src_moz/dom_util.cpp b/mozilla/java/webclient/src_moz/dom_util.cpp index d8c70af0b19..1e9ae3e72f7 100644 --- a/mozilla/java/webclient/src_moz/dom_util.cpp +++ b/mozilla/java/webclient/src_moz/dom_util.cpp @@ -102,7 +102,7 @@ nsCOMPtr dom_getDocumentFromDocShell(nsIDocShell *docShell) return result; } - rv = docv->GetDocument(document); + rv = docv->GetDocument(&document); if (NS_FAILED(rv) || !document) { return result; }