< prev index next >

test/jdk/java/awt/Focus/NullActiveWindowOnFocusLost/NullActiveWindowOnFocusLost.java

Print this page




  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 import java.awt.Button;
  25 import java.awt.Frame;
  26 import java.util.concurrent.TimeUnit;
  27 
  28 import sun.awt.SunToolkit;
  29 
  30 /**
  31  * @test
  32  * @key headful
  33  * @bug 8211435
  34  * @requires (os.family == "mac")
  35  * @modules java.desktop/sun.awt
  36  */
  37 public final class NullActiveWindowOnFocusLost {
  38 
  39     private static volatile long endtime;
  40     private static Throwable failed;
  41 
  42     public static void main(final String[] args) throws Exception {
  43         // Will run the test no more than 30 seconds
  44         endtime = System.nanoTime() + TimeUnit.SECONDS.toNanos(30);
  45         Thread.setDefaultUncaughtExceptionHandler((t, e) -> failed = e);
  46 
  47         final Thread[] threads = new Thread[20];
  48         for (int i = 0; i < threads.length; i++) {
  49             threads[i] = testThread(i);
  50         }
  51         for (final Thread thread : threads) {
  52             thread.start();
  53         }
  54         for (final Thread thread : threads) {




  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 import java.awt.Button;
  25 import java.awt.Frame;
  26 import java.util.concurrent.TimeUnit;
  27 
  28 import sun.awt.SunToolkit;
  29 
  30 /**
  31  * @test
  32  * @key headful
  33  * @bug 8211435

  34  * @modules java.desktop/sun.awt
  35  */
  36 public final class NullActiveWindowOnFocusLost {
  37 
  38     private static volatile long endtime;
  39     private static Throwable failed;
  40 
  41     public static void main(final String[] args) throws Exception {
  42         // Will run the test no more than 30 seconds
  43         endtime = System.nanoTime() + TimeUnit.SECONDS.toNanos(30);
  44         Thread.setDefaultUncaughtExceptionHandler((t, e) -> failed = e);
  45 
  46         final Thread[] threads = new Thread[20];
  47         for (int i = 0; i < threads.length; i++) {
  48             threads[i] = testThread(i);
  49         }
  50         for (final Thread thread : threads) {
  51             thread.start();
  52         }
  53         for (final Thread thread : threads) {


< prev index next >