Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.

Commit

Permalink
8259511: java/awt/Window/MainKeyWindowTest/TestMainKeyWindow.java fai…
Browse files Browse the repository at this point in the history
…led with "RuntimeException: Test failed: 20 failure(s)"

Reviewed-by: jdv
  • Loading branch information
mrserb committed Jan 19, 2021
1 parent 14ce8f1 commit dfee7b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Expand Up @@ -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);
Expand Down
@@ -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
Expand Down Expand Up @@ -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);

Expand All @@ -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];
};
Expand Down

0 comments on commit dfee7b8

Please sign in to comment.