Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
SquirrelJME
Commits
d392b364
Commit
d392b364
authored
Jul 18, 2021
by
Stephanie Gawroriski
Browse files
Run full screen test multiple times until passing.
parent
a6da2d82
Pipeline
#39184
passed with stages
in 1 minute and 57 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
modules/midp-lcdui/src/test/java/lcdui/canvas/TestCanvasFullScreen.java
View file @
d392b364
...
...
@@ -9,6 +9,7 @@
package
lcdui.canvas
;
import
cc.squirreljme.runtime.cldc.debug.Debugging
;
import
javax.microedition.lcdui.Canvas
;
import
javax.microedition.lcdui.Command
;
import
javax.microedition.lcdui.Display
;
...
...
@@ -28,6 +29,14 @@ public class TestCanvasFullScreen
*/
@Override
public
void
test
(
Display
__display
,
CanvasPlatform
__platform
)
{
// This test can fail multiple times due to tight timings
for
(
int
i
=
0
;
i
<
3
;
i
++)
if
(
this
.
runSequence
(
__display
,
__platform
))
return
;
}
public
boolean
runSequence
(
Display
__display
,
CanvasPlatform
__platform
)
{
// Add a button, it should go away
__platform
.
addCommand
(
...
...
@@ -48,16 +57,31 @@ public class TestCanvasFullScreen
__platform
.
repaint
();
__platform
.
serviceRepaints
();
// Wait a bit to allow this to stay on
try
{
Thread
.
sleep
(
1000
);
}
catch
(
InterruptedException
ignored
)
{
}
// Query the sizes again for checking
int
newWidth
=
__platform
.
getWidth
();
int
newHeight
=
__platform
.
getHeight
();
// Full-screen should cause the canvas to grow in size
this
.
secondary
(
"width"
,
newWidth
>=
width
);
this
.
secondary
(
"height"
,
newHeight
>=
height
);
boolean
didWidth
=
newWidth
>=
width
;
boolean
didHeight
=
newHeight
>=
height
;
this
.
secondary
(
"width"
,
didWidth
);
this
.
secondary
(
"height"
,
didHeight
);
// The canvas should be smaller or at the maximum display resolution
this
.
secondary
(
"wdisp"
,
newWidth
<=
__display
.
getWidth
());
this
.
secondary
(
"hdisp"
,
newHeight
<=
__display
.
getHeight
());
boolean
widthSmaller
=
newWidth
<=
__display
.
getWidth
();
boolean
heightSmaller
=
newHeight
<=
__display
.
getHeight
();
this
.
secondary
(
"wdisp"
,
widthSmaller
);
this
.
secondary
(
"hdisp"
,
heightSmaller
);
return
didWidth
&&
didHeight
&&
widthSmaller
&&
heightSmaller
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment