< prev index next >

test/java/awt/Mixing/AWT_Mixing/SimpleOverlappingTestBase.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * 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
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -140,11 +140,12 @@
            tests fail starting after failing mixing tests but always pass alone.
          */
         JFrame ancestor = (JFrame)(testedComponent.getTopLevelAncestor());
         if( ancestor != null ) {
             Point ancestorLoc = ancestor.getLocationOnScreen();
-            ancestorLoc.translate(ancestor.getWidth()/2-15, 2);
+            ancestorLoc.translate(isOel7() ? 5 :
+                                             ancestor.getWidth() / 2 - 15, 2);
             robot.mouseMove(ancestorLoc.x, ancestorLoc.y);
             Util.waitForIdle(robot);
             robot.mousePress(InputEvent.BUTTON1_MASK);
             robot.delay(50);
             robot.mouseRelease(InputEvent.BUTTON1_MASK);

@@ -155,7 +156,13 @@
         Util.waitForIdle(robot);
 
         return wasLWClicked;
     }
 
+    public boolean isOel7() {
+        return System.getProperty("os.name").toLowerCase()
+                .contains("linux") && System.getProperty("os.version")
+                .toLowerCase().contains("el7");
+    }
+
 }
 
< prev index next >