diff options
author | Johannes Dahlström <johannesd@vaadin.com> | 2012-09-11 10:52:56 +0300 |
---|---|---|
committer | Johannes Dahlström <johannesd@vaadin.com> | 2012-09-11 10:52:56 +0300 |
commit | c0b98ed77842f505f3a2f424c5d049a3c0c970cb (patch) | |
tree | 437ea7120571b63da92745a72efeb8e3562a5750 /uitest/src/com/vaadin | |
parent | 52331e0db4d3898c09369c2a797c38c8de544c11 (diff) | |
download | vaadin-framework-c0b98ed77842f505f3a2f424c5d049a3c0c970cb.tar.gz vaadin-framework-c0b98ed77842f505f3a2f424c5d049a3c0c970cb.zip |
Improvements to #9087:
* Rename EmbeddedBrowser to BrowserFrame
* Add constructors to Flash and BrowserFrame
* Change getState() methods to protected
* JavaDoc improvements
* Make ImageClicks test deterministic
Diffstat (limited to 'uitest/src/com/vaadin')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/browserframe/BrowserFrameIsVisible.html (renamed from uitest/src/com/vaadin/tests/components/embeddedbrowser/EmbeddedBrowserIsVisible.html) | 14 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/browserframe/BrowserFrameIsVisible.java (renamed from uitest/src/com/vaadin/tests/components/embeddedbrowser/EmbeddedBrowserIsVisible.java) | 16 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/image/ImageClicks.java | 7 |
3 files changed, 20 insertions, 17 deletions
diff --git a/uitest/src/com/vaadin/tests/components/embeddedbrowser/EmbeddedBrowserIsVisible.html b/uitest/src/com/vaadin/tests/components/browserframe/BrowserFrameIsVisible.html index 2d76cd48b2..93b855838c 100644 --- a/uitest/src/com/vaadin/tests/components/embeddedbrowser/EmbeddedBrowserIsVisible.html +++ b/uitest/src/com/vaadin/tests/components/browserframe/BrowserFrameIsVisible.html @@ -4,16 +4,16 @@ <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="" /> -<title>EmbeddedBrowserIsVisible</title> +<title>BrowserFrameIsVisible</title> </head> <body> <table cellpadding="1" cellspacing="1" border="1"> <thead> -<tr><td rowspan="1" colspan="3">EmbeddedBrowserIsVisible</td></tr> +<tr><td rowspan="1" colspan="3">BrowserFrameIsVisible</td></tr> </thead><tbody> <tr> <td>open</td> - <td>/run/com.vaadin.tests.components.embeddedbrowser.EmbeddedBrowserIsVisible?restartApplication</td> + <td>/run/com.vaadin.tests.components.browserframe.BrowserFrameIsVisible?restartApplication</td> <td></td> </tr> <tr> @@ -23,7 +23,7 @@ </tr> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentsembeddedbrowserEmbeddedBrowserIsVisible::/VVerticalLayout[0]/VVerticalLayout[0]/VHorizontalLayout[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentsbrowserframeBrowserFrameIsVisible::/VVerticalLayout[0]/VVerticalLayout[0]/VHorizontalLayout[0]/VButton[0]/domChild[0]/domChild[0]</td> <td></td> </tr> <tr> @@ -33,7 +33,7 @@ </tr> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentsembeddedbrowserEmbeddedBrowserIsVisible::/VVerticalLayout[0]/VVerticalLayout[0]/VHorizontalLayout[0]/VButton[1]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentsbrowserframeBrowserFrameIsVisible::/VVerticalLayout[0]/VVerticalLayout[0]/VHorizontalLayout[0]/VButton[1]/domChild[0]/domChild[0]</td> <td></td> </tr> <tr> @@ -43,7 +43,7 @@ </tr> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentsembeddedbrowserEmbeddedBrowserIsVisible::/VVerticalLayout[0]/VVerticalLayout[0]/VHorizontalLayout[0]/VButton[2]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentsbrowserframeBrowserFrameIsVisible::/VVerticalLayout[0]/VVerticalLayout[0]/VHorizontalLayout[0]/VButton[2]/domChild[0]/domChild[0]</td> <td></td> </tr> <tr> @@ -53,7 +53,7 @@ </tr> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentsembeddedbrowserEmbeddedBrowserIsVisible::/VVerticalLayout[0]/VVerticalLayout[0]/VHorizontalLayout[0]/VButton[1]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentsbrowserframeBrowserFrameIsVisible::/VVerticalLayout[0]/VVerticalLayout[0]/VHorizontalLayout[0]/VButton[1]/domChild[0]/domChild[0]</td> <td></td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/embeddedbrowser/EmbeddedBrowserIsVisible.java b/uitest/src/com/vaadin/tests/components/browserframe/BrowserFrameIsVisible.java index 2eaf712676..4e9c133bea 100644 --- a/uitest/src/com/vaadin/tests/components/embeddedbrowser/EmbeddedBrowserIsVisible.java +++ b/uitest/src/com/vaadin/tests/components/browserframe/BrowserFrameIsVisible.java @@ -1,4 +1,4 @@ -package com.vaadin.tests.components.embeddedbrowser; +package com.vaadin.tests.components.browserframe; import java.io.ByteArrayInputStream; import java.io.InputStream; @@ -6,12 +6,12 @@ import java.io.UnsupportedEncodingException; import com.vaadin.server.StreamResource; import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.BrowserFrame; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.EmbeddedBrowser; import com.vaadin.ui.HorizontalLayout; -public class EmbeddedBrowserIsVisible extends TestBase { +public class BrowserFrameIsVisible extends TestBase { @Override protected void setup() { @@ -28,8 +28,8 @@ public class EmbeddedBrowserIsVisible extends TestBase { Button page3 = new Button("null"); buttonLayout.addComponent(page3); - final EmbeddedBrowser browser = new EmbeddedBrowser(); - browser.setDebugId("browser"); + final BrowserFrame browser = new BrowserFrame(); + browser.setId("browser"); browser.setWidth("600px"); browser.setHeight("300px"); browser.setAlternateText("Browser alternative text"); @@ -40,7 +40,7 @@ public class EmbeddedBrowserIsVisible extends TestBase { browser.setSource(textResource); addComponent(browser); - page1.addListener(new Button.ClickListener() { + page1.addClickListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { @@ -52,7 +52,7 @@ public class EmbeddedBrowserIsVisible extends TestBase { } }); - page2.addListener(new Button.ClickListener() { + page2.addClickListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { @@ -64,7 +64,7 @@ public class EmbeddedBrowserIsVisible extends TestBase { } }); - page3.addListener(new Button.ClickListener() { + page3.addClickListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { diff --git a/uitest/src/com/vaadin/tests/components/image/ImageClicks.java b/uitest/src/com/vaadin/tests/components/image/ImageClicks.java index e2d983b7ce..e50b8c3a4f 100644 --- a/uitest/src/com/vaadin/tests/components/image/ImageClicks.java +++ b/uitest/src/com/vaadin/tests/components/image/ImageClicks.java @@ -7,6 +7,7 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; +import java.util.Random; import javax.imageio.ImageIO; @@ -19,6 +20,8 @@ import com.vaadin.ui.Label; public class ImageClicks extends TestBase { + private final Random rng = new Random(0); + private int clickCounter = 0; @Override @@ -32,7 +35,7 @@ public class ImageClicks extends TestBase { final StreamResource imageResource = new StreamResource(imageSource, "testimage.png"); image.setSource(imageResource); - image.addListener(new ClickListener() { + image.addClickListener(new ClickListener() { @Override public void click(ClickEvent event) { @@ -107,7 +110,7 @@ public class ImageClicks extends TestBase { } // Cell - if (Math.random() < 0.5f) { + if (rng.nextFloat() < 0.5f) { drawable.setColor(Color.white); } else { drawable.setColor(Color.black); |