summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorDenis <denis@vaadin.com>2016-12-07 13:27:43 +0200
committerPekka Hyvönen <pekka@vaadin.com>2016-12-07 13:27:43 +0200
commit5778c65bdef65337f8cbcc9d0504abbd11f8278f (patch)
tree640686f221eca3e3ae21f016c41fb034cd76a1ca /uitest
parent2c014bc4eca7c31aab600c233b67133cb4e4179b (diff)
downloadvaadin-framework-5778c65bdef65337f8cbcc9d0504abbd11f8278f.tar.gz
vaadin-framework-5778c65bdef65337f8cbcc9d0504abbd11f8278f.zip
Don't use V8 FieldEvents classes in v7 compatibility module. (#93)
* Don't use V8 FieldEvents classes in v7 compatibility module. Fixes vaadin/framework8-issues#363
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/AbstractComponentTest.java20
1 files changed, 13 insertions, 7 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/AbstractComponentTest.java b/uitest/src/main/java/com/vaadin/tests/components/AbstractComponentTest.java
index 6fbb489c1f..7089a2e810 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/AbstractComponentTest.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/AbstractComponentTest.java
@@ -249,25 +249,31 @@ public abstract class AbstractComponentTest<T extends AbstractComponent> extends
protected Command<T, Boolean> focusListenerCommand = new Command<T, Boolean>() {
+ private Registration focusListenerRegistration;
+
@Override
public void execute(T c, Boolean value, Object data) {
- FocusNotifier fn = (FocusNotifier) c;
+ FocusNotifier focusNotifier = (FocusNotifier) c;
if (value) {
- fn.addFocusListener(AbstractComponentTest.this);
- } else {
- fn.removeFocusListener(AbstractComponentTest.this);
+ focusListenerRegistration = focusNotifier
+ .addFocusListener(AbstractComponentTest.this);
+ } else if (focusListenerRegistration != null) {
+ focusListenerRegistration.remove();
}
}
};
protected Command<T, Boolean> blurListenerCommand = new Command<T, Boolean>() {
+ private Registration blurListenerRegistration;
+
@Override
public void execute(T c, Boolean value, Object data) {
BlurNotifier bn = (BlurNotifier) c;
if (value) {
- bn.addBlurListener(AbstractComponentTest.this);
- } else {
- bn.removeBlurListener(AbstractComponentTest.this);
+ blurListenerRegistration = bn
+ .addBlurListener(AbstractComponentTest.this);
+ } else if (blurListenerRegistration != null) {
+ blurListenerRegistration.remove();
}
}
};