summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2013-05-31 15:16:16 +0300
committerVaadin Code Review <review@vaadin.com>2013-06-03 10:12:01 +0000
commit03830aeb46d93d675fa01c35ce3700e30a4a9c7d (patch)
tree23a357793fab72add836fade9fad2f04a7feda55 /uitest
parent0d046d61c0c76073624feef7780256cb61561ce4 (diff)
downloadvaadin-framework-03830aeb46d93d675fa01c35ce3700e30a4a9c7d.tar.gz
vaadin-framework-03830aeb46d93d675fa01c35ce3700e30a4a9c7d.zip
Ignore style resource that has already been added (#11667)
Change-Id: I828166f69c3ad1ac7e24c00de640c8645d2f2153
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/themes/CSSInjectTest.html11
-rw-r--r--uitest/src/com/vaadin/tests/themes/CSSInjectTest.java24
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