8196301: java/awt/print/PrinterJob/Margins.java times out
Reviewed-by: prr
This commit is contained in:
parent
7e78c77713
commit
ed93bc9a01
test/jdk
@ -272,8 +272,6 @@ java/awt/Graphics2D/DrawString/DrawRotatedStringUsingRotatedFont.java 8197796 ge
|
||||
java/awt/TextArea/TextAreaScrolling/TextAreaScrolling.java 8196300 windows-all
|
||||
java/awt/print/PrinterJob/PSQuestionMark.java 7003378 generic-all
|
||||
java/awt/print/PrinterJob/GlyphPositions.java 7003378 generic-all
|
||||
java/awt/print/PrinterJob/Margins.java 8196301 windows-all,macosx-all
|
||||
java/awt/PrintJob/PrinterException.java 8196301 windows-all,macosx-all
|
||||
java/awt/Choice/PopupPosTest/PopupPosTest.java 8197811 windows-all
|
||||
java/awt/Choice/ChoiceMouseWheelTest/ChoiceMouseWheelTest.java 7100044 macosx-all,linux-all
|
||||
java/awt/Component/GetScreenLocTest/GetScreenLocTest.java 4753654 generic-all
|
||||
|
@ -39,11 +39,11 @@ public class PrinterException {
|
||||
public static void main(String[] args) throws Exception {
|
||||
Robot robot = new Robot();
|
||||
Thread t = new Thread (() -> {
|
||||
robot.waitForIdle();
|
||||
robot.delay(2000);
|
||||
robot.keyPress(KeyEvent.VK_ESCAPE);
|
||||
robot.keyRelease(KeyEvent.VK_ESCAPE);
|
||||
});
|
||||
robot.waitForIdle();
|
||||
});
|
||||
Toolkit tk = Toolkit.getDefaultToolkit();
|
||||
PrintJob pj = null;
|
||||
|
||||
|
@ -37,6 +37,8 @@ import java.awt.print.Printable;
|
||||
import java.awt.print.PageFormat;
|
||||
import java.awt.print.Paper;
|
||||
import java.awt.print.PrinterException;
|
||||
import javax.print.PrintService;
|
||||
import javax.print.PrintServiceLookup;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Color;
|
||||
@ -47,28 +49,26 @@ public class Margins implements Printable {
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
Robot robot = new Robot();
|
||||
Thread t = new Thread (() -> {
|
||||
robot.waitForIdle();
|
||||
robot.delay(5000);
|
||||
robot.keyPress(KeyEvent.VK_ENTER);
|
||||
robot.keyRelease(KeyEvent.VK_ENTER);
|
||||
robot.waitForIdle();
|
||||
robot.delay(5000);
|
||||
robot.keyPress(KeyEvent.VK_ENTER);
|
||||
robot.keyRelease(KeyEvent.VK_ENTER);
|
||||
robot.waitForIdle();
|
||||
robot.delay(5000);
|
||||
robot.keyPress(KeyEvent.VK_ENTER);
|
||||
robot.keyRelease(KeyEvent.VK_ENTER);
|
||||
});
|
||||
|
||||
PrinterJob job = PrinterJob.getPrinterJob();
|
||||
if (job.getPrintService() == null) {
|
||||
System.out.println("No printers. Test cannot continue");
|
||||
return;
|
||||
}
|
||||
PrintService psrv = PrintServiceLookup.lookupDefaultPrintService();
|
||||
System.out.println("PrintService " + psrv.getName());
|
||||
|
||||
PageFormat pageFormat = job.defaultPage();
|
||||
Paper paper = pageFormat.getPaper();
|
||||
double wid = paper.getWidth();
|
||||
double hgt = paper.getHeight();
|
||||
paper.setImageableArea(0, -10, wid, hgt);
|
||||
t.start();
|
||||
|
||||
Thread t1 = new Thread(() -> {
|
||||
robot.delay(2000);
|
||||
robot.keyPress(KeyEvent.VK_ENTER);
|
||||
robot.keyRelease(KeyEvent.VK_ENTER);
|
||||
});
|
||||
t1.start();
|
||||
|
||||
pageFormat = job.pageDialog(pageFormat);
|
||||
pageFormat.setPaper(paper);
|
||||
@ -79,6 +79,14 @@ public class Margins implements Printable {
|
||||
}
|
||||
|
||||
paper.setImageableArea(0, 0, wid, hgt + 72);
|
||||
|
||||
Thread t2 = new Thread(() -> {
|
||||
robot.delay(2000);
|
||||
robot.keyPress(KeyEvent.VK_ENTER);
|
||||
robot.keyRelease(KeyEvent.VK_ENTER);
|
||||
});
|
||||
t2.start();
|
||||
|
||||
pageFormat = job.pageDialog(pageFormat);
|
||||
pageFormat.setPaper(paper);
|
||||
|
||||
@ -94,6 +102,14 @@ public class Margins implements Printable {
|
||||
hgt = paper.getHeight();
|
||||
|
||||
paper.setImageableArea(0, -10, -wid, hgt);
|
||||
|
||||
Thread t3 = new Thread(() -> {
|
||||
robot.delay(2000);
|
||||
robot.keyPress(KeyEvent.VK_ENTER);
|
||||
robot.keyRelease(KeyEvent.VK_ENTER);
|
||||
});
|
||||
t3.start();
|
||||
|
||||
pageFormat = job.pageDialog(pageFormat);
|
||||
pageFormat.setPaper(paper);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user