Index: client/common_lib/site_ui.py |
diff --git a/client/common_lib/site_ui.py b/client/common_lib/site_ui.py |
index ffc515e5ec977032d28e89d424c04aa61749cb24..bdd0b3531293d8d59e055c68390f376cd4cb8f07 100644 |
--- a/client/common_lib/site_ui.py |
+++ b/client/common_lib/site_ui.py |
@@ -2,7 +2,7 @@ |
# Use of this source code is governed by a BSD-style license that can be |
# found in the LICENSE file. |
-import logging, shutil |
+import logging, os, shutil |
from autotest_lib.client.common_lib import site_httpd, utils |
@@ -44,6 +44,16 @@ def xsystem_as(cmd, user='chronos', timeout=None, ignore_status=False): |
ignore_status=ignore_status) |
+def get_autox(): |
+ """Return a new autox instance.""" |
+ # we're running as root, but need to connect to chronos' X session |
+ os.environ.setdefault('XAUTHORITY', '/home/chronos/.Xauthority') |
+ os.environ.setdefault('DISPLAY', ':0.0') |
+ |
+ import autox |
+ return autox.AutoX() |
+ |
+ |
class ChromeSession(object): |
""" |
A class to start and close Chrome sessions. |