]> source.dussan.org Git - vaadin-framework.git/commitdiff
added test case
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Mon, 22 Sep 2008 09:40:47 +0000 (09:40 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Mon, 22 Sep 2008 09:40:47 +0000 (09:40 +0000)
svn changeset:5474/svn branch:trunk

WebContent/statictestfiles/ticket2095.html [new file with mode: 0644]
WebContent/statictestfiles/ticket2095_popup.html [new file with mode: 0644]
src/com/itmill/toolkit/tests/tickets/Ticket2095.java [new file with mode: 0644]

diff --git a/WebContent/statictestfiles/ticket2095.html b/WebContent/statictestfiles/ticket2095.html
new file mode 100644 (file)
index 0000000..228c9e0
--- /dev/null
@@ -0,0 +1,25 @@
+<html>
+<head>
+<script type="text/javascript">
+
+function openPopup() {
+       // possible workaround if IEmbedded was not modified to add name
+       // window.name = "foo";
+       var popup = window.open('ticket2095_popup.html','mypopup');
+       popup._parentName = this.name;
+}
+</script>
+</head>
+<body>
+<p>
+This is file is part of test case for #2095. Embedded.TYPE_BROWSER like iframes 
+wants to have name, so popups opened by them may submit forms into them.
+
+</p>
+
+
+<a href="#" onclick="openPopup();">Open popup, will hit debuggger;</a>
+
+</body>
+
+</html>
\ No newline at end of file
diff --git a/WebContent/statictestfiles/ticket2095_popup.html b/WebContent/statictestfiles/ticket2095_popup.html
new file mode 100644 (file)
index 0000000..863b35a
--- /dev/null
@@ -0,0 +1,24 @@
+<html>
+
+<head>
+<script type="text/javascript">
+
+function setTarget() {
+       document.forms[0].target = _parentName;
+}
+</script>
+</head>
+
+<body onload="setTarget();">
+
+<p>Popup
+</p>
+
+<form action="http://www.google.fi/search">
+<input type="text" name="q" value="it mill toolkit" />
+<input type="submit" value="Google!"/>
+</form>
+
+</body>
+
+</html>
\ No newline at end of file
diff --git a/src/com/itmill/toolkit/tests/tickets/Ticket2095.java b/src/com/itmill/toolkit/tests/tickets/Ticket2095.java
new file mode 100644 (file)
index 0000000..bf0b834
--- /dev/null
@@ -0,0 +1,28 @@
+package com.itmill.toolkit.tests.tickets;\r
+\r
+import com.itmill.toolkit.Application;\r
+import com.itmill.toolkit.terminal.ExternalResource;\r
+import com.itmill.toolkit.ui.Embedded;\r
+import com.itmill.toolkit.ui.Window;\r
+\r
+public class Ticket2095 extends Application {\r
+\r
+    public void init() {\r
+        Window w = new Window(getClass().getSimpleName());\r
+        setMainWindow(w);\r
+\r
+        // uncomment to workaround iorderedlayout bug in current trunk\r
+        // w.setLayout(new ExpandLayout());\r
+        w.getLayout().setSizeFull();\r
+\r
+        Embedded em = new Embedded();\r
+        em.setType(Embedded.TYPE_BROWSER);\r
+        em.setSource(new ExternalResource("/statictestfiles/ticket2095.html"));\r
+        em.setDebugId("MYIFRAME");\r
+\r
+        em.setSizeFull();\r
+\r
+        w.addComponent(em);\r
+\r
+    }\r
+}\r