diff options
author | dmazzoni <dmazzoni@chromium.org> | 2015-03-12 08:11:51 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-12 15:12:28 +0000 |
commit | 9d4fb1bdc8d40d61f62e8d02fa38ed05fdc43d2c (patch) | |
tree | 9be4d271d24940d83198ea4a2b6c8ab1a96212ec /tools/accessibility | |
parent | c0c555faa974ea38af8f7007737b1566a841c3e4 (diff) | |
download | chromium_src-9d4fb1bdc8d40d61f62e8d02fa38ed05fdc43d2c.zip chromium_src-9d4fb1bdc8d40d61f62e8d02fa38ed05fdc43d2c.tar.gz chromium_src-9d4fb1bdc8d40d61f62e8d02fa38ed05fdc43d2c.tar.bz2 |
Quick tool to test ATK support from the command line.
BUG=463671
Review URL: https://codereview.chromium.org/1000743002
Cr-Commit-Position: refs/heads/master@{#320279}
Diffstat (limited to 'tools/accessibility')
-rwxr-xr-x | tools/accessibility/dump_accessibility_tree_auralinux.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tools/accessibility/dump_accessibility_tree_auralinux.py b/tools/accessibility/dump_accessibility_tree_auralinux.py new file mode 100755 index 0000000..4c352d1 --- /dev/null +++ b/tools/accessibility/dump_accessibility_tree_auralinux.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Dump Chrome's ATK accessibility tree to the command line. + +Accerciser is slow and buggy. This is a quick way to check that Chrome is +exposing its interface to ATK from the command line. +""" + +import pyatspi + +def Dump(obj, indent): + if not obj: + return + indent_str = ' ' * indent + role = obj.get_role_name() + name = obj.get_name() + print '%s%s name="%s"' % (indent_str, role, name) + + # Don't recurse into applications other than Chrome + if role == 'application': + if (name.lower().find('chrom') != 0 and + name.lower().find('google chrome') != 0): + return + + for i in range(obj.get_child_count()): + Dump(obj.get_child_at_index(i), indent + 1) + +desktop = pyatspi.Registry.getDesktop(0) +Dump(desktop, 0) |