diff options
author | Sauli Tähkäpää <sauli@vaadin.com> | 2014-10-01 16:01:17 +0300 |
---|---|---|
committer | Markus Koivisto <markus@vaadin.com> | 2014-10-14 18:02:12 +0300 |
commit | 0f6f2ac82c6662ef3e2b52b5cbc664a5d61726f8 (patch) | |
tree | be43918a3a467bd2a96ac43587cf7ff81e4a461f | |
parent | 041a1e2181c769942795517fd0b6a9a57fa7b764 (diff) | |
download | vaadin-framework-0f6f2ac82c6662ef3e2b52b5cbc664a5d61726f8.tar.gz vaadin-framework-0f6f2ac82c6662ef3e2b52b5cbc664a5d61726f8.zip |
Add favicon.ico to Valo. (#14781)
Change-Id: Ic0c5152d634dfc8f07890cfee18bbebd6e54bbc3
-rw-r--r-- | WebContent/VAADIN/themes/valo/favicon.ico | bin | 0 -> 31005 bytes | |||
-rw-r--r-- | uitest/src/com/vaadin/tests/themes/FaviconTest.java | 60 |
2 files changed, 60 insertions, 0 deletions
diff --git a/WebContent/VAADIN/themes/valo/favicon.ico b/WebContent/VAADIN/themes/valo/favicon.ico Binary files differnew file mode 100644 index 0000000000..ffb34a65c7 --- /dev/null +++ b/WebContent/VAADIN/themes/valo/favicon.ico diff --git a/uitest/src/com/vaadin/tests/themes/FaviconTest.java b/uitest/src/com/vaadin/tests/themes/FaviconTest.java new file mode 100644 index 0000000000..31134f656f --- /dev/null +++ b/uitest/src/com/vaadin/tests/themes/FaviconTest.java @@ -0,0 +1,60 @@ +package com.vaadin.tests.themes; + +import com.vaadin.tests.tb3.SingleBrowserTest; +import org.junit.Test; + +import java.net.HttpURLConnection; +import java.net.URL; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.fail; + +//Extending SingleBrowserTest just to include the test into our test suites. +public class FaviconTest extends SingleBrowserTest { + + @Test + public void chameleonHasFavicon() { + assertThatThemeHasFavicon("chameleon"); + } + + @Test + public void liferayHasFavicon() { + assertThatThemeHasFavicon("liferay"); + } + + @Test + public void runoHasFavicon() { + assertThatThemeHasFavicon("runo"); + } + + @Test + public void reindeerHasFavicon() { + assertThatThemeHasFavicon("reindeer"); + } + + @Test + public void valoHasFavicon() { + assertThatThemeHasFavicon("valo"); + } + + private void assertThatThemeHasFavicon(String theme) { + assertThat(getResponseCode(theme), is(200)); + } + + private int getResponseCode(String theme) { + try { + URL url = new URL(String.format("%s/VAADIN/themes/%s/favicon.ico", getBaseURL(), theme)); + HttpURLConnection connection = (HttpURLConnection)url.openConnection(); + connection.setRequestMethod("GET"); + connection.connect(); + + return connection.getResponseCode(); + + } catch (Exception e) { + fail(e.getMessage()); + } + + return 0; + } +} |