From 7550870b737effe330ec7ec47db027e198e7d4e5 Mon Sep 17 00:00:00 2001 From: sunyaqi Date: Thu, 29 Feb 2024 20:23:27 +0800 Subject: [PATCH 01/15] Backport 34afeced211cd7115e2529b043c1e57dfa1291fe --- jdk/test/TEST.ROOT | 6 +++-- .../DefaultMenuBar/DefaultMenuBarTest.java | 5 ++-- .../ScreenMenu/ScreenMenuMemoryLeakTest.java | 9 ++++--- .../DesktopGtkLoadTest.java | 4 ++- .../Dialog/CloseDialog/CloseDialogTest.java | 3 ++- .../DisplayChangedTest.java | 27 +++++++++---------- .../EmbeddedFrameGrabTest.java | 24 ++++++++--------- .../LoopRobustness/LoopRobustness.html | 3 ++- .../awt/EventQueue/6980209/bug6980209.java | 14 +++++----- .../FocusEmbeddedFrameTest.java | 24 ++++++++++------- .../java/awt/FontClass/HelvLtOblTest.java | 5 ++-- .../FontClass/SurrogateTest/SuppCharTest.java | 5 ++-- .../ExceptionOnSetExtendedStateTest.java | 16 ++++++----- .../MaximizedByPlatform.java | 10 ++++--- .../NormalToIconifiedTest.java | 3 ++- .../SetMaximizedBounds.java | 5 ++-- .../Frame/WindowDragTest/WindowDragTest.java | 21 ++++++++------- .../DefaultPolicyChange_Swing.java | 19 +++++++------ .../java/awt/MenuBar/8007006/bug8007006.java | 5 ++-- .../FullscreenEnterEventTest.java | 6 +++-- .../FullScreenAfterSplash.java | 4 ++- .../IOExceptionIfEncodedURLTest.java | 21 ++++++++------- .../IOExceptionIfEncodedURLTest.sh | 1 + .../MultiResolutionDragImageTest.java | 3 ++- .../HTMLDataFlavors/HTMLDataFlavorTest.java | 24 ++++++++++------- .../event/KeyEvent/8020209/bug8020209.java | 5 ++-- .../DeadKey/DeadKeyMacOSXInputText.java | 6 +++-- .../event/KeyEvent/DeadKey/deadKeyMacOSX.java | 5 ++-- .../awt/font/TextLayout/TestSinhalaChar.java | 4 ++- .../java/awt/im/6396526/IMLookAndFeel.java | 11 ++++---- jdk/test/java/awt/im/8041990/bug8041990.java | 17 +++++++----- .../awt/image/MultiResolutionImageTest.java | 4 ++- .../MultiResolutionToolkitImageTest.java | 4 ++- .../AltPlusNumberKeyCombinationsTest.java | 19 +++++++------ .../awt/print/PrinterJob/CheckPrivilege.java | 3 ++- .../awt/print/PrinterJob/ExceptionTest.java | 1 + .../ImagePrinting/NullClipARGB.java | 3 ++- .../java/awt/print/PrinterJob/Margins.java | 3 ++- .../java/awt/print/PrinterJob/PaintText.java | 3 ++- .../awt/print/PrinterJob/PrintCrashTest.java | 4 +-- .../awt/print/PrinterJob/PrintTextPane.java | 15 ++++++----- .../awt/print/PrinterJob/PrtException.java | 16 ++++++----- jdk/test/javax/print/CheckDupFlavor.java | 6 +++-- jdk/test/javax/print/PrintSE/PrintSE.sh | 7 +++-- .../javax/print/attribute/AttributeTest.java | 6 +++-- .../print/attribute/GetCopiesSupported.java | 16 ++++++----- .../print/attribute/SidesPageRangesTest.java | 9 ++++--- .../attribute/SupportedPrintableAreas.java | 5 ++-- .../swing/JComboBox/8019180/Test8019180.java | 5 ++-- .../swing/JComponent/4337267/bug4337267.java | 5 ++-- .../swing/JComponent/8043610/bug8043610.java | 19 +++++++------ .../swing/JDialog/6639507/bug6639507.java | 15 ++++++----- .../JFileChooser/6713352/bug6713352.java | 17 +++++++----- .../JFileChooser/6817933/Test6817933.java | 6 +++-- .../JFileChooser/8013442/Test8013442.java | 5 ++-- .../swing/JFrame/8016356/bug8016356.java | 19 ++++++++----- .../NSTexturedJFrame/NSTexturedJFrame.java | 4 ++- .../swing/JInternalFrame/Test6325652.java | 5 ++-- .../javax/swing/JMenu/6538132/bug6538132.java | 22 ++++++++------- .../JMenuItem/8152981/MenuItemIconTest.java | 6 +++-- .../ActionListenerCalledTwiceTest.java | 3 ++- .../swing/JPopupMenu/6217905/bug6217905.java | 23 +++++++++------- .../swing/JPopupMenu/7154841/bug7154841.java | 17 ++++++------ .../swing/JTabbedPane/7170310/bug7170310.java | 6 +++-- .../swing/JTextArea/6940863/bug6940863.java | 7 +++-- .../swing/Security/6938813/bug6938813.java | 3 ++- .../ToolTipManager/7123767/bug7123767.java | 1 + .../plaf/aqua/CustomComboBoxFocusTest.java | 20 +++++++------- .../BasicComboPopup/8154069/Bug8154069.java | 5 ++-- .../basic/BasicHTML/4960629/bug4960629.java | 18 +++++++------ .../plaf/basic/BasicLabelUI/bug7172652.java | 21 ++++++++------- .../8041642/ScrollBarThumbVisibleTest.java | 16 ++++++----- .../WrongAltProcessing.java | 15 ++++++----- .../swing/system/6799345/TestShutdown.java | 19 +++++++------ .../javax/swing/text/FlowView/LayoutTest.java | 18 +++++++------ .../swing/text/View/8015853/bug8015853.java | 5 ++-- .../javax/swing/text/html/Test4783068.java | 12 +++++---- .../IAEforEmptyFrameTest.java | 6 +++-- 78 files changed, 458 insertions(+), 324 deletions(-) diff --git a/jdk/test/TEST.ROOT b/jdk/test/TEST.ROOT index b2d2ba1bcc3..9cb3da188f2 100644 --- a/jdk/test/TEST.ROOT +++ b/jdk/test/TEST.ROOT @@ -10,9 +10,11 @@ # randomness tests. # # A "headful" test requires a graphical environment to meaningfully -# run. Tests that are not headful are "headless." +# run. Tests that are not headful are "headless". +# A test flagged with key "printer" requires a printer to succeed, else +# throws a PrinterException or the like. -keys=2d dnd i18n intermittent randomness headful jfr +keys=2d dnd headful i18n intermittent printer randomness # Tests that must run in othervm mode othervm.dirs=java/awt java/beans java/rmi javax/accessibility javax/imageio javax/sound javax/print javax/management com/sun/awt sun/awt sun/java2d sun/pisces sun/rmi diff --git a/jdk/test/com/apple/eawt/DefaultMenuBar/DefaultMenuBarTest.java b/jdk/test/com/apple/eawt/DefaultMenuBar/DefaultMenuBarTest.java index 0ca31c4f6b7..943b494a3b3 100644 --- a/jdk/test/com/apple/eawt/DefaultMenuBar/DefaultMenuBarTest.java +++ b/jdk/test/com/apple/eawt/DefaultMenuBar/DefaultMenuBarTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,8 +21,9 @@ * questions. */ -/* +/** * @test + * @key headful * @bug 8007267 * @summary [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working * @requires (os.family == "mac") diff --git a/jdk/test/com/apple/laf/ScreenMenu/ScreenMenuMemoryLeakTest.java b/jdk/test/com/apple/laf/ScreenMenu/ScreenMenuMemoryLeakTest.java index 8aabcae42c7..9971967bbb6 100644 --- a/jdk/test/com/apple/laf/ScreenMenu/ScreenMenuMemoryLeakTest.java +++ b/jdk/test/com/apple/laf/ScreenMenu/ScreenMenuMemoryLeakTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -20,13 +20,16 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -/* + +/** * @test + * @key headful * @bug 8158325 * @summary Memory leak in com.apple.laf.ScreenMenu: removed JMenuItems are still referenced * @requires (os.family == "mac") * @run main/timeout=300/othervm -Xmx16m ScreenMenuMemoryLeakTest */ + import java.awt.EventQueue; import java.lang.ref.WeakReference; import java.lang.reflect.InvocationTargetException; @@ -102,4 +105,4 @@ private static void removeMenuItemFromMenu() { Objects.requireNonNull(menuItem, "The menu item should still be available at this point"); sMenu.remove(menuItem); } -} \ No newline at end of file +} diff --git a/jdk/test/java/awt/Desktop/DesktopGtkLoadTest/DesktopGtkLoadTest.java b/jdk/test/java/awt/Desktop/DesktopGtkLoadTest/DesktopGtkLoadTest.java index 8a463554ad2..61bd013b9d3 100644 --- a/jdk/test/java/awt/Desktop/DesktopGtkLoadTest/DesktopGtkLoadTest.java +++ b/jdk/test/java/awt/Desktop/DesktopGtkLoadTest/DesktopGtkLoadTest.java @@ -21,7 +21,9 @@ * questions. */ -/* @test +/** + * @test + * @key headful * @bug 8157827 * @summary AWT_Desktop/Automated/Exceptions/BasicTest loads incorrect GTK * version when jdk.gtk.version=3 diff --git a/jdk/test/java/awt/Dialog/CloseDialog/CloseDialogTest.java b/jdk/test/java/awt/Dialog/CloseDialog/CloseDialogTest.java index 0a6288d896d..694d6e3fbd7 100644 --- a/jdk/test/java/awt/Dialog/CloseDialog/CloseDialogTest.java +++ b/jdk/test/java/awt/Dialog/CloseDialog/CloseDialogTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,6 +30,7 @@ /** * @test + * @key headful * @bug 8043705 * @summary Can't exit color chooser dialog when running as an applet * @run main CloseDialogTest diff --git a/jdk/test/java/awt/EmbeddedFrame/DisplayChangedTest/DisplayChangedTest.java b/jdk/test/java/awt/EmbeddedFrame/DisplayChangedTest/DisplayChangedTest.java index 04f2f24b414..44c3409e7db 100644 --- a/jdk/test/java/awt/EmbeddedFrame/DisplayChangedTest/DisplayChangedTest.java +++ b/jdk/test/java/awt/EmbeddedFrame/DisplayChangedTest/DisplayChangedTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,21 +21,20 @@ * questions. */ -/* - @test - @bug 4980592 - @summary switching user in XP causes an NPE in - sun.awt.windows.WWindowPeer.displayChanged - @requires (os.family == "windows") - @author son@sparc.spb.su: area=embedded - @run main DisplayChangedTest - */ /** - * DisplayChangedTest.java - * - * summary: switching user in XP causes an NPE in - * sun.awt.windows.WWindowPeer.displayChanged + * @test + * @key headful + * @bug 4980592 8171363 + * @summary switching user in XP causes an NPE in + * sun.awt.windows.WWindowPeer.displayChanged + * @requires (os.family == "windows") + * @modules java.desktop/java.awt.peer + * @modules java.desktop/sun.awt.windows:open + * @modules java.desktop/sun.awt + * @author son@sparc.spb.su: area=embedded + * @run main DisplayChangedTest */ + import java.awt.Frame; import java.awt.Dialog; import java.awt.TextArea; diff --git a/jdk/test/java/awt/EmbeddedFrame/EmbeddedFrameGrabTest/EmbeddedFrameGrabTest.java b/jdk/test/java/awt/EmbeddedFrame/EmbeddedFrameGrabTest/EmbeddedFrameGrabTest.java index 1613a804263..e708c945c20 100644 --- a/jdk/test/java/awt/EmbeddedFrame/EmbeddedFrameGrabTest/EmbeddedFrameGrabTest.java +++ b/jdk/test/java/awt/EmbeddedFrame/EmbeddedFrameGrabTest/EmbeddedFrameGrabTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,19 +21,19 @@ * questions. */ -/* - @test - @bug 6345002 - @summary grab problems with EmbeddedFrame - @requires (os.family == "windows") - @author Oleg.Semenov@sun.com area=EmbeddedFrame - @run main EmbeddedFrameGrabTest - */ /** - * EmbeddedFrameGrabTest.java - * - * summary: grab problems with EmbeddedFrame + * @test + * @key headful + * @bug 6345003 8171363 + * @summary grab problems with EmbeddedFrame + * @requires (os.family == "windows") + * @modules java.desktop/java.awt.peer + * @modules java.desktop/sun.awt + * @modules java.desktop/sun.awt.windows:open + * @author Oleg.Semenov@sun.com area=EmbeddedFrame + * @run main EmbeddedFrameGrabTest */ + import java.awt.Frame; import java.awt.peer.FramePeer; import javax.swing.JComboBox; diff --git a/jdk/test/java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.html b/jdk/test/java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.html index 3e8611d2e02..31e7015c17a 100644 --- a/jdk/test/java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.html +++ b/jdk/test/java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.html @@ -1,5 +1,5 @@