8160882: [PIT][TEST_BUG] a trap of java/awt/print/PrinterJob/PrintTestLexmarkIQ.java
authorpsadhukhan
Mon, 11 Jul 2016 16:39:11 +0530
changeset 39849 2122a528e341
parent 39848 e06eb1994d3d
child 39850 81332a77764d
8160882: [PIT][TEST_BUG] a trap of java/awt/print/PrinterJob/PrintTestLexmarkIQ.java Reviewed-by: yan
jdk/test/java/awt/print/PrinterJob/PrintTestLexmarkIQ.java
--- a/jdk/test/java/awt/print/PrinterJob/PrintTestLexmarkIQ.java	Mon Jul 11 14:56:17 2016 +0530
+++ b/jdk/test/java/awt/print/PrinterJob/PrintTestLexmarkIQ.java	Mon Jul 11 16:39:11 2016 +0530
@@ -20,9 +20,9 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-/*
+ /*
  * @test
- * @bug 6966350
+ * @bug 6966350 8160882
  * @summary Verifies if Empty pages are printed on Lexmark E352dn PS3
  *           with "1200 IQ" setting
  * @run main/manual PrintTestLexmarkIQ
@@ -33,6 +33,8 @@
 import java.awt.Font;
 import java.awt.Graphics;
 import java.awt.Graphics2D;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
 import java.awt.geom.Rectangle2D;
 import java.awt.print.PageFormat;
 import java.awt.print.Paper;
@@ -145,6 +147,13 @@
         dialog.add(mainPanel);
         dialog.pack();
         dialog.setVisible(true);
+        dialog.addWindowListener(new WindowAdapter() {
+            public void windowClosing(WindowEvent e) {
+                System.out.println("main dialog closing");
+                testGeneratedInterrupt = false;
+                mainThread.interrupt();
+            }
+        });
     }
 
     public int print(Graphics g, PageFormat pf, int pi)