/*
* 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 6366813 6459844
* @summary Tests that no exception is thrown if a frame is resized just
* before we create a bufferStrategy
* @author Dmitri.Trembovetski area=FullScreen/BufferStrategy
*/
/**
* The purpose of this test is to make sure that we do not throw an
* IllegalStateException during the creation of BufferStrategy if
* a window has been resized just before our creation attempt.
*
* We test both windowed and fullscreen mode, although the exception has
* been observed in full screen mode only.
*/
public class BufferStrategyExceptionTest {
for (int i = 0; i < TEST_REPS; i++) {
f.pack();
f.setVisible(true);
if (i % 2 == 0) {
}
// generate a resize event which will invalidate the peer's
// surface data and hopefully cause an exception during
// BufferStrategy creation in TestFrame.render()
f.setSize(d);
f.render();
sleep(100);
f.dispose();
}
}
try {
} catch (InterruptedException ex) {
}
}
TestFrame() {
setUndecorated(true);
setIgnoreRepaint(true);
}
public void render() {
try {
} catch (AWTException ex) {
}
do {
g.dispose();
}
}
}