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

Unified Diff: client/common_lib/site_ui.py

Issue 1534001: switch to autox.py and robustify login/logout code (Closed)
Patch Set: merge with head Created 10 years, 8 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
« no previous file with comments | « client/bin/site_utils.py ('k') | client/deps/autox/README » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « client/bin/site_utils.py ('k') | client/deps/autox/README » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698