/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6240507 6662642
* @summary verify that isFullScreenSupported and getFullScreenWindow work
* correctly with and without a SecurityManager. Note that the test may fail
* on older Gnome versions (see bug 6500686).
* @run main FSFrame
* @author cheth
*/
// Don't start the test until the window is visible
boolean visible = false;
static volatile boolean done = false;
visible = true;
try {
} catch (Exception e) {
"window display");
}
}
}
paint(g);
}
int pixelColor;
if (pixelColor != correctColor) {
" != correctColor " +
" at coordinates (" + x + ", " + y + ")");
return false;
}
return true;
}
if (!fsSupported) {
}
// Check that all four corners and middle pixel match the window's
// fill color
return;
}
boolean colorCorrect = true;
if (!colorCorrect) {
}
try {
} catch (IOException ex) {}
throw new Error("Some pixel colors not correct; FS window may not" +
" have been displayed correctly");
}
}
if (withSecurity) {
}
try {
// None of these should throw an exception
gd.setFullScreenWindow(this);
try {
// Give the system time to set the FS window and display it
// properly
} catch (Exception e) {}
if (!withSecurity) {
// See if FS window got displayed correctly
try {
public void run() {
repaint();
}
});
} catch (InvocationTargetException ex) {
} catch (InterruptedException ex) {
}
}
// reset window
try {
// Give the system time to set the FS window and display it
// properly
} catch (Exception e) {}
} catch (SecurityException e) {
e.printStackTrace();
throw new Error("Failure: should not get an exception when " +
"calling isFSSupported or setFSWindow");
}
}
public void run() {
boolean firstTime = true;
while (!done) {
if (visible) {
checkFSFunctionality(false);
checkFSFunctionality(true);
done = true;
} else {
// sleep while we wait
try {
// Give the system time to set the FS window and display it
// properly
} catch (Exception e) {}
}
}
}
frame.setUndecorated(true);
frame.setVisible(true);
t.start();
while (!done) {
try {
// Do not exit the main thread until the test is finished
} catch (Exception e) {}
}
}
}