37
37
import test .robot .testharness .VisualTestBase ;
38
38
39
39
import static org .junit .Assert .assertTrue ;
40
+ import static org .junit .Assert .assertFalse ;
40
41
import static test .util .Util .TIMEOUT ;
41
42
42
43
/**
@@ -55,7 +56,7 @@ public class IconifyTest extends VisualTestBase {
55
56
private Stage bottomStage ;
56
57
private Stage topStage ;
57
58
58
- public void canIconifyStage (StageStyle stageStyle ) throws Exception {
59
+ public void canIconifyStage (StageStyle stageStyle , boolean resizable ) throws Exception {
59
60
final CountDownLatch shownLatch = new CountDownLatch (2 );
60
61
61
62
runAndWait (() -> {
@@ -72,6 +73,7 @@ public void canIconifyStage(StageStyle stageStyle) throws Exception {
72
73
// Top stage, will be inconified
73
74
topStage = getStage (true );
74
75
topStage .initStyle (stageStyle );
76
+ topStage .setResizable (resizable );
75
77
Scene topScene = new Scene (new Pane (), WIDTH , HEIGHT );
76
78
topScene .setFill (TOP_COLOR );
77
79
topStage .setScene (topScene );
@@ -90,6 +92,7 @@ public void canIconifyStage(StageStyle stageStyle) throws Exception {
90
92
91
93
sleep (500 );
92
94
runAndWait (() -> {
95
+ assertFalse (topStage .isIconified ());
93
96
Color color = getColor (100 , 100 );
94
97
assertColorEquals (TOP_COLOR , color , TOLERANCE );
95
98
});
@@ -100,19 +103,41 @@ public void canIconifyStage(StageStyle stageStyle) throws Exception {
100
103
101
104
sleep (500 );
102
105
runAndWait (() -> {
106
+ assertTrue (topStage .isIconified ());
103
107
Color color = getColor (100 , 100 );
104
108
assertColorEquals (BOTTOM_COLOR , color , TOLERANCE );
105
109
});
110
+
111
+ runAndWait (() -> {
112
+ topStage .setIconified (false );
113
+ });
114
+
115
+ sleep (500 );
116
+ runAndWait (() -> {
117
+ assertFalse (topStage .isIconified ());
118
+ Color color = getColor (100 , 100 );
119
+ assertColorEquals (TOP_COLOR , color , TOLERANCE );
120
+ });
121
+ }
122
+
123
+ @ Test (timeout = 15000 )
124
+ public void canIconifyDecoratedStage () throws Exception {
125
+ canIconifyStage (StageStyle .DECORATED , true );
106
126
}
107
127
108
128
@ Test (timeout = 15000 )
109
129
public void canIconifyUndecoratedStage () throws Exception {
110
- canIconifyStage (StageStyle .UNDECORATED );
130
+ canIconifyStage (StageStyle .UNDECORATED , true );
111
131
}
112
132
113
133
@ Test (timeout = 15000 )
114
134
public void canIconifyTransparentStage () throws Exception {
115
- canIconifyStage (StageStyle .TRANSPARENT );
135
+ canIconifyStage (StageStyle .TRANSPARENT , true );
136
+ }
137
+
138
+ @ Test (timeout = 15000 )
139
+ public void canIconifyNonResizableStage () throws Exception {
140
+ canIconifyStage (StageStyle .DECORATED , false );
116
141
}
117
142
118
143
}
0 commit comments