chrome/test/mini_installer/quit_chrome.py
def CloseWindows(process_path):
    """Closes all windows owned by processes whose exe path is |process_path|.

    Args:
        process_path: The path to the executable whose processes will have their
            windows closed.

    Returns:
        A boolean indicating whether the processes successfully terminated
        within 25 seconds.
    """
    start_time = time.time()
    while time.time() - start_time < 25:
        process_ids = chrome_helper.GetProcessIDs(process_path)
        if not process_ids:
            return True

        for hwnd in chrome_helper.GetWindowHandles(process_ids):
            try:
                win32gui.PostMessage(hwnd, win32con.WM_CLOSE, 0, 0)
            except pywintypes.error as error:
                # It's normal that some window handles have become invalid.
                if error.args[0] != winerror.ERROR_INVALID_WINDOW_HANDLE:
                    raise
        time.sleep(0.1)
    return False
Closes all windows owned by processes whose exe path is |process_path|.

    Args:
        process_path: The path to the executable whose processes will have their
            windows closed.

    Returns:
        A boolean indicating whether the processes successfully terminated
        within 25 seconds.
    
Closes all windows owned by processes whose exe path is |process_path|.
Closes all windows owned by processes whose exe path is |process_path| .
def CloseWindows(process_path):
    start_time = time.time()
    while time.time() - start_time < 25:
        process_ids = chrome_helper.GetProcessIDs(process_path)
        if not process_ids:
            return True
        for hwnd in chrome_helper.GetWindowHandles(process_ids):
            try:
                win32gui.PostMessage(hwnd, win32con.WM_CLOSE, 0, 0)
            except pywintypes.error as error:
                if error.args[0] != winerror.ERROR_INVALID_WINDOW_HANDLE:
                    raise
        time.sleep(0.1)
    return False
def CloseWindows ( process_path ) : start_time = time . time ( ) while time . time ( ) - start_time < 25 : process_ids = chrome_helper . GetProcessIDs ( process_path ) if not process_ids : return True for hwnd in chrome_helper . GetWindowHandles ( process_ids ) : try : win32gui . PostMessage ( hwnd , win32con . WM_CLOSE , 0 , 0 ) except pywintypes . error as error : if error . args [ 0 ] != winerror . ERROR_INVALID_WINDOW_HANDLE : raise time . sleep ( 0.1 ) return False
Closes all windows owned by processes whose exe path is |process_path|.
Closes all windows owned by processes whose exe path is |process_path| .
"""Closes all windows owned by processes whose exe path is |process_path|.

    Args:
        process_path: The path to the executable whose processes will have their
            windows closed.

    Returns:
        A boolean indicating whether the processes successfully terminated
        within 25 seconds.
    """ # It's normal that some window handles have become invalid.
A boolean indicating whether the processes successfully terminated
within 25 seconds.
A boolean indicating whether the processes successfully terminated within 25 seconds .
process_path
The path to the executable whose processes will have their
windows closed.
The path to the executable whose processes will have their windows closed .