New issue
Advanced search Search tips

Issue 781267 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Feature

Blocking:
issue 787562



Sign in to add a comment

Write function to list all top level windows on the desktop

Project Member Reported by mar...@chromium.org, Nov 3 2017

Issue description

Goal:
Write a returns the list of top level windows, so that it can then be leveraged to self-quarantine the bot.

This would help with  issue 764415 .


AI:
In https://chromium.googlesource.com/infra/luci/luci-py.git/+/master/appengine/swarming/swarming_bot/api/platforms/win.py

Write a function with the signature:
  def list_top_windows():
    return [list of unicode of window names]

Implementation:
Call EnumWindows() + IsWindowVisible() + GetWindowTextLength() + GetWindowText()


Refs:
Win32: https://msdn.microsoft.com/en-us/library/windows/desktop/ms633497.aspx
ctypes Win32 callback: https://stackoverflow.com/a/17982521/1939810
 

Comment 1 by grt@chromium.org, Nov 7 2017

Cc: -grt@chromium.org
Owner: grt@chromium.org
Status: Started (was: Available)
Project Member

Comment 2 by bugdroid1@chromium.org, Nov 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/infra/luci/luci-py.git/+/f93c59e1a147f9914bb00a7dce9f34a29b4e1456

commit f93c59e1a147f9914bb00a7dce9f34a29b4e1456
Author: Greg Thompson <grt@chromium.org>
Date: Thu Nov 09 10:17:02 2017

Add list_top_windows function to discover the class names of topmost windows.

BUG= 764415 , 781267 
R=maruel@chromium.org

Change-Id: I3279ca01a169635c9f5c770e887782c5ced79991
Reviewed-on: https://chromium-review.googlesource.com/756700
Commit-Queue: Greg Thompson <grt@chromium.org>
Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org>

[modify] https://crrev.com/f93c59e1a147f9914bb00a7dce9f34a29b4e1456/appengine/swarming/swarming_bot/api/platforms/win.py
[modify] https://crrev.com/f93c59e1a147f9914bb00a7dce9f34a29b4e1456/appengine/swarming/swarming_bot/api/platforms/win_test.py

Comment 3 by grt@chromium.org, Nov 9 2017

Status: Fixed (was: Started)
Project Member

Comment 4 by bugdroid1@chromium.org, Nov 9 2017

The following revision refers to this bug:
  https://chrome-internal.googlesource.com/infradata/config/+/ff86618774e4f432e6ed57a67dde4e927b263f09

commit ff86618774e4f432e6ed57a67dde4e927b263f09
Author: Marc-Antoine Ruel <maruel@chromium.org>
Date: Thu Nov 09 20:54:14 2017

Project Member

Comment 5 by bugdroid1@chromium.org, Nov 10 2017

The following revision refers to this bug:
  https://chrome-internal.googlesource.com/infradata/config/+/fdbdf8fa9895c9aa66cc989eeaf7a25fb2d54cd6

commit fdbdf8fa9895c9aa66cc989eeaf7a25fb2d54cd6
Author: Marc-Antoine Ruel <maruel@chromium.org>
Date: Fri Nov 10 19:07:00 2017

Comment 6 by mar...@chromium.org, Nov 21 2017

Blocking: 787562

Comment 7 by grt@chromium.org, Dec 5 2017

We've learned that many of the #32770 dialogs found after tests ran were a result of CHROME_HEADLESS=1 not being set in the test environment (see issue 790985). As of r521127, this is set for gtest-based test. There should now be a much lower hit-rate of these dialogs. Do we have logging of topmost windows found after tests? Can we see a downward trend?
Technically the historical data exists but it's hard to process. The one-off script I wrote a few weeks back could still be used to get an instantaneous view.

Sign in to add a comment