From 115ddd0456eebfcd183f7ffde80efa08ecf40db5 Mon Sep 17 00:00:00 2001 From: "edburns%acm.org" Date: Thu, 22 Apr 2004 06:41:02 +0000 Subject: [PATCH] Woohoo! I have loadURL working. The next step will be to get enough of CurrentPage working so that I can "selectAll" the page, and verify that the contents are loaded correctly. Ed M build-tests.xml - enable all tests M build.xml - added compile.test passthru target M classes_spec/org/mozilla/webclient/impl/wrapper_native/WindowControlImpl.java - unpack the Rectangle into final ints M src_moz/WindowControlImpl.cpp - this was causing the deadlock: the package name was wrong. The UnsatisfiedLinkError was not caught, and vanished into nowhere. M test/automated/src/classes/org/mozilla/webclient/NavigationTest.java - we must independently make the canvas visible. Hmm. Shouldn't it automatically receive setVisible() when its parent is made visible? - do cleanup git-svn-id: svn://10.0.0.236/trunk@155326 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/java/webclient/build-tests.xml | 2 +- mozilla/java/webclient/build.xml | 6 ++++++ .../impl/wrapper_native/WindowControlImpl.java | 17 ++++++++++------- .../webclient/src_moz/WindowControlImpl.cpp | 3 ++- .../org/mozilla/webclient/NavigationTest.java | 7 ++++++- 5 files changed, 25 insertions(+), 10 deletions(-) diff --git a/mozilla/java/webclient/build-tests.xml b/mozilla/java/webclient/build-tests.xml index eab2b4dba90..fa45926ad49 100644 --- a/mozilla/java/webclient/build-tests.xml +++ b/mozilla/java/webclient/build-tests.xml @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/mozilla/java/webclient/build.xml b/mozilla/java/webclient/build.xml index 83625dc333c..2642bf3434c 100644 --- a/mozilla/java/webclient/build.xml +++ b/mozilla/java/webclient/build.xml @@ -306,5 +306,11 @@ ${myenv.MOZ_JDKHOME}/bin/java ${debug.options} org.mozilla.webclient.test.Embedd + + + + + + diff --git a/mozilla/java/webclient/classes_spec/org/mozilla/webclient/impl/wrapper_native/WindowControlImpl.java b/mozilla/java/webclient/classes_spec/org/mozilla/webclient/impl/wrapper_native/WindowControlImpl.java index 7b85c43d047..8267c06f197 100644 --- a/mozilla/java/webclient/classes_spec/org/mozilla/webclient/impl/wrapper_native/WindowControlImpl.java +++ b/mozilla/java/webclient/classes_spec/org/mozilla/webclient/impl/wrapper_native/WindowControlImpl.java @@ -102,17 +102,20 @@ public void createWindow(int nativeWindow, Rectangle rect) final int nativeWin = nativeWindow; final int nativeBc = getNativeBrowserControl(); final BrowserControl bc = getBrowserControl(); - final Rectangle bounds = rect; + final int finalX = rect.x; + final int finalY = rect.y; + final int finalWidth = rect.width; + final int finalHeight = rect.height; + NativeEventThread.instance.pushBlockingWCRunnable(new WCRunnable() { public Object run() { - nativeRealize(nativeWin, nativeBc, bounds.x, - bounds.y, bounds.width, - bounds.height, bc); + + nativeRealize(nativeWin, nativeBc, finalX, + finalY, finalWidth, + finalHeight, bc); return null; } }); - - } public int getNativeWebShell() @@ -203,7 +206,7 @@ public static void main(String [] args) Log.setApplicationName("WindowControlImpl"); Log.setApplicationVersion("0.0"); - Log.setApplicationVersionDate("$Id: WindowControlImpl.java,v 1.4 2004-04-20 16:17:41 edburns%acm.org Exp $"); + Log.setApplicationVersionDate("$Id: WindowControlImpl.java,v 1.5 2004-04-22 06:41:02 edburns%acm.org Exp $"); try { org.mozilla.webclient.BrowserControlFactory.setAppData(args[0]); diff --git a/mozilla/java/webclient/src_moz/WindowControlImpl.cpp b/mozilla/java/webclient/src_moz/WindowControlImpl.cpp index 6e6764d6910..be85963353c 100644 --- a/mozilla/java/webclient/src_moz/WindowControlImpl.cpp +++ b/mozilla/java/webclient/src_moz/WindowControlImpl.cpp @@ -32,7 +32,7 @@ #include "NativeBrowserControl.h" -JNIEXPORT void JNICALL Java_org_mozilla_webclient_wrapper_1native_WindowControlImpl_nativeRealize +JNIEXPORT void JNICALL Java_org_mozilla_webclient_impl_wrapper_1native_WindowControlImpl_nativeRealize (JNIEnv *env, jobject obj, jint windowPtr, jint nativeBCPtr, jint x, jint y, jint width, jint height, jobject aBrowserControlImpl) { @@ -54,6 +54,7 @@ JNIEXPORT void JNICALL Java_org_mozilla_webclient_wrapper_1native_WindowControlI width, height); } + JNIEXPORT void JNICALL Java_org_mozilla_webclient_impl_wrapper_1native_WindowControlImpl_nativeSetBounds (JNIEnv *env, jobject obj, jint nativeBCPtr, jint x, jint y, jint w, jint h) diff --git a/mozilla/java/webclient/test/automated/src/classes/org/mozilla/webclient/NavigationTest.java b/mozilla/java/webclient/test/automated/src/classes/org/mozilla/webclient/NavigationTest.java index af1f7c9078a..65aadd7554f 100644 --- a/mozilla/java/webclient/test/automated/src/classes/org/mozilla/webclient/NavigationTest.java +++ b/mozilla/java/webclient/test/automated/src/classes/org/mozilla/webclient/NavigationTest.java @@ -1,5 +1,5 @@ /* - * $Id: NavigationTest.java,v 1.2 2004-04-20 16:17:42 edburns%acm.org Exp $ + * $Id: NavigationTest.java,v 1.3 2004-04-22 06:41:02 edburns%acm.org Exp $ */ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- @@ -69,6 +69,7 @@ public class NavigationTest extends WebclientTestCase { frame.setBounds(0, 0, 640, 480); frame.add(canvas, BorderLayout.CENTER); frame.setVisible(true); + canvas.setVisible(true); Navigation nav = (Navigation) firstBrowserControl.queryInterface(BrowserControl.NAVIGATION_NAME); @@ -78,6 +79,10 @@ public class NavigationTest extends WebclientTestCase { System.out.println("Loading url: " + testPage.toURL().toString()); nav.loadURL(testPage.toURL().toString()); + frame.setVisible(false); + BrowserControlFactory.deleteBrowserControl(firstBrowserControl); + BrowserControlFactory.appTerminate(); + } }