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

Unified Diff: client/bin/site_login.py

Issue 1631027: Update and stabilize login_ChromeProfileSanitary (Closed)
Patch Set: 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 | « no previous file | client/site_tests/login_ChromeProfileSanitary/login_ChromeProfileSanitary.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/bin/site_login.py
diff --git a/client/bin/site_login.py b/client/bin/site_login.py
index 15fa7862e7048139cb8748f10c9f31d55dae60ca..e6552c92382cafc8a4682af274d2fe31576b8cad 100644
--- a/client/bin/site_login.py
+++ b/client/bin/site_login.py
@@ -225,8 +225,23 @@ def nuke_login_manager():
def nuke_process_by_name(name, with_prejudice=False):
- pid = int(utils.system_output('pgrep -o ^%s$' % name))
+ pid = int(utils.system_output('pgrep -o ^%s$' % name).split()[0])
if with_prejudice:
utils.nuke_pid(pid, [signal.SIGKILL])
else:
utils.nuke_pid(pid)
+
+
+def refresh_window_manager(timeout=20):
+ """Clear state that tracks what WM has done, kill it, and wait until
+ the window manager is running.
+
+ Args:
+ timeout: float number of seconds to wait
+
+ Raises:
+ TimeoutError: window manager didn't start before timeout
+ """
+ os.unlink(chromeos_constants.CHROME_WINDOW_MAPPED_MAGIC_FILE)
+ utils.system('initctl restart windowmanager')
+ wait_for_window_manager()
« no previous file with comments | « no previous file | client/site_tests/login_ChromeProfileSanitary/login_ChromeProfileSanitary.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698