diff options
author | Marc Englund <marc@vaadin.com> | 2012-10-12 11:58:47 +0000 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2012-10-12 11:58:47 +0000 |
commit | 29d1b00aa5cfa81a9a945e492ac408554c100ab8 (patch) | |
tree | e17d121c1d6a31698e3ea49fc8ab6b06563fc088 /uitest/src/com/vaadin | |
parent | 316e99e47b20951c187cd4ff2220c0c7e3be24cf (diff) | |
parent | f2d4abba38a8d9d3bfea780254c3f65f030f7a17 (diff) | |
download | vaadin-framework-29d1b00aa5cfa81a9a945e492ac408554c100ab8.tar.gz vaadin-framework-29d1b00aa5cfa81a9a945e492ac408554c100ab8.zip |
Merge "Fixed primary stylename handling for CustomLayout #9902"
Diffstat (limited to 'uitest/src/com/vaadin')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/customlayout/CustomLayoutPrimaryStyleName.html | 47 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/customlayout/CustomLayoutPrimaryStyleName.java | 51 |
2 files changed, 98 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/customlayout/CustomLayoutPrimaryStyleName.html b/uitest/src/com/vaadin/tests/components/customlayout/CustomLayoutPrimaryStyleName.html new file mode 100644 index 0000000000..0a5654bb1f --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/customlayout/CustomLayoutPrimaryStyleName.html @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<link rel="selenium.base" href="http://localhost:8888/" /> +<title>New Test</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">New Test</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.customlayout.CustomLayoutPrimaryStyleName?restartApplication</td> + <td></td> +</tr> +<tr> + <td>assertNotCSSClass</td> + <td>vaadin=runcomvaadintestscomponentscustomlayoutCustomLayoutPrimaryStyleName::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCustomLayout[0]/</td> + <td>v-customlayout</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentscustomlayoutCustomLayoutPrimaryStyleName::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCustomLayout[0]/</td> + <td>my-customlayout</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentscustomlayoutCustomLayoutPrimaryStyleName::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertNotCSSClass</td> + <td>vaadin=runcomvaadintestscomponentscustomlayoutCustomLayoutPrimaryStyleName::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCustomLayout[0]/</td> + <td>my-customlayout</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentscustomlayoutCustomLayoutPrimaryStyleName::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCustomLayout[0]/</td> + <td>my-second-customlayout</td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/components/customlayout/CustomLayoutPrimaryStyleName.java b/uitest/src/com/vaadin/tests/components/customlayout/CustomLayoutPrimaryStyleName.java new file mode 100644 index 0000000000..f0dc711f48 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/customlayout/CustomLayoutPrimaryStyleName.java @@ -0,0 +1,51 @@ +package com.vaadin.tests.components.customlayout; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; + +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.CustomLayout; +import com.vaadin.ui.TextField; + +public class CustomLayoutPrimaryStyleName extends TestBase { + + @Override + protected void setup() { + InputStream is = new ByteArrayInputStream( + "<div location='loc1'>".getBytes()); + try { + final CustomLayout cl = new CustomLayout(is); + + cl.addComponent(new TextField("Hello world"), "loc1"); + + cl.setPrimaryStyleName("my-customlayout"); + addComponent(cl); + + addComponent(new Button("Set primary stylename", + new Button.ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + cl.setPrimaryStyleName("my-second-customlayout"); + } + })); + + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + @Override + protected String getDescription() { + return "CustomLayout should support primary stylenames both initially and dynamically"; + } + + @Override + protected Integer getTicketNumber() { + return 9902; + } + +} |