From d2a4ac654636d9d17da6dfa1ee79dfbfdb3ef23e Mon Sep 17 00:00:00 2001 From: Matti Tahvonen Date: Fri, 6 Nov 2009 11:09:09 +0000 Subject: [PATCH] added test case svn changeset:9662/svn branch:6.2 --- .../components/window/LongNotifications.java | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 tests/src/com/vaadin/tests/components/window/LongNotifications.java diff --git a/tests/src/com/vaadin/tests/components/window/LongNotifications.java b/tests/src/com/vaadin/tests/components/window/LongNotifications.java new file mode 100644 index 0000000000..c70c14e08e --- /dev/null +++ b/tests/src/com/vaadin/tests/components/window/LongNotifications.java @@ -0,0 +1,79 @@ +package com.vaadin.tests.components.window; + +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Window.Notification; + +public class LongNotifications extends TestBase { + private final String text = "This is a veeeery large notification in the main window which should definitly not exist at all, in any app. But they finally do in real world applications, no matter what you do. People have small screens and desperatly try to run web apps in their iphones."; + + @Override + protected String getDescription() { + return "Notifications should not be wider than the screen."; + } + + @Override + protected Integer getTicketNumber() { + return 2632; + } + + @Override + protected void setup() { + setTheme("tests-tickets"); + + Button b = new Button("Show loooong notification", + new Button.ClickListener() { + + public void buttonClick(ClickEvent event) { + + getMainWindow().showNotification( + text, + "This is description for the same notifications." + + text, + Notification.TYPE_HUMANIZED_MESSAGE); + } + }); + getLayout().addComponent(b); + + b = new Button("Show notifications", new Button.ClickListener() { + + public void buttonClick(ClickEvent event) { + + getMainWindow().showNotification("Example failed", + "This is description for the same notifications.", + Notification.TYPE_HUMANIZED_MESSAGE); + } + }); + + getLayout().addComponent(b); + + b = new Button("Show loooong notification (error)", + new Button.ClickListener() { + + public void buttonClick(ClickEvent event) { + + getMainWindow() + .showNotification( + text, + "This is description for the same notifications." + + text, + Notification.TYPE_ERROR_MESSAGE); + } + }); + getLayout().addComponent(b); + + b = new Button("Show notification (error)", new Button.ClickListener() { + + public void buttonClick(ClickEvent event) { + + getMainWindow().showNotification("Example failed", + "This is description for the same notifications.", + Notification.TYPE_ERROR_MESSAGE); + } + }); + + getLayout().addComponent(b); + + } +} -- 2.39.5