From e6280cb0c673d87faddbfec5224c3ca56bc7d4e9 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 15 Nov 2010 04:43:09 +0100 Subject: NEWT: Cleanup reparent (window resize/display) ; AWT Focus Tests: Bring back AWT wait period. --- make/scripts/tests.sh | 2 +- .../test/junit/newt/TestFocus01SwingAWTRobot.java | 18 ++++----------- .../test/junit/newt/TestFocus02SwingAWTRobot.java | 5 +++- .../classes/com/jogamp/newt/impl/WindowImpl.java | 27 ++++++++++++---------- 4 files changed, 24 insertions(+), 28 deletions(-) diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh index 3b7f46f82..93deeab83 100644 --- a/make/scripts/tests.sh +++ b/make/scripts/tests.sh @@ -26,7 +26,7 @@ function jrun() { #D_ARGS="-Djogl.debug.GLProfile" # D_ARGS="-Djogamp.debug.TraceLock" # D_ARGS="-Dnewt.debug.EDT -Dnativewindow.debug.ToolkitLock.TraceLock -Dnativewindow.debug.NativeWindow" - D_ARGS="-Dnewt.debug.Window -Dnewt.debug.Display -Dnewt.debug.EDT" + #D_ARGS="-Dnewt.debug.Window -Dnewt.debug.Display -Dnewt.debug.EDT" # D_ARGS="-Dnewt.debug.EDT -Dnativewindow.debug.ToolkitLock.TraceLock -Dnativewindow.debug.X11Util.TraceDisplayLifecycle=true" #D_ARGS="-Djogamp.common.utils.locks.Lock.timeout=600000 -Djogamp.debug.Lock -Djogamp.debug.Lock.TraceLock" # D_ARGS="-Dnewt.debug.Window -Dnewt.debug.EDT -Dnewt.debug.Display " diff --git a/src/junit/com/jogamp/test/junit/newt/TestFocus01SwingAWTRobot.java b/src/junit/com/jogamp/test/junit/newt/TestFocus01SwingAWTRobot.java index 49591aab8..762e906fc 100644 --- a/src/junit/com/jogamp/test/junit/newt/TestFocus01SwingAWTRobot.java +++ b/src/junit/com/jogamp/test/junit/newt/TestFocus01SwingAWTRobot.java @@ -29,18 +29,12 @@ package com.jogamp.test.junit.newt; import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.After; import org.junit.AfterClass; -import org.junit.Test; import java.awt.AWTException; import java.awt.BorderLayout; import java.awt.Button; import java.awt.Robot; -import java.awt.event.FocusEvent; -import java.awt.event.FocusListener; import java.lang.reflect.InvocationTargetException; import javax.media.opengl.GLCapabilities; @@ -49,18 +43,12 @@ import javax.media.opengl.GLProfile; import javax.swing.JFrame; import java.util.ArrayList; -import java.util.List; -import java.util.Iterator; import java.io.IOException; import org.junit.BeforeClass; import org.junit.Test; import com.jogamp.newt.awt.NewtCanvasAWT; -import com.jogamp.newt.event.KeyAdapter; -import com.jogamp.newt.event.KeyEvent; -import com.jogamp.newt.event.WindowAdapter; -import com.jogamp.newt.event.WindowEvent; import com.jogamp.newt.opengl.GLWindow; import com.jogamp.opengl.util.Animator; import com.jogamp.test.junit.jogl.demos.es1.RedSquare; @@ -69,8 +57,8 @@ import com.jogamp.test.junit.util.*; public class TestFocus01SwingAWTRobot extends UITestCase { static int width, height; - static long durationPerTest = 800; + static long awtWaitTimeout = 1000; static GLCapabilities glCaps; @@ -144,8 +132,10 @@ public class TestFocus01SwingAWTRobot extends UITestCase { frame1.setVisible(true); Assert.assertTrue(AWTRobotUtil.toFront(robot, frame1)); + int wait=0; + while(wait