/*
* 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 5085626
@summary Exponential performance regression in AWT components (multiple mon)
@run main WPanelPeerPerf
*/
/**
* This test must be run on a multi-screen system.
* This test works by moving a Frame back and forth between the screens a few
* times. When the bug is active, the first move will overwhelm the EDT with
* recursive display change calls. The test fails if it takes too long to
* service the setLocation() calls and send componentMoved() events.
*/
public class WPanelPeerPerf {
}
return instance;
}
private static class Counter {
int counter;
}
// This one is very slow!
public static void testAWT() {
// fail if only on one screen
if (numScreens < 2) {
return;
}
}
public void windowOpened(WindowEvent e) {
synchronized(showLock) {
}
}
});
for (int i = 0; i < NESTED_PANELS; i++) {
}
public void componentMoved(ComponentEvent e) {
synchronized(ctr) {
}
}
});
synchronized(showLock) {
try {
frame.setVisible(true);
}
catch (InterruptedException e) {
e.printStackTrace();
throw new RuntimeException("Problem with showLock");
}
}
}
}
for (int n = 0; n < ITERATIONS_PER_SCREEN; n++) {
public void run() {
}
});
try {
}
catch (InterruptedException e) {
}
}
}
synchronized(ctr) {
try {
// If test hasn't finished, wait for maximum time
// If we get interrupted, test fails
throw new RuntimeException("Waited too long for all the componentMoved()s");
}
}
}
catch(InterruptedException e) {
e.printStackTrace();
throw new RuntimeException("Wait interrupted - ???");
}
}
}
testAWT();
}
}