diff options
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/com/vaadin/tests/themes/CSSInjectTest.html | 11 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/themes/CSSInjectTest.java | 24 |
2 files changed, 27 insertions, 8 deletions
diff --git a/uitest/src/com/vaadin/tests/themes/CSSInjectTest.html b/uitest/src/com/vaadin/tests/themes/CSSInjectTest.html index 05a0f256c2..0c70d6f711 100644 --- a/uitest/src/com/vaadin/tests/themes/CSSInjectTest.html +++ b/uitest/src/com/vaadin/tests/themes/CSSInjectTest.html @@ -51,7 +51,16 @@ <td></td> <td>world-red</td> </tr> - +<tr> + <td>click</td> + <td>vaadin=runcomvaadinteststhemesCSSInjectTest::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[4]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>world-still-red</td> +</tr> </tbody></table> </body> </html> diff --git a/uitest/src/com/vaadin/tests/themes/CSSInjectTest.java b/uitest/src/com/vaadin/tests/themes/CSSInjectTest.java index f4448bf326..738d8fc681 100644 --- a/uitest/src/com/vaadin/tests/themes/CSSInjectTest.java +++ b/uitest/src/com/vaadin/tests/themes/CSSInjectTest.java @@ -22,14 +22,16 @@ public class CSSInjectTest extends TestBase { final Styles stylesheet = Page.getCurrent().getStyles(); // Inject some resources initially - stylesheet.add(new StreamResource(new StreamResource.StreamSource() { + final StreamResource initialResource = new StreamResource( + new StreamResource.StreamSource() { - @Override - public InputStream getStream() { - return new ByteArrayInputStream( - ".hello, .world { color:silver; }".getBytes()); - } - }, "mystyles-" + System.currentTimeMillis() + ".css")); + @Override + public InputStream getStream() { + return new ByteArrayInputStream( + ".hello, .world { color:silver; }".getBytes()); + } + }, "mystyles-" + System.currentTimeMillis() + ".css"); + stylesheet.add(initialResource); Label hello = new Label( "<span class='hello'>Hello</span> <span class='world'>world</span>", @@ -72,6 +74,14 @@ public class CSSInjectTest extends TestBase { } }); addComponent(injectRandom); + + addComponent(new Button("Inject initial again!", + new Button.ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + stylesheet.add(initialResource); + } + })); } @Override |