< prev index next >

tests/system/src/test/java/test/robot/com/sun/glass/ui/monocle/ModalDialogTest.java

Print this page
rev 9504 : need to fix test log and others

*** 23,33 **** * questions. */ package test.robot.com.sun.glass.ui.monocle; ! import com.sun.glass.ui.monocle.TestLog; import test.robot.com.sun.glass.ui.monocle.TestApplication; import javafx.application.Platform; import javafx.scene.Group; import javafx.scene.Scene; import javafx.stage.Modality; --- 23,33 ---- * questions. */ package test.robot.com.sun.glass.ui.monocle; ! import com.sun.glass.ui.monocle.TestLogShim; import test.robot.com.sun.glass.ui.monocle.TestApplication; import javafx.application.Platform; import javafx.scene.Group; import javafx.scene.Scene; import javafx.stage.Modality;
*** 43,62 **** @Rule public TestName name = new TestName(); @Before public void setUpScreen() throws Exception { ! TestLog.reset(); ! TestLog.log(name.getMethodName()); TestApplication.showFullScreenScene(); } @Test public void test1() throws Exception { Stage rootStage = TestApplication.getStage(); rootStage.getScene().setOnMouseClicked( ! (e) -> TestLog.format("Clicked at %.0f, %.0f", e.getScreenX(), e.getScreenY())); Platform.runLater(() -> { final Stage p = new Stage(); p.initOwner(rootStage); p.initModality(Modality.APPLICATION_MODAL); --- 43,62 ---- @Rule public TestName name = new TestName(); @Before public void setUpScreen() throws Exception { ! TestLogShim.reset(); ! TestLogShim.log(name.getMethodName()); TestApplication.showFullScreenScene(); } @Test public void test1() throws Exception { Stage rootStage = TestApplication.getStage(); rootStage.getScene().setOnMouseClicked( ! (e) -> TestLogShim.format("Clicked at %.0f, %.0f", e.getScreenX(), e.getScreenY())); Platform.runLater(() -> { final Stage p = new Stage(); p.initOwner(rootStage); p.initModality(Modality.APPLICATION_MODAL);
*** 64,89 **** p.setY(0); p.setWidth(200); p.setHeight(200); p.setScene(new Scene(new Group())); p.getScene().setOnMouseClicked( ! (e) -> TestLog.format("Clicked at %.0f, %.0f", e.getScreenX(), e.getScreenY())); p.show(); }); ! TestLog.clear(); Platform.runLater(() -> { Robot robot = com.sun.glass.ui.Application.GetApplication().createRobot(); robot.mouseMove(300, 400); robot.mousePress(Robot.MOUSE_LEFT_BTN); robot.mouseRelease(Robot.MOUSE_LEFT_BTN); robot.mouseMove(100, 100); robot.mousePress(Robot.MOUSE_LEFT_BTN); robot.mouseRelease(Robot.MOUSE_LEFT_BTN); }); ! TestLog.waitForLog("Clicked at 100, 100"); ! if (TestLog.countLog("Clicked at 300, 400") != 0) { throw new AssertionFailedError("Disabled window should not receive mouse events!"); } } } --- 64,89 ---- p.setY(0); p.setWidth(200); p.setHeight(200); p.setScene(new Scene(new Group())); p.getScene().setOnMouseClicked( ! (e) -> TestLogShim.format("Clicked at %.0f, %.0f", e.getScreenX(), e.getScreenY())); p.show(); }); ! TestLogShim.clear(); Platform.runLater(() -> { Robot robot = com.sun.glass.ui.Application.GetApplication().createRobot(); robot.mouseMove(300, 400); robot.mousePress(Robot.MOUSE_LEFT_BTN); robot.mouseRelease(Robot.MOUSE_LEFT_BTN); robot.mouseMove(100, 100); robot.mousePress(Robot.MOUSE_LEFT_BTN); robot.mouseRelease(Robot.MOUSE_LEFT_BTN); }); ! TestLogShim.waitForLog("Clicked at 100, 100"); ! if (TestLogShim.countLog("Clicked at 300, 400") != 0) { throw new AssertionFailedError("Disabled window should not receive mouse events!"); } } }
< prev index next >