From: Pavel Tisnovsky <ptisnovs@redhat.com>
To: mauve-discuss@sourceware.org
Cc: Omair Majid <omajid@redhat.com>
Subject: RFC: Fix for Mauve test gnu/testlet/java/awt/Canvas/PaintTest.java
Date: Mon, 26 Sep 2011 15:30:00 -0000 [thread overview]
Message-ID: <4E809AF8.8060008@redhat.com> (raw)
Greetings,
I've made a simple patch for the Mauve test gnu/testlet/java/awt/Canvas/PaintTest.java
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/PaintTest.java.old 2008-05-21 16:17:54.000000000 +0200
+++ gnu/testlet/java/awt/Canvas/PaintTest.java 2011-09-26 16:31:01.000000000 +0200
@@ -1,5 +1,5 @@
/* PaintTest.java --
- 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 @@
f.add(this);
f.pack();
f.show();
+
+ 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 += i.top + 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(Color.blue));
+
+ // and also check color in all four canvas corners
LocationTests.checkRectangleCornerColors(harness, r, bounds, Color.blue, true);
// There is a delay to avoid any race conditions
Can anybody please review this change?
Thank you in advance,
Pavel
next reply other threads:[~2011-09-26 15:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-26 15:30 Pavel Tisnovsky [this message]
2011-09-27 8:46 ` Mark Wielaard
2011-09-29 9:40 ` Pavel Tisnovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E809AF8.8060008@redhat.com \
--to=ptisnovs@redhat.com \
--cc=mauve-discuss@sourceware.org \
--cc=omajid@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).