chrome/updater/test/service/win/updater_test_service_control.py
def StopService(timeout=30):
  """Stop test service if it is running.

  Returns:
    True if the service is stopped successfully.
  """
  logging.info('Stopping service [%s]...', _UPDATER_TEST_SERVICE_NAME)
  try:
    if not _IsServiceInStatus(win32service.SERVICE_RUNNING):
      return True

    win32serviceutil.StopService(_UPDATER_TEST_SERVICE_NAME)
    if not _WaitServiceStatus(win32service.SERVICE_STOPPED, timeout):
      logging.error('Wait for service stop failed.')
      return False

    logging.info('Service [%s] stopped.', _UPDATER_TEST_SERVICE_NAME)
    return True
  except _ServiceErrors as err:
    logging.error('Failed to stop service.')
    logging.exception(err)
    return False
Stop test service if it is running.

  Returns:
    True if the service is stopped successfully.
  
Stop test service if it is running.
Stop test service if it is running .
def StopService(timeout=30):
  logging.info('Stopping service [%s]...', _UPDATER_TEST_SERVICE_NAME)
  try:
    if not _IsServiceInStatus(win32service.SERVICE_RUNNING):
      return True
    win32serviceutil.StopService(_UPDATER_TEST_SERVICE_NAME)
    if not _WaitServiceStatus(win32service.SERVICE_STOPPED, timeout):
      logging.error('Wait for service stop failed.')
      return False
    logging.info('Service [%s] stopped.', _UPDATER_TEST_SERVICE_NAME)
    return True
  except _ServiceErrors as err:
    logging.error('Failed to stop service.')
    logging.exception(err)
    return False
def StopService ( timeout = 30 ) : logging . info ( 'Stopping service [%s]...' , _UPDATER_TEST_SERVICE_NAME ) try : if not _IsServiceInStatus ( win32service . SERVICE_RUNNING ) : return True win32serviceutil . StopService ( _UPDATER_TEST_SERVICE_NAME ) if not _WaitServiceStatus ( win32service . SERVICE_STOPPED , timeout ) : logging . error ( 'Wait for service stop failed.' ) return False logging . info ( 'Service [%s] stopped.' , _UPDATER_TEST_SERVICE_NAME ) return True except _ServiceErrors as err : logging . error ( 'Failed to stop service.' ) logging . exception ( err ) return False
Stop test service if it is running.
Stop test service if it is running .
"""Stop test service if it is running.

  Returns:
    True if the service is stopped successfully.
  """
True if the service is stopped successfully.
True if the service is stopped successfully .
timeout