1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-12 23:08:52 +01:00
Arduino/app/test/processing/app/AbstractGUITest.java
Federico Fissore af1828a00a 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
2013-02-27 11:42:16 +01:00

36 lines
990 B
Java

package processing.app;
import org.fest.swing.edt.FailOnThreadViolationRepaintManager;
import org.fest.swing.edt.GuiActionRunner;
import org.fest.swing.edt.GuiQuery;
import org.junit.Before;
import processing.app.helpers.ArduinoFrameFixture;
import javax.swing.*;
public abstract class AbstractGUITest {
protected ArduinoFrameFixture window;
@Before
public void startUpTheIDE() throws Exception {
FailOnThreadViolationRepaintManager.install();
Base.initPlatform();
Preferences.init(null);
JPopupMenu.setDefaultLightWeightPopupEnabled(false);
Theme.init();
Base.platform.setLookAndFeel();
Base.untitledFolder = Base.createTempFolder("untitled");
Base.untitledFolder.deleteOnExit();
window = GuiActionRunner.execute(new GuiQuery<ArduinoFrameFixture>() {
@Override
protected ArduinoFrameFixture executeInEDT() throws Throwable {
return new ArduinoFrameFixture(new Base(new String[0]).editors.get(0));
}
});
}
}