Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: tools/accessibility/dump_accessibility_tree_auralinux.py

Issue 975113002: Resurrect Aura Linux accessibility. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Call g_type_init from ax_platform_node_auralinux instead Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright 2015 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 """Dump Chrome's ATK accessibility tree to the command line.
7
8 Accerciser is slow and buggy. This is a quick way to check that Chrome is
9 exposing its interface to ATK from the command line.
10 """
11
12 import pyatspi
13
14 def Dump(obj, indent):
15 if not obj:
16 return
17 indent_str = ' ' * indent
18 role = obj.get_role_name()
19 name = obj.get_name()
20 print '%s%s name="%s"' % (indent_str, role, name)
21
22 # Don't recurse into applications other than Chrome
23 if role == 'application':
24 if (name.lower().find('chrom') != 0 and
25 name.lower().find('google chrome') != 0):
26 return
27
28 for i in range(obj.get_child_count()):
29 Dump(obj.get_child_at_index(i), indent + 1)
30
31 desktop = pyatspi.Registry.getDesktop(0)
32 Dump(desktop, 0)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698