8012569: TEST_BUG: java/awt/GraphicsDevice/CheckDisplayModes.java fails

Reviewed-by: anthony, serb
This commit is contained in:
Konstantin Shefov 2013-06-11 14:14:31 +04:00
parent 3039fb09eb
commit 1963dde59a

View File

@ -37,6 +37,10 @@ public class CheckDisplayModes {
public static void main(String[] args) {
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice graphicDevice = ge.getDefaultScreenDevice();
if (!graphicDevice.isDisplayChangeSupported()) {
System.err.println("Display mode change is not supported on this host. Test is considered passed.");
return;
}
DisplayMode defaultDisplayMode = graphicDevice.getDisplayMode();
checkDisplayMode(defaultDisplayMode);
graphicDevice.setDisplayMode(defaultDisplayMode);