summaryrefslogtreecommitdiffstats
path: root/tests/src
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2011-08-10 12:21:17 +0000
committerLeif Åstrand <leif@vaadin.com>2011-08-10 12:21:17 +0000
commit7e52432e5bb508f85029eae229fa956d4f9ecb3b (patch)
tree1b180af18fdadfa3e0b82e0ed5d31da2b3afc7a8 /tests/src
parent6a908bd12073555eaeb5c92b697090f8d605c79e (diff)
downloadvaadin-framework-7e52432e5bb508f85029eae229fa956d4f9ecb3b.tar.gz
vaadin-framework-7e52432e5bb508f85029eae229fa956d4f9ecb3b.zip
#6097 Added support for htmlModeAllowed in notifications opened from a sub window
svn changeset:20270/svn branch:6.7
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.html56
-rw-r--r--tests/src/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.java29
2 files changed, 75 insertions, 10 deletions
diff --git a/tests/src/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.html b/tests/src/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.html
index a6a40224f7..b4d76edae9 100644
--- a/tests/src/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.html
+++ b/tests/src/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.html
@@ -18,37 +18,77 @@
</tr>
<tr>
<td>click</td>
- <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsHtmlAllowed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsHtmlAllowed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VButton[0]/domChild[0]/domChild[0]</td>
<td></td>
</tr>
<tr>
<td>screenCapture</td>
<td></td>
- <td>html</td>
+ <td>view-html</td>
</tr>
<tr>
<td>closeNotification</td>
- <td>//body/div[2]</td>
+ <td>//body/div[4]</td>
<td>0,0</td>
</tr>
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsnotificationNotificationsHtmlAllowed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VCheckBox[0]/domChild[0]</td>
- <td>66,2</td>
+ <td>60,0</td>
</tr>
<tr>
<td>click</td>
- <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsHtmlAllowed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsHtmlAllowed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VButton[0]/domChild[0]/domChild[0]</td>
<td></td>
</tr>
<tr>
<td>screenCapture</td>
- <td><br /></td>
- <td>plain</td>
+ <td></td>
+ <td>view-plain</td>
+</tr>
+<tr>
+ <td>closeNotification</td>
+ <td>//body/div[4]</td>
+ <td>0,0</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsHtmlAllowed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VCheckBox[0]/domChild[0]</td>
+ <td>51,7</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsHtmlAllowed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>window-plain</td>
+</tr>
+<tr>
+ <td>closeNotification</td>
+ <td>//body/div[4]</td>
+ <td>0,0</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsHtmlAllowed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VCheckBox[0]/domChild[0]</td>
+ <td>80,2</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsHtmlAllowed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>window-html</td>
</tr>
<tr>
<td>closeNotification</td>
- <td>//body/div[2]</td>
+ <td>//body/div[4]</td>
<td>0,0</td>
</tr>
</tbody></table>
diff --git a/tests/src/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.java b/tests/src/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.java
index 58f6c12f44..d4f153d301 100644
--- a/tests/src/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.java
+++ b/tests/src/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.java
@@ -7,6 +7,7 @@ import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.TextArea;
import com.vaadin.ui.TextField;
+import com.vaadin.ui.Window;
import com.vaadin.ui.Window.Notification;
public class NotificationsHtmlAllowed extends TestBase implements ClickListener {
@@ -14,19 +15,32 @@ public class NotificationsHtmlAllowed extends TestBase implements ClickListener
private TextArea messageField;
private CheckBox htmlAllowedBox;
private TextField captionField;
+ private Window subwindow;
+ private CheckBox showInSubwindow;
@Override
protected void setup() {
captionField = new TextField("Caption", "Hello <u>world</u>");
addComponent(captionField);
+
messageField = new TextArea("Message",
"Hello <i>world</i>\nWith a newline <br/>And a html line break");
messageField.setRows(10);
addComponent(messageField);
+
htmlAllowedBox = new CheckBox("Html content allowed", true);
addComponent(htmlAllowedBox);
+
+ showInSubwindow = new CheckBox("Show in subwindow", false);
+ addComponent(showInSubwindow);
+
Button showNotification = new Button("Show notification", this);
addComponent(showNotification);
+
+ subwindow = new Window("Sub window");
+ subwindow.setPositionX(400);
+ subwindow.setPositionY(0);
+ getMainWindow().addWindow(subwindow);
}
@Override
@@ -40,11 +54,22 @@ public class NotificationsHtmlAllowed extends TestBase implements ClickListener
}
public void buttonClick(ClickEvent event) {
+ Notification n = makeNotification();
+ Window window;
+ if (showInSubwindow.booleanValue()) {
+ window = subwindow;
+ } else {
+ window = event.getButton().getWindow();
+ }
+ window.showNotification(n);
+
+ }
+
+ private Notification makeNotification() {
Notification n = new Notification((String) captionField.getValue(),
(String) messageField.getValue(),
Notification.TYPE_HUMANIZED_MESSAGE,
htmlAllowedBox.booleanValue());
- event.getButton().getWindow().showNotification(n);
-
+ return n;
}
}