Thanks again to Michael Klepikov for these fixes.

M dom/jni/org_mozilla_dom_NodeImpl.cpp

- code around the absence of LowerCaseEqualsLiteral in nsTAString.h.
  I'm surprised the unit tests worked for me all aloung though.

M webclient/build.xml

- make run.test.browser depend on "main"

M webclient/src_moz/EmbedProgress.cpp

- deal with null URL passed to ::OnStateChange

M webclient/src_moz/HistoryImpl.cpp

- Don't cast to PRBool* when you don't need to.

M webclient/test/manual/src/classes/org/mozilla/webclient/test/TestBrowser.java

- don't swallow the exception from setAppData().


git-svn-id: svn://10.0.0.236/trunk@160299 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
edburns%acm.org
2004-08-03 17:16:57 +00:00
parent 0add72333a
commit 3fd0db98ed
5 changed files with 19 additions and 14 deletions

View File

@@ -304,7 +304,7 @@ ${myenv.MOZ_JDKHOME}/bin/java ${debug.options} org.mozilla.webclient.test.Embedd
</target>
<target name="run.test.browser" description="Run the test browser">
<target name="run.test.browser" depends="main" description="Run the test browser">
<ant antfile="build-tests.xml" target="run.test.browser"/>

View File

@@ -92,7 +92,9 @@ EmbedProgress::OnStateChange(nsIWebProgress *aWebProgress,
nsXPIDLCString uriString;
RequestToURIString(aRequest, getter_Copies(uriString));
jstring uriJstr = ::util_NewStringUTF(env, (const char *) uriString);
const char * uriCStr = (const char *) uriString;
jstring uriJstr = ::util_NewStringUTF(env, (nsnull != uriCStr
? uriCStr : ""));
PR_LOG(prLogModuleInfo, PR_LOG_DEBUG,
("EmbedProgress::OnStateChange: URI: %s\n",

View File

@@ -67,16 +67,16 @@ JNICALL Java_org_mozilla_webclient_impl_wrapper_1native_HistoryImpl_nativeCanBac
if (nativeBrowserControl == nsnull) {
::util_ThrowExceptionToJava(env, "Exception: null nativeBCPtr passed to nativeCanBack");
return (result == PR_TRUE) ? JNI_TRUE : JNI_FALSE;
return result ? JNI_TRUE : JNI_FALSE;
}
nsresult rv =
nativeBrowserControl->mNavigation->GetCanGoBack((PRBool *) &result);
nativeBrowserControl->mNavigation->GetCanGoBack(&result);
if (NS_FAILED(rv)) {
::util_ThrowExceptionToJava(env, "Exception: Can't GetCanGoBack");
}
return (result == PR_TRUE) ? JNI_TRUE : JNI_FALSE;
return result ? JNI_TRUE : JNI_FALSE;
}
JNIEXPORT void JNICALL
@@ -106,7 +106,7 @@ JNIEXPORT jboolean
JNICALL Java_org_mozilla_webclient_impl_wrapper_1native_HistoryImpl_nativeCanForward
(JNIEnv *env, jobject obj, jint nativeBCPtr)
{
PRBool result = JNI_FALSE;
PRBool result = PR_FALSE;
JNIEnv * pEnv = env;
jobject jobj = obj;
@@ -114,16 +114,16 @@ JNICALL Java_org_mozilla_webclient_impl_wrapper_1native_HistoryImpl_nativeCanFor
if (nativeBrowserControl == nsnull) {
::util_ThrowExceptionToJava(env, "Exception: null nativeBCPtr passed to nativeCanForward");
return (result == PR_TRUE) ? JNI_TRUE : JNI_FALSE;
return result ? JNI_TRUE : JNI_FALSE;
}
nsresult rv =
nativeBrowserControl->mNavigation->GetCanGoForward((PRBool *) &result);
nativeBrowserControl->mNavigation->GetCanGoForward(&result);
if (NS_FAILED(rv)) {
::util_ThrowExceptionToJava(env, "Exception: Can't GetCanGoForward");
}
return (result == PR_TRUE) ? JNI_TRUE : JNI_FALSE;
return result ? JNI_TRUE : JNI_FALSE;
}

View File

@@ -92,7 +92,10 @@ public class TestBrowser extends JPanel {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
BrowserControlFactory.setAppData(System.getProperty("BROWSER_BIN_DIR"));
} catch (Exception e) {}
} catch (Exception e) {
System.out.println("Can't init test browser, exception: " + e + " "
+ e.getMessage());
}
JFrame frame = new JFrame("Webclient API Demo - Browser");