8259511: java/awt/Window/MainKeyWindowTest/TestMainKeyWindow.java failed with "RuntimeException: Test failed: 20 failure(s)"

Reviewed-by: jdv
This commit is contained in:
Sergey Bylokhov 2021-01-19 07:16:02 +00:00
parent 14ce8f1a52
commit dfee7b8ad6
2 changed files with 4 additions and 4 deletions

View File

@ -388,7 +388,7 @@ public class TestMainKeyWindow
MenuBar mb = new MenuBar();
mb.add(new Menu("Hello"));
frame.setMenuBar(mb);
frame.setBounds(400, 180, 1068, 821);
frame.setBounds(400, 180, 300, 300);
frame.setVisible(true);
frame.toFront();
Thread.sleep(20_000);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -39,7 +39,7 @@ JNIEXPORT void JNICALL Java_TestMainKeyWindow_setup(JNIEnv *env, jclass cl)
JNF_COCOA_ENTER(env);
void (^block)() = ^(){
NSScreen *mainScreen = [NSScreen mainScreen];
NSScreen *mainScreen = [[NSScreen screens] objectAtIndex:0];
NSRect screenFrame = [mainScreen frame];
NSRect frame = NSMakeRect(130, screenFrame.size.height - 280, 200, 100);
@ -60,7 +60,7 @@ JNIEXPORT void JNICALL Java_TestMainKeyWindow_setup(JNIEnv *env, jclass cl)
colorPanel = [[NSColorPanel sharedColorPanel] retain];
[colorPanel setReleasedWhenClosed: YES];
colorPanel.restorable = NO;
[colorPanel setFrameTopLeftPoint: NSMakePoint(130, screenFrame.size.height - 300)];
[colorPanel setFrame:NSMakeRect(130, screenFrame.size.height - 500, 200, 200) display:NO];
// Java coordinates are 100, 400
[colorPanel makeKeyAndOrderFront: nil];
};