From fc4a69e9c13d7233876a0f507ebca2eec25a4215 Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Thu, 4 Feb 2010 16:35:10 +0000 Subject: When a window is closed, destroy the WebView properly so that WebCore is informed of it's destruction. Change-Id: I00002f53ec52c6056df4d7ddeec7cf0957423bd6 --- .../src/com/android/dumprendertree/TestShellActivity.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'tests/DumpRenderTree') diff --git a/tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java b/tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java index e8a66c1..2667520 100644 --- a/tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java +++ b/tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java @@ -670,7 +670,12 @@ public class TestShellActivity extends Activity implements LayoutTestController public boolean onCreateWindow(WebView view, boolean dialog, boolean userGesture, Message resultMsg) { if (!mCanOpenWindows) { - return false; + // We can't open windows, so just send null back. + WebView.WebViewTransport transport = + (WebView.WebViewTransport) resultMsg.obj; + transport.setWebView(null); + resultMsg.sendToTarget(); + return true; } // We never display the new window, just create the view and @@ -688,6 +693,11 @@ public class TestShellActivity extends Activity implements LayoutTestController resultMsg.sendToTarget(); return true; } + + @Override + public void onCloseWindow(WebView view) { + view.destroy(); + } }; private static class NewWindowWebView extends WebView { -- cgit v1.1