Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTim Buschtöns2010-11-18 19:50:17 +0000
committerTim Buschtöns2010-11-18 19:50:17 +0000
commit46e025413988adea903cd4680adb02c2d4dfc97d (patch)
tree6bae471916f6ab86f8dd79dd95125e672756e2e8 /tests
parent2acfbef6f3417afb6c0a2c0839add958c04e21c3 (diff)
downloadorg.eclipse.rap-46e025413988adea903cd4680adb02c2d4dfc97d.tar.gz
org.eclipse.rap-46e025413988adea903cd4680adb02c2d4dfc97d.tar.xz
org.eclipse.rap-46e025413988adea903cd4680adb02c2d4dfc97d.zip
Fix for Bug 327440 - Memory leak problem with Iframe in Internet Explorer
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.rap.rwt.jstest/index.html1
-rw-r--r--tests/org.eclipse.rap.rwt.jstest/js/org/eclipse/rwt/test/tests/BrowserTest.js57
-rw-r--r--tests/org.eclipse.rap.rwt.q07.jstest/index.html1
-rw-r--r--tests/org.eclipse.rap.rwt.q07.jstest/js/org/eclipse/rwt/test/tests/BrowserTest.js57
4 files changed, 116 insertions, 0 deletions
diff --git a/tests/org.eclipse.rap.rwt.jstest/index.html b/tests/org.eclipse.rap.rwt.jstest/index.html
index ea230cc950..ba911d7a2b 100644
--- a/tests/org.eclipse.rap.rwt.jstest/index.html
+++ b/tests/org.eclipse.rap.rwt.jstest/index.html
@@ -15,6 +15,7 @@
<!-- Tests -->
<script src="./js/org/eclipse/rwt/test/tests/TestUtilTest.js" type="text/javascript"></script>
<script src="./js/org/eclipse/rwt/test/tests/HtmlUtilTest.js" type="text/javascript"></script>
+ <script src="./js/org/eclipse/rwt/test/tests/BrowserTest.js" type="text/javascript"></script>
<script src="./js/org/eclipse/rwt/test/tests/SliderTest.js" type="text/javascript"></script>
<script src="./js/org/eclipse/rwt/test/tests/SpinnerTest.js" type="text/javascript"></script>
<script src="./js/org/eclipse/rwt/test/tests/CalendarTest.js" type="text/javascript"></script>
diff --git a/tests/org.eclipse.rap.rwt.jstest/js/org/eclipse/rwt/test/tests/BrowserTest.js b/tests/org.eclipse.rap.rwt.jstest/js/org/eclipse/rwt/test/tests/BrowserTest.js
new file mode 100644
index 0000000000..f2f9c27cc6
--- /dev/null
+++ b/tests/org.eclipse.rap.rwt.jstest/js/org/eclipse/rwt/test/tests/BrowserTest.js
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2010 EclipseSource and others. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * EclipseSource - initial API and implementation
+ ******************************************************************************/
+
+qx.Class.define( "org.eclipse.rwt.test.tests.BrowserTest", {
+ extend : qx.core.Object,
+
+ members : {
+ BLANK : "../org.eclipse.rap.rwt.q07/resources/resource/static/html/blank.html",
+
+ // TODO [tb] : Real meaningful tests for the browser widget can only be
+ // written after fixing Bug 330583.
+
+ testDispose : function() {
+ // See Bug 327440 - Memory leak problem with Iframe in Internet Explorer
+ var testUtil = org.eclipse.rwt.test.fixture.TestUtil;
+ // We will dispatch the load event ourselves.
+ var loadOrg = qx.ui.embed.Iframe.load;
+ qx.ui.embed.Iframe.load = function(){};
+ var wm = org.eclipse.swt.WidgetManager.getInstance();
+ var browser = new org.eclipse.swt.browser.Browser();
+ wm.add( browser, "w6", true );
+ browser.addToDocument();
+ browser.addState( "rwt_BORDER" );
+ browser.setSpace( 10, 576, 57, 529 );
+ browser.setSource( this.BLANK );
+ testUtil.flush();
+ assertTrue( browser.isSeeable() );
+ var el = browser._getTargetNode();
+ var iframe = browser._iframeNode;
+ qx.ui.embed.Iframe.load( iframe );
+ assertTrue( iframe.parentNode === el );
+ wm.dispose( "w6" );
+ testUtil.flush();
+ assertFalse( browser.isDisposed() );
+ assertTrue( wm.findWidgetById( "w6" ) == null ); /* may be undefined */
+ assertEquals( "javascript:false;", browser.getSource() );
+ assertIdentical( testUtil.getDocument(), browser.getParent() );
+ assertTrue( browser.isSeeable() );
+ browser.createDispatchEvent( "load" );
+ testUtil.flush();
+ assertTrue( "disposed?", browser.isDisposed() );
+ assertTrue( el.innerHTML === "" );
+ assertTrue( iframe.parentNode == null );
+ var loadOrg = qx.ui.embed.Iframe.load;
+ browser.destroy();
+ }
+
+ }
+
+} ); \ No newline at end of file
diff --git a/tests/org.eclipse.rap.rwt.q07.jstest/index.html b/tests/org.eclipse.rap.rwt.q07.jstest/index.html
index ea230cc950..ba911d7a2b 100644
--- a/tests/org.eclipse.rap.rwt.q07.jstest/index.html
+++ b/tests/org.eclipse.rap.rwt.q07.jstest/index.html
@@ -15,6 +15,7 @@
<!-- Tests -->
<script src="./js/org/eclipse/rwt/test/tests/TestUtilTest.js" type="text/javascript"></script>
<script src="./js/org/eclipse/rwt/test/tests/HtmlUtilTest.js" type="text/javascript"></script>
+ <script src="./js/org/eclipse/rwt/test/tests/BrowserTest.js" type="text/javascript"></script>
<script src="./js/org/eclipse/rwt/test/tests/SliderTest.js" type="text/javascript"></script>
<script src="./js/org/eclipse/rwt/test/tests/SpinnerTest.js" type="text/javascript"></script>
<script src="./js/org/eclipse/rwt/test/tests/CalendarTest.js" type="text/javascript"></script>
diff --git a/tests/org.eclipse.rap.rwt.q07.jstest/js/org/eclipse/rwt/test/tests/BrowserTest.js b/tests/org.eclipse.rap.rwt.q07.jstest/js/org/eclipse/rwt/test/tests/BrowserTest.js
new file mode 100644
index 0000000000..f2f9c27cc6
--- /dev/null
+++ b/tests/org.eclipse.rap.rwt.q07.jstest/js/org/eclipse/rwt/test/tests/BrowserTest.js
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2010 EclipseSource and others. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * EclipseSource - initial API and implementation
+ ******************************************************************************/
+
+qx.Class.define( "org.eclipse.rwt.test.tests.BrowserTest", {
+ extend : qx.core.Object,
+
+ members : {
+ BLANK : "../org.eclipse.rap.rwt.q07/resources/resource/static/html/blank.html",
+
+ // TODO [tb] : Real meaningful tests for the browser widget can only be
+ // written after fixing Bug 330583.
+
+ testDispose : function() {
+ // See Bug 327440 - Memory leak problem with Iframe in Internet Explorer
+ var testUtil = org.eclipse.rwt.test.fixture.TestUtil;
+ // We will dispatch the load event ourselves.
+ var loadOrg = qx.ui.embed.Iframe.load;
+ qx.ui.embed.Iframe.load = function(){};
+ var wm = org.eclipse.swt.WidgetManager.getInstance();
+ var browser = new org.eclipse.swt.browser.Browser();
+ wm.add( browser, "w6", true );
+ browser.addToDocument();
+ browser.addState( "rwt_BORDER" );
+ browser.setSpace( 10, 576, 57, 529 );
+ browser.setSource( this.BLANK );
+ testUtil.flush();
+ assertTrue( browser.isSeeable() );
+ var el = browser._getTargetNode();
+ var iframe = browser._iframeNode;
+ qx.ui.embed.Iframe.load( iframe );
+ assertTrue( iframe.parentNode === el );
+ wm.dispose( "w6" );
+ testUtil.flush();
+ assertFalse( browser.isDisposed() );
+ assertTrue( wm.findWidgetById( "w6" ) == null ); /* may be undefined */
+ assertEquals( "javascript:false;", browser.getSource() );
+ assertIdentical( testUtil.getDocument(), browser.getParent() );
+ assertTrue( browser.isSeeable() );
+ browser.createDispatchEvent( "load" );
+ testUtil.flush();
+ assertTrue( "disposed?", browser.isDisposed() );
+ assertTrue( el.innerHTML === "" );
+ assertTrue( iframe.parentNode == null );
+ var loadOrg = qx.ui.embed.Iframe.load;
+ browser.destroy();
+ }
+
+ }
+
+} ); \ No newline at end of file

Back to the top