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:
@@ -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();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user