Skip to content

Commit

Permalink
6829250: Reg test: java/awt/Toolkit/ScreenInsetsTest/ScreenInsetsTest…
Browse files Browse the repository at this point in the history
….java fails in Windows

Reviewed-by: prr
  • Loading branch information
Alexander Zuev committed May 13, 2022
1 parent 273c732 commit f56396f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 0 additions & 1 deletion test/jdk/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ java/awt/Mixing/NonOpaqueInternalFrame.java 7124549 macosx-all
java/awt/Focus/ActualFocusedWindowTest/ActualFocusedWindowRetaining.java 6829264 generic-all
java/awt/datatransfer/DragImage/MultiResolutionDragImageTest.java 8080982 generic-all
java/awt/datatransfer/SystemFlavorMap/AddFlavorTest.java 8079268 linux-all
java/awt/Toolkit/ScreenInsetsTest/ScreenInsetsTest.java 6829250 windows-all
java/awt/Toolkit/RealSync/Test.java 6849383 linux-all
java/awt/LightweightComponent/LightweightEventTest/LightweightEventTest.java 8159252 windows-all
java/awt/EventDispatchThread/HandleExceptionOnEDT/HandleExceptionOnEDT.java 8072110 macosx-all
Expand Down
11 changes: 8 additions & 3 deletions test/jdk/java/awt/Toolkit/ScreenInsetsTest/ScreenInsetsTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2022, 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
Expand Down Expand Up @@ -51,7 +51,6 @@ public static void main(String[] args)
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice[] gds = ge.getScreenDevices();
for (GraphicsDevice gd : gds) {

GraphicsConfiguration gc = gd.getDefaultConfiguration();
Rectangle gcBounds = gc.getBounds();
Insets gcInsets = Toolkit.getDefaultToolkit().getScreenInsets(gc);
Expand Down Expand Up @@ -100,7 +99,13 @@ public static void main(String[] args)
gcBounds.y + gcBounds.height - fBounds.y - fBounds.height,
gcBounds.x + gcBounds.width - fBounds.x - fBounds.width);

if (!expected.equals(gcInsets))
// On Windows 10 and up system allows undecorated maximized windows
// to be placed over the taskbar so calculated insets might
// be smaller than reported ones depending on the taskbar position
if (gcInsets.top < expected.top
|| gcInsets.bottom < expected.bottom
|| gcInsets.left < expected.left
|| gcInsets.right < expected.right)
{
passed = false;
System.err.println("Wrong insets for GraphicsConfig: " + gc);
Expand Down

3 comments on commit f56396f

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Rudometov
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk17u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on f56396f Oct 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Rudometov the backport was successfully created on the branch Rudometov-backport-f56396f1 in my personal fork of openjdk/jdk17u-dev. To create a pull request with this backport targeting openjdk/jdk17u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit f56396f1 from the openjdk/jdk repository.

The commit being backported was authored by Alexander Zuev on 13 May 2022 and was reviewed by Phil Race.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u-dev:

$ git fetch https://github.com/openjdk-bots/jdk17u-dev Rudometov-backport-f56396f1:Rudometov-backport-f56396f1
$ git checkout Rudometov-backport-f56396f1
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u-dev Rudometov-backport-f56396f1

Please sign in to comment.