From bc5831f069f648fbf0d89a863b28d80dc4c2bf35 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leif=20=C3=85strand?= Date: Fri, 3 Aug 2012 10:35:51 +0000 Subject: [PATCH] Make LoginForm work inside iframes (#8144) Automatic test case included but not enabled because it does not currently work with IE6-8 svn changeset:24053/svn branch:6.8 --- .../statictestfiles/LoginFormIframe.html | 14 +++++ src/com/vaadin/ui/LoginForm.java | 6 +- .../loginform/LoginFormInIframe.html_disabled | 61 +++++++++++++++++++ 3 files changed, 78 insertions(+), 3 deletions(-) create mode 100644 WebContent/statictestfiles/LoginFormIframe.html create mode 100644 tests/testbench/com/vaadin/tests/components/loginform/LoginFormInIframe.html_disabled diff --git a/WebContent/statictestfiles/LoginFormIframe.html b/WebContent/statictestfiles/LoginFormIframe.html new file mode 100644 index 0000000000..0d6ee9d86b --- /dev/null +++ b/WebContent/statictestfiles/LoginFormIframe.html @@ -0,0 +1,14 @@ + + + + +LoginForm + + + +

Tests that LoginForm can be submitted even when the Application is embedded inside an iframe

+ + + \ No newline at end of file diff --git a/src/com/vaadin/ui/LoginForm.java b/src/com/vaadin/ui/LoginForm.java index 80e002435e..eb921e1e18 100644 --- a/src/com/vaadin/ui/LoginForm.java +++ b/src/com/vaadin/ui/LoginForm.java @@ -94,8 +94,8 @@ public class LoginForm extends CustomComponent { }; private URIHandler uriHandler = new URIHandler() { - private final String responce = "Login form handeled." - + ""; public DownloadStream handleURI(URL context, String relativeUri) { @@ -104,7 +104,7 @@ public class LoginForm extends CustomComponent { window.removeURIHandler(this); } DownloadStream downloadStream = new DownloadStream( - new ByteArrayInputStream(responce.getBytes()), + new ByteArrayInputStream(response.getBytes()), "text/html", "loginSuccesfull"); downloadStream.setCacheTime(-1); return downloadStream; diff --git a/tests/testbench/com/vaadin/tests/components/loginform/LoginFormInIframe.html_disabled b/tests/testbench/com/vaadin/tests/components/loginform/LoginFormInIframe.html_disabled new file mode 100644 index 0000000000..075bb3c57f --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/loginform/LoginFormInIframe.html_disabled @@ -0,0 +1,61 @@ + + + + + + +LoginFormTest + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LoginFormTest
open/statictestfiles/LoginFormIframe.html
selectFrameLoginForm
selectFramePID6
enterCharacterusernameusername
enterCharacterpasswordpassword
click//form[@id='loginf']/div[5]/div/span/span
selectFramerelative=top
selectFrameLoginForm
assertTextvaadin=runcomvaadintestscomponentsloginformLoginFormTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]User 'username', password='password' logged in
+ + -- 2.39.5