Skip to content
Permalink
Browse files
8259511: java/awt/Window/MainKeyWindowTest/TestMainKeyWindow.java fai…
…led with "RuntimeException: Test failed: 20 failure(s)"

Reviewed-by: jdv
  • Loading branch information
mrserb committed Jan 19, 2021
1 parent 14ce8f1 commit dfee7b8ad6b3e3a491af7ca98403e0d37fea893c
Showing with 4 additions and 4 deletions.
  1. +1 −1 test/jdk/java/awt/Window/MainKeyWindowTest/TestMainKeyWindow.java
  2. +3 −3 test/jdk/java/awt/Window/MainKeyWindowTest/libTestMainKeyWindow.c
@@ -388,7 +388,7 @@ public static void main(String[] args) throws Exception
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);
@@ -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];
};

1 comment on commit dfee7b8

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on dfee7b8 Jan 19, 2021

Please sign in to comment.