public inbox for mauve-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Pavel Tisnovsky <ptisnovs@redhat.com>
To: mauve-discuss@sourceware.org
Subject: RFC: fix for a test gnu/testlet/java/awt/Container/addImpl.java & its helper class gnu/testlet/java/awt/Container/DisabledEventQueue.java
Date: Fri, 30 Sep 2011 12:57:00 -0000	[thread overview]
Message-ID: <4E85BD14.2070600@redhat.com> (raw)

Greetings,

the Mauve test gnu/testlet/java/awt/Container/addImpl.java in its current implementation
left opened frame on the desktop, which caused some other AWT-related tests to fail. Here's
a (quite obvious) fix for this test:

--- mauve/gnu/testlet/java/awt/Container/addImpl.java_old       2006-03-15 16:22:05.000000000 +0100
+++ mauve/gnu/testlet/java/awt/Container/addImpl.java   2011-09-30 13:46:05.000000000 +0200
@@ -233,7 +233,8 @@
     c.setSize(100,100);
     f.add(a);
     f.pack();
-    f.show();
+    f.show();
+
     harness.check(a.isShowing(), true);
     harness.check(c.isShowing(), true);
     harness.check(l.isShowing(), true);
@@ -241,5 +242,8 @@
     harness.check(c.isLightweight(), true);
     harness.check(a.isLightweight(), false);
     harness.check(l.isLightweight(), false);
+
+    // clean up the frame from desktop
+    f.dispose();
   }
 }

However the mentioned test uses its own implementation of EventQueue named DisabledEventQueue. This implementation
"eats" all events, including events sent by X Window system during disposing frame which means that the method
f.dispose() lock up (because the X Window can not cooperate with the frame in both directions).
As a result also DisableEventQueue class should be updated, which is quite easy because we only want to "eat" paint
events, not other events (and this class is not used by other test). Here's proposed fix:

--- mauve/gnu/testlet/java/awt/Container/DisabledEventQueue.java_old    2005-11-02 16:16:38.000000000 +0100
+++ mauve/gnu/testlet/java/awt/Container/DisabledEventQueue.java        2011-09-30 12:51:40.000000000 +0200
@@ -36,7 +36,14 @@
    */
   protected void dispatchEvent(AWTEvent ev)
   {
-    // Do nothing.
+    if (ev instanceof java.awt.event.PaintEvent)
+      {
+        // Do nothing.
+      }
+    else
+      {
+        super.dispatchEvent(ev);
+      }
   }

   /**
@@ -44,6 +51,13 @@
    */
   public void postEvent(AWTEvent ev)
   {
-    // Do nothing.
+    if (ev instanceof java.awt.event.PaintEvent)
+      {
+        // Do nothing.
+      }
+    else
+      {
+        super.postEvent(ev);
+      }
   }
 }

Can anybody please review this change? (it's been tested, of course ;)

Pavel

                 reply	other threads:[~2011-09-30 12:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4E85BD14.2070600@redhat.com \
    --to=ptisnovs@redhat.com \
    --cc=mauve-discuss@sourceware.org \
    /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).