Skip to content

8339906: Open source several AWT focus tests - series 4#21051

Closed
prsadhuk wants to merge 7 commits intoopenjdk:masterfrom
prsadhuk:JDK-8339906
Closed

8339906: Open source several AWT focus tests - series 4#21051
prsadhuk wants to merge 7 commits intoopenjdk:masterfrom
prsadhuk:JDK-8339906

Conversation

@prsadhuk
Copy link
Contributor

@prsadhuk prsadhuk commented Sep 18, 2024

Opensource few Focus tests


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8339906: Open source several AWT focus tests - series 4 (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/21051/head:pull/21051
$ git checkout pull/21051

Update a local copy of the PR:
$ git checkout pull/21051
$ git pull https://git.openjdk.org/jdk.git pull/21051/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 21051

View PR using the GUI difftool:
$ git pr show -t 21051

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/21051.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 18, 2024

👋 Welcome back psadhukhan! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Sep 18, 2024

@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:

8339906: Open source several AWT focus tests - series 4

Reviewed-by: abhiscxk, prr

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 master branch:

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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 18, 2024
@openjdk
Copy link

openjdk bot commented Sep 18, 2024

@prsadhuk The following label will be automatically applied to this pull request:

  • client

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the client client-libs-dev@openjdk.org label Sep 18, 2024
@mlbridge
Copy link

mlbridge bot commented Sep 18, 2024

Webrevs

@openjdk openjdk bot removed the rfr Pull request is ready for review label Sep 18, 2024
@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 18, 2024
* @test
* @bug 4982943
* @key headful
* @summary focus lost in text fields or text areas, unable to enter characters from keyboar
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keyboar -> keyboard

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@prrace Fixed but it revokes the approval....Please reapprove or someone "R"eviewer awake in this TZ to approve this minor change..

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Sep 19, 2024
@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Sep 20, 2024
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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
WINDOW_DEACTIVATED,WINDOW_LOST_FOCUS event were generated.
WINDOW_DEACTIVATED, WINDOW_LOST_FOCUS event were generated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

.instructions(INSTRUCTIONS)
.rows((int) INSTRUCTIONS.lines().count() + 5)
.columns(35)
.testUI(AltTabEventsTest::createTestUI)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be changed to new Test(); and thus leading to remove the createTestUI() method.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you missed this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be replaced with PassFailJFrame.log everywhere. Anyways there is a repetition of println.

Suggested change
println(e.toString());
PassFailJFrame.log(e.toString());

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will be same..

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

println method can be removed if PassFailJFrame.log is used directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then PassFailJFrame.log will be repeated, so it's same...dont think it's critical to change..

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, not critical.

public ComponentLostFocusTest() {
try{
r = new Robot();
} catch(Exception e){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
} catch(Exception e){
} catch (Exception e) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

}
});

frame.setLayout (new FlowLayout ());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
frame.setLayout (new FlowLayout ());
frame.setLayout (new FlowLayout());

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Comment on lines +110 to +111
System.out.println("Focused window: " + KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusedWindow());
System.out.println("Focus owner: " + KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please limit it to 80 cols.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

}
}

private void doRequestFocusToTextField(){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private void doRequestFocusToTextField(){
private void doRequestFocusToTextField() {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

tf.requestFocus();
}

public static final void main(String args[]){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public static final void main(String args[]){
public static final void main(String args[]) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Comment on lines +120 to +121
Point loc = frame.getLocationOnScreen();
r.mouseMove(loc.x + frame.getWidth()/2, loc.y + frame.getInsets().top/2);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be accessed on EDT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

frame.getWidth also should be on EDT ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

r = new Robot();
r.setAutoDelay(100);

ComponentLostFocusTest test;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused variable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

r.setAutoDelay(100);
static Dialog dialog = null;
static volatile boolean passed;
static Point loc;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be volatile also?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Contributor

@kumarabhi006 kumarabhi006 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hope you have run the automated test in CI.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Sep 20, 2024
@prsadhuk
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Sep 20, 2024

Going to push as commit 46b02f4.
Since your change was applied there have been 83 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Sep 20, 2024
@openjdk openjdk bot closed this Sep 20, 2024
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Sep 20, 2024
@openjdk
Copy link

openjdk bot commented Sep 20, 2024

@prsadhuk Pushed as commit 46b02f4.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@prsadhuk prsadhuk deleted the JDK-8339906 branch September 20, 2024 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client client-libs-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants