diff options
author | John Ahlroos <john@vaadin.com> | 2013-05-28 12:39:20 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2013-05-29 09:21:33 +0000 |
commit | 35f353274f2132086f8ee0bb6e6e73712a59b173 (patch) | |
tree | 647dcc5641735a78d60a501b4c597b4243b9cb25 /uitest/src | |
parent | 7c613d107e8318799521a1243b5e480a0c21e2d9 (diff) | |
download | vaadin-framework-35f353274f2132086f8ee0bb6e6e73712a59b173.tar.gz vaadin-framework-35f353274f2132086f8ee0bb6e6e73712a59b173.zip |
Fixes current text being overwritten in server update on RTA #11741
If the server happens to update the state of the RTA while a user is
typing then the users text will be replaced by the value on the server. To fix
this the RTA should not update if the value is the same as the one
cached on the client side.
Also moves blur handling and server<->client syncronization to the
connector.
Change-Id: Ia807b1e2aa210eb881e4b9cea0870c0c5a9254b2
Diffstat (limited to 'uitest/src')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/richtextarea/RichTextAreaUpdateWhileTyping.html | 42 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/richtextarea/RichTextAreaUpdateWhileTyping.java | 51 |
2 files changed, 93 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/richtextarea/RichTextAreaUpdateWhileTyping.html b/uitest/src/com/vaadin/tests/components/richtextarea/RichTextAreaUpdateWhileTyping.html new file mode 100644 index 0000000000..6ddd1b4097 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/richtextarea/RichTextAreaUpdateWhileTyping.html @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<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="http://localhost:7070/" /> +<title>New Test</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">New Test</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.richtextarea.RichTextAreaUpdateWhileTyping?restartApplication</td> + <td></td> +</tr> +<tr> + <td>selectFrame</td> + <td>xpath=//div[@id='rta']/iframe</td> + <td></td> +</tr> +<tr> + <td>type</td> + <td>//body</td> + <td>This text should be visible, even after an update while I type.</td> +</tr> +<tr> + <td>pause</td> + <td>2000</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>//body</td> + <td>This text should be visible, even after an update while I type.</td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/components/richtextarea/RichTextAreaUpdateWhileTyping.java b/uitest/src/com/vaadin/tests/components/richtextarea/RichTextAreaUpdateWhileTyping.java new file mode 100644 index 0000000000..df1d6df463 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/richtextarea/RichTextAreaUpdateWhileTyping.java @@ -0,0 +1,51 @@ +package com.vaadin.tests.components.richtextarea; + +import com.vaadin.data.Property; +import com.vaadin.data.Property.ValueChangeEvent; +import com.vaadin.server.VaadinRequest; +import com.vaadin.shared.ui.progressindicator.ProgressIndicatorServerRpc; +import com.vaadin.tests.components.AbstractComponentTest; +import com.vaadin.tests.components.AbstractTestCase; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.ProgressIndicator; +import com.vaadin.ui.RichTextArea; + +public class RichTextAreaUpdateWhileTyping extends AbstractTestUI { + + private RichTextArea rta; + + @Override + protected void setup(VaadinRequest request) { + + // Progress indicator for changing the value of the RTA + ProgressIndicator pi = new ProgressIndicator() { + { + registerRpc(new ProgressIndicatorServerRpc() { + + @Override + public void poll() { + rta.markAsDirty(); + } + }); + } + }; + pi.setHeight("0px"); + addComponent(pi); + + rta = new RichTextArea(); + rta.setId("rta"); + rta.setImmediate(true); + addComponent(rta); + } + + @Override + protected String getTestDescription() { + // TODO Auto-generated method stub + return null; + } + + @Override + protected Integer getTicketNumber() { + return 11741; + } +} |