jdk/test/javax/swing/JMenuItem/ShortcutNotDiplayed/ShortcutNotDisplayedTest.java
changeset 26750 d0d6c64a2e2b
parent 14314 9d9a66a5d6da
equal deleted inserted replaced
26749:b6598aa90114 26750:d0d6c64a2e2b
     1 /*
     1 /*
     2  * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    24 /*
    24 /*
    25  * @test
    25  * @test
    26  * @bug 7186371
    26  * @bug 7186371
    27  * @summary [macosx] Main menu shortcuts not displayed
    27  * @summary [macosx] Main menu shortcuts not displayed
    28  * @author vera.akulova@oracle.com
    28  * @author vera.akulova@oracle.com
       
    29  * @library ../../../../lib/testlibrary
       
    30  * @build jdk.testlibrary.OSInfo
    29  * @run main/manual ShortcutNotDisplayedTest
    31  * @run main/manual ShortcutNotDisplayedTest
    30  */
    32  */
    31 
    33 
    32 import java.awt.*;
    34 import java.awt.*;
    33 import java.awt.event.*;
    35 import java.awt.event.*;
    37     static volatile boolean done = false;
    39     static volatile boolean done = false;
    38     static volatile boolean pass = false;
    40     static volatile boolean pass = false;
    39     static final String PASS_COMMAND = "pass";
    41     static final String PASS_COMMAND = "pass";
    40 
    42 
    41     public static void main(String[] args) throws Exception {
    43     public static void main(String[] args) throws Exception {
    42         if (sun.awt.OSInfo.getOSType() != sun.awt.OSInfo.OSType.MACOSX) {
    44         if (jdk.testlibrary.OSInfo.getOSType() != jdk.testlibrary.OSInfo.OSType.MACOSX) {
    43             System.out.println("This test is for MacOS only. Automatically passed on other platforms.");
    45             System.out.println("This test is for MacOS only. Automatically passed on other platforms.");
    44             return;
    46             return;
    45         }
    47         }
    46         System.setProperty("apple.laf.useScreenMenuBar", "true");
    48         System.setProperty("apple.laf.useScreenMenuBar", "true");
    47         SwingUtilities.invokeAndWait(new Runnable() {
    49         SwingUtilities.invokeAndWait(new Runnable() {