Skip to content

Commit dfee7b8

Browse files
committedJan 19, 2021
8259511: java/awt/Window/MainKeyWindowTest/TestMainKeyWindow.java failed with "RuntimeException: Test failed: 20 failure(s)"
Reviewed-by: jdv
1 parent 14ce8f1 commit dfee7b8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
 

‎test/jdk/java/awt/Window/MainKeyWindowTest/TestMainKeyWindow.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ public static void main(String[] args) throws Exception
388388
MenuBar mb = new MenuBar();
389389
mb.add(new Menu("Hello"));
390390
frame.setMenuBar(mb);
391-
frame.setBounds(400, 180, 1068, 821);
391+
frame.setBounds(400, 180, 300, 300);
392392
frame.setVisible(true);
393393
frame.toFront();
394394
Thread.sleep(20_000);

‎test/jdk/java/awt/Window/MainKeyWindowTest/libTestMainKeyWindow.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* 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)
3939
JNF_COCOA_ENTER(env);
4040

4141
void (^block)() = ^(){
42-
NSScreen *mainScreen = [NSScreen mainScreen];
42+
NSScreen *mainScreen = [[NSScreen screens] objectAtIndex:0];
4343
NSRect screenFrame = [mainScreen frame];
4444
NSRect frame = NSMakeRect(130, screenFrame.size.height - 280, 200, 100);
4545

@@ -60,7 +60,7 @@ JNIEXPORT void JNICALL Java_TestMainKeyWindow_setup(JNIEnv *env, jclass cl)
6060
colorPanel = [[NSColorPanel sharedColorPanel] retain];
6161
[colorPanel setReleasedWhenClosed: YES];
6262
colorPanel.restorable = NO;
63-
[colorPanel setFrameTopLeftPoint: NSMakePoint(130, screenFrame.size.height - 300)];
63+
[colorPanel setFrame:NSMakeRect(130, screenFrame.size.height - 500, 200, 200) display:NO];
6464
// Java coordinates are 100, 400
6565
[colorPanel makeKeyAndOrderFront: nil];
6666
};

0 commit comments

Comments
 (0)
Please sign in to comment.