+def QuitChrome(chrome_path):
+ """ Tries to quit chrome in a safe way. If there is still an open instance
+ after a timeout delay, the process is killed the hard way.
+
+ Args:
+ chrome_path: The path to chrome.exe.
+ """
+ if not CloseWindows(chrome_path):
+ # TODO(robertshield): Investigate why Chrome occasionally doesn't shut down.
+ sys.stderr.write('Warning: Chrome not responding to window closure. '
+ 'Killing all processes belonging to %s\n' % chrome_path)
+ KillNamedProcess(chrome_path)
+
+