This is the mail archive of the mailing list for the Mauve project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFC: Fix for Mauve test gnu/testlet/java/awt/Canvas/


I've made a simple patch for the Mauve test gnu/testlet/java/awt/Canvas/

This patch adds a small delay before computation of canvas size and its
absolute position on the screen is done. There's also added a test for
a color of a pixel located inside the canvas.

--- gnu/testlet/java/awt/Canvas/      2008-05-21 16:17:54.000000000 +0200
+++ gnu/testlet/java/awt/Canvas/  2011-09-26 16:31:01.000000000 +0200
@@ -1,5 +1,5 @@
 /* --
-   Copyright (C) 2006 Red Hat
+   Copyright (C) 2006, 2011 Red Hat
 This file is part of Mauve.

 Mauve is free software; you can redistribute it and/or modify
@@ -60,13 +60,24 @@
+    Robot r = harness.createRobot();
+    // we should wait a moment before the computations
+    // and pixel checks is done
+    r.waitForIdle();
     Point loc = f.getLocationOnScreen();
     Rectangle bounds = c.getBounds();
     Insets i = f.getInsets();
     bounds.x += i.left + loc.x;
     bounds.y += + loc.y;

-    Robot r = harness.createRobot();
+    // check the color of a pixel located in the canvas centre
+    Color but = r.getPixelColor(bounds.x + bounds.width/2, bounds.y + bounds.height/2);
+    harness.check(but.equals(;
+    // and also check color in all four canvas corners
     LocationTests.checkRectangleCornerColors(harness, r, bounds,, true);

     // There is a delay to avoid any race conditions

Can anybody please review this change?

Thank you in advance,

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]