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

Unified Diff: tools/accessibility/dump_accessibility_tree_auralinux.py

Issue 1005293002: Re-land: Resurrect Aura Linux accessibility. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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 side-by-side diff with in-line comments
Download patch
Index: tools/accessibility/dump_accessibility_tree_auralinux.py
diff --git a/tools/accessibility/dump_accessibility_tree_auralinux.py b/tools/accessibility/dump_accessibility_tree_auralinux.py
new file mode 100755
index 0000000000000000000000000000000000000000..4c352d1c4832d05c599fad16c1baafca9c480a1e
--- /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)

Powered by Google App Engine
This is Rietveld 408576698