diff options
author | Daniel Narvaez <dwnarvaez@gmail.com> | 2013-01-10 11:08:19 (GMT) |
---|---|---|
committer | Daniel Narvaez <dwnarvaez@gmail.com> | 2013-01-10 11:08:19 (GMT) |
commit | 0291b103a8e76003edb9766dc243b4595125b6dd (patch) | |
tree | df83ca5cd666c6b9fb00545cb9c6415d56376eb8 /tests/sugar | |
parent | 1ab2ee46aa661e1a71996c624e2ed4c1b825dcb5 (diff) |
Revert "root_accessible might be None too"
This reverts commit 2defc4cddbd09fd919c8972ab64cc498d8ac260a.
Diffstat (limited to 'tests/sugar')
-rw-r--r-- | tests/sugar/tree.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/sugar/tree.py b/tests/sugar/tree.py index 9a81f11..6607371 100644 --- a/tests/sugar/tree.py +++ b/tests/sugar/tree.py @@ -8,15 +8,15 @@ Atspi.set_timeout(-1, -1) def get_root(wait=True): + desktop = Node(Atspi.get_desktop(0)) + + if not wait: + return desktop + n_tries = 0 - while n_tries < 5: - root_accessible = Atspi.get_desktop(0) - if root_accessible: - desktop = Node(root_accessible) - if desktop.get_children(): - return desktop - elif not wait: - return None + while n_tries < 50: + if desktop.get_children(): + return desktop n_tries = n_tries + 1 logging.info("Waiting for a valid accessibility tree %d" % n_tries) |