1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-08-17 06:42:21 +03:00

GUI tests:

- refactored to execute GUI code in swing thread
- added failing test the check escape keypress behaviour con save/close modal dialog see #1279
This commit is contained in:
Federico Fissore
2013-02-27 11:42:16 +01:00
parent a58bea74b8
commit af1828a00a
8 changed files with 208 additions and 32 deletions

View File

@@ -0,0 +1,43 @@
package processing.app.helpers;
import org.fest.swing.core.Robot;
import org.fest.swing.driver.JComponentDriver;
import org.fest.swing.edt.GuiActionRunner;
import org.fest.swing.edt.GuiQuery;
import processing.app.syntax.JEditTextArea;
public class JEditTextAreaComponentDriver extends JComponentDriver {
public JEditTextAreaComponentDriver(Robot robot) {
super(robot);
}
public void enterText(JEditTextArea target, String text) {
focusAndWaitForFocusGain(target);
robot.enterText(text);
}
public void setText(final JEditTextArea target, final String text) {
focusAndWaitForFocusGain(target);
GuiActionRunner.execute(new GuiQuery<JEditTextArea>() {
protected JEditTextArea executeInEDT() {
target.setText(text);
return target;
}
});
robot.waitForIdle();
}
public String getText(final JEditTextArea target) {
focusAndWaitForFocusGain(target);
return GuiActionRunner.execute(new GuiQuery<String>() {
protected String executeInEDT() {
return target.getText();
}
});
}
}