< prev index next >

test/jdk/java/awt/Menu/OpensWithNoGrab/OpensWithNoGrab.java

Print this page
rev 51542 : 8210039: move OSInfo to top level testlibrary
Reviewed-by: duke


  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  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 /*
  25   @test
  26   @key headful
  27   @bug 6354721
  28   @summary REG: Menu does not disappear when clicked, keeping Choice's drop-down open, XToolkit
  29   @author andrei.dmitriev: area=awt.menu
  30   @library ../../regtesthelpers
  31   @library ../../../../lib/testlibrary
  32   @modules java.desktop/sun.awt
  33   @build jdk.testlibrary.OSInfo
  34   @build Util
  35   @run main OpensWithNoGrab
  36 */
  37 
  38 import java.awt.*;
  39 import java.awt.event.*;
  40 
  41 import jdk.testlibrary.OSInfo;
  42 import test.java.awt.regtesthelpers.Util;
  43 
  44 public class OpensWithNoGrab
  45 {
  46     final static int delay = 50;
  47     private static void init()
  48     {
  49         if (!(OSInfo.getOSType().equals(OSInfo.OSType.LINUX)
  50                 || OSInfo.getOSType().equals(OSInfo.OSType.SOLARIS))) {
  51             System.out.println("This test is for XAWT/Motif only");
  52             OpensWithNoGrab.pass();
  53         }
  54 
  55         Choice ch = new Choice ();
  56         Frame f = new Frame ("OpensWithNoGrab");
  57         Robot robot;
  58         Point framePt, choicePt;
  59 
  60         ch.add("line 1");
  61         ch.add("line 2");
  62         ch.add("line 3");
  63         ch.add("line 4");
  64         ch.setBackground(Color.red);
  65         f.add(ch);
  66 
  67         Menu file = new Menu ("file");
  68         MenuBar mb = new MenuBar();
  69         mb.add(file);
  70 




  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  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 /*
  25   @test
  26   @key headful
  27   @bug 6354721
  28   @summary REG: Menu does not disappear when clicked, keeping Choice's drop-down open, XToolkit
  29   @author andrei.dmitriev: area=awt.menu
  30   @library ../../regtesthelpers
  31   @library /test/lib
  32   @modules java.desktop/sun.awt
  33   @build jdk.test.lib.Platform
  34   @build Util
  35   @run main OpensWithNoGrab
  36 */
  37 
  38 import java.awt.*;
  39 import java.awt.event.*;
  40 
  41 import jdk.test.lib.Platform;
  42 import test.java.awt.regtesthelpers.Util;
  43 
  44 public class OpensWithNoGrab
  45 {
  46     final static int delay = 50;
  47     private static void init()
  48     {
  49         if (!(Platform.isLinux() || Platform.isSolaris())) {

  50             System.out.println("This test is for XAWT/Motif only");
  51             OpensWithNoGrab.pass();
  52         }
  53 
  54         Choice ch = new Choice ();
  55         Frame f = new Frame ("OpensWithNoGrab");
  56         Robot robot;
  57         Point framePt, choicePt;
  58 
  59         ch.add("line 1");
  60         ch.add("line 2");
  61         ch.add("line 3");
  62         ch.add("line 4");
  63         ch.setBackground(Color.red);
  64         f.add(ch);
  65 
  66         Menu file = new Menu ("file");
  67         MenuBar mb = new MenuBar();
  68         mb.add(file);
  69 


< prev index next >