8339906: Open source several AWT focus tests - series 4#21051
8339906: Open source several AWT focus tests - series 4#21051prsadhuk wants to merge 7 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back psadhukhan! A progress list of the required criteria for merging this PR into |
|
@prsadhuk This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 83 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
| * @test | ||
| * @bug 4982943 | ||
| * @key headful | ||
| * @summary focus lost in text fields or text areas, unable to enter characters from keyboar |
There was a problem hiding this comment.
@prrace Fixed but it revokes the approval....Please reapprove or someone "R"eviewer awake in this TZ to approve this minor change..
| 1. Make F1 active by clicking on it. | ||
| 2. Press Alt-tab. | ||
| In the messqge dialog area you should see that | ||
| WINDOW_DEACTIVATED,WINDOW_LOST_FOCUS event were generated. |
There was a problem hiding this comment.
| WINDOW_DEACTIVATED,WINDOW_LOST_FOCUS event were generated. | |
| WINDOW_DEACTIVATED, WINDOW_LOST_FOCUS event were generated. |
| .instructions(INSTRUCTIONS) | ||
| .rows((int) INSTRUCTIONS.lines().count() + 5) | ||
| .columns(35) | ||
| .testUI(AltTabEventsTest::createTestUI) |
There was a problem hiding this comment.
can be changed to new Test(); and thus leading to remove the createTestUI() method.
There was a problem hiding this comment.
Looks like you missed this.
There was a problem hiding this comment.
Sorry, it was a mistake on my side. Don't know why but updated test was not shown. It is updated now.
| super("Test for 4524015"); | ||
| WindowAdapter wa = new WindowAdapter() { | ||
| public void windowActivated(WindowEvent e) { | ||
| println(e.toString()); |
There was a problem hiding this comment.
can be replaced with PassFailJFrame.log everywhere. Anyways there is a repetition of println.
| println(e.toString()); | |
| PassFailJFrame.log(e.toString()); |
There was a problem hiding this comment.
println method can be removed if PassFailJFrame.log is used directly.
There was a problem hiding this comment.
Then PassFailJFrame.log will be repeated, so it's same...dont think it's critical to change..
| public ComponentLostFocusTest() { | ||
| try{ | ||
| r = new Robot(); | ||
| } catch(Exception e){ |
There was a problem hiding this comment.
| } catch(Exception e){ | |
| } catch (Exception e) { |
| } | ||
| }); | ||
|
|
||
| frame.setLayout (new FlowLayout ()); |
There was a problem hiding this comment.
| frame.setLayout (new FlowLayout ()); | |
| frame.setLayout (new FlowLayout()); |
| System.out.println("Focused window: " + KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusedWindow()); | ||
| System.out.println("Focus owner: " + KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner()); |
There was a problem hiding this comment.
please limit it to 80 cols.
| } | ||
| } | ||
|
|
||
| private void doRequestFocusToTextField(){ |
There was a problem hiding this comment.
| private void doRequestFocusToTextField(){ | |
| private void doRequestFocusToTextField() { |
| private void doRequestFocusToTextField(){ | ||
| // do activation using press title | ||
| Point loc = frame.getLocationOnScreen(); | ||
| r.mouseMove(loc.x + frame.getWidth()/2, loc.y + frame.getInsets().top/2); |
There was a problem hiding this comment.
| r.mouseMove(loc.x + frame.getWidth()/2, loc.y + frame.getInsets().top/2); | |
| r.mouseMove(loc.x + frame.getWidth() / 2, loc.y + frame.getInsets().top / 2); |
| tf.requestFocus(); | ||
| } | ||
|
|
||
| public static final void main(String args[]){ |
There was a problem hiding this comment.
| public static final void main(String args[]){ | |
| public static final void main(String args[]) { |
| Point loc = frame.getLocationOnScreen(); | ||
| r.mouseMove(loc.x + frame.getWidth()/2, loc.y + frame.getInsets().top/2); |
There was a problem hiding this comment.
Should it be accessed on EDT?
There was a problem hiding this comment.
modified test to put relevant portion under EDT and also added dispose..
| // do activation using press title | ||
| Point loc = frame.getLocationOnScreen(); | ||
| r.mouseMove(loc.x + frame.getWidth()/2, loc.y + frame.getInsets().top/2); | ||
| r.mouseMove(loc.x + frame.getWidth() / 2, loc.y + frame.getInsets().top / 2); |
There was a problem hiding this comment.
frame.getWidth also should be on EDT ?
| r = new Robot(); | ||
| r.setAutoDelay(100); | ||
|
|
||
| ComponentLostFocusTest test; |
| r.setAutoDelay(100); | ||
| static Dialog dialog = null; | ||
| static volatile boolean passed; | ||
| static Point loc; |
There was a problem hiding this comment.
Should it be volatile also?
kumarabhi006
left a comment
There was a problem hiding this comment.
Hope you have run the automated test in CI.
|
/integrate |
|
Going to push as commit 46b02f4.
Your commit was automatically rebased without conflicts. |
Opensource few Focus tests
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/21051/head:pull/21051$ git checkout pull/21051Update a local copy of the PR:
$ git checkout pull/21051$ git pull https://git.openjdk.org/jdk.git pull/21051/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 21051View PR using the GUI difftool:
$ git pr show -t 21051Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/21051.diff
Webrev
Link to Webrev Comment