After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 628623 - ldtp.hasstate doesn't report focused immediately after ldtp.activate
ldtp.hasstate doesn't report focused immediately after ldtp.activate
Status: RESOLVED NOTABUG
Product: LDTP
Classification: Other
Component: ldtp2
2.0.0
Other Solaris
: Normal normal
: ---
Assigned To: LDTP Development Mailing List
LDTP Development Mailing List
Depends on:
Blocks:
 
 
Reported: 2010-09-02 15:49 UTC by Brian Nitz
Modified: 2010-09-09 09:10 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Brian Nitz 2010-09-02 15:49:50 UTC
ldtp.hasstate for some applications (e.g. gnome-terminal) never shows state.FOCUSED even if the application is focused and even immediately after wnck focus or ldtp.activatewindow('frmTerminal')

steps to reproduce:

python
>>>import ldtp
>>>ldtp.hasstate('frmTerminal','txt0',ldtp.state.FOCUSED)
0
>>>ldtp.activate('frmTerminal')
1
>>>ldtp.hasstate('frmTerminal','txt0',ldtp.state.FOCUSED)
0
Comment 1 Nagappan Alagappan 2010-09-07 20:58:31 UTC
Looks like the FOCUSED state doesn't exist in frame / dialog level. When checked with accerciser, I could not see the FOCUSED state. Its either bug in application or the functionality limitation. Its not bug in LDTP.

Closing the bug.

Thanks
Comment 2 Brian Nitz 2010-09-08 09:31:19 UTC
Thanks Nagappan.  That sounds like a test case I should add the a11y testbot.  Something like:

activatewindow({frame of application})
Either frmTerminal (or a dialog child?  or _ANY_ focusable child???) should have state.FOCUSED
Comment 3 Nagappan Alagappan 2010-09-08 18:47:54 UTC
(In reply to comment #2)
> activatewindow({frame of application})
> Either frmTerminal (or a dialog child?  or _ANY_ focusable child???) should
> have state.FOCUSED

I noticed state.ACTIVE is appropriate in Window level, just give a try with this:

>>> from ldtp import *
>>> hasstate('frmTerminal', 'frmTerminal', state.ACTIVE) # Terminal in focus
1
>>> wait(2);hasstate('frmTerminal', 'frmTerminal', state.ACTIVE) # Terminal *not* in focus
1
0
>>> wait(2);hasstate('frm*-gedit', 'frm*-gedit', state.ACTIVE) # Gedit *not* in focus
1
0
>>> wait(2);hasstate('frm*-gedit', 'frm*-gedit', state.ACTIVE) # Gedit in focus
1
1

Thanks
Comment 4 Brian Nitz 2010-09-09 09:10:33 UTC
Yes I've tried all of these and they work just as you indicated they should.

Should active windows always have one and only one child with state focused?