diff options
author | Leif Åstrand <leif@vaadin.com> | 2015-01-01 11:26:17 +0200 |
---|---|---|
committer | Sauli Tähkäpää <sauli@vaadin.com> | 2015-01-20 13:46:02 +0200 |
commit | da3d8bee3c4fe5c097b8e83b75396c65caac0418 (patch) | |
tree | d2023fadd0ccb01b437a5c8d2abee1c63426a21c /uitest | |
parent | 0739d0b80f46ab48882e4a5dd8c812e781d9e495 (diff) | |
download | vaadin-framework-da3d8bee3c4fe5c097b8e83b75396c65caac0418.tar.gz vaadin-framework-da3d8bee3c4fe5c097b8e83b75396c65caac0418.zip |
Only split CssLayout styles at the first : character (#15490)
Change-Id: Ifa5f3d3d583d6d32a50b69b3b59b141829293b37
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/com/vaadin/tests/layouts/CssLayoutAbsoluteUrl.java | 38 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/layouts/CssLayoutAbsoluteUrlTest.java | 39 |
2 files changed, 77 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/layouts/CssLayoutAbsoluteUrl.java b/uitest/src/com/vaadin/tests/layouts/CssLayoutAbsoluteUrl.java new file mode 100644 index 0000000000..e5430a09af --- /dev/null +++ b/uitest/src/com/vaadin/tests/layouts/CssLayoutAbsoluteUrl.java @@ -0,0 +1,38 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.layouts; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Component; +import com.vaadin.ui.CssLayout; +import com.vaadin.ui.Label; + +public class CssLayoutAbsoluteUrl extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + Label label = new Label("Hello"); + label.setId("myLabel"); + addComponent(new CssLayout(label) { + @Override + protected String getCss(Component c) { + return "color: blue; background-image: url(\"about:blank\");"; + } + }); + } + +} diff --git a/uitest/src/com/vaadin/tests/layouts/CssLayoutAbsoluteUrlTest.java b/uitest/src/com/vaadin/tests/layouts/CssLayoutAbsoluteUrlTest.java new file mode 100644 index 0000000000..1821acdbfa --- /dev/null +++ b/uitest/src/com/vaadin/tests/layouts/CssLayoutAbsoluteUrlTest.java @@ -0,0 +1,39 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.layouts; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; + +import com.vaadin.tests.tb3.SingleBrowserTest; + +public class CssLayoutAbsoluteUrlTest extends SingleBrowserTest { + @Test + public void testAboutBlankStyle() { + openTestURL(); + + WebElement myLabel = findElement(By.id("myLabel")); + + String backgroundImage = myLabel.getCssValue("background-image"); + + // Not testing string equality since some browsers return the style with + // quotes around the url argument and some without quotes. + Assert.assertTrue(backgroundImage + " does not contain 'about:blank'", + backgroundImage.contains("about:blank")); + } +} |