tools/accessibility/nvda/nvda_chrome_tests.py
def _TestForSpeech(self, expected):
    """Block until the last speech in NVDA's log file is the given string(s).

    Repeatedly parses the log file until the last speech line(s) in the
    log file match the given strings, or it times out.

    Args:
      expected: string or a list of string - only succeeds if these are the last
        strings spoken, in order.
    """
    if type(expected) is type(''):
      expected = [expected]
    start_time = time.time()
    while True:
      lines = self._GetSpeechFromNvdaLogFile()

      if self._ArrayInArray(lines, expected):
        return True

      if time.time() - start_time >= WAIT_FOR_SPEECH_TIMEOUT_SECS:
        self.fail("Test for expected speech failed.\n\nExpected:\n" +
          str(expected) +
          ".\n\nActual:\n" + str(lines));
        return False
      time.sleep(0.1)
Block until the last speech in NVDA's log file is the given string(s).

    Repeatedly parses the log file until the last speech line(s) in the
    log file match the given strings, or it times out.

    Args:
      expected: string or a list of string - only succeeds if these are the last
        strings spoken, in order.
    
Block until the last speech in NVDA's log file is the given string(s).
Repeatedly parses the log file until the last speech line(s) in the
log file match the given strings, or it times out.
Block until the last speech in NVDA ' s log file is the given string ( s ) . Repeatedly parses the log file until the last speech line ( s ) in the log file match the given strings or it times out .
def _TestForSpeech(self, expected):
    if type(expected) is type(''):
      expected = [expected]
    start_time = time.time()
    while True:
      lines = self._GetSpeechFromNvdaLogFile()
      if self._ArrayInArray(lines, expected):
        return True
      if time.time() - start_time >= WAIT_FOR_SPEECH_TIMEOUT_SECS:
        self.fail("Test for expected speech failed.\n\nExpected:\n" +
          str(expected) +
          ".\n\nActual:\n" + str(lines));
        return False
      time.sleep(0.1)
def _TestForSpeech ( self , expected ) : if type ( expected ) is type ( '' ) : expected = [ expected ] start_time = time . time ( ) while True : lines = self . _GetSpeechFromNvdaLogFile ( ) if self . _ArrayInArray ( lines , expected ) : return True if time . time ( ) - start_time >= WAIT_FOR_SPEECH_TIMEOUT_SECS : self . fail ( "Test for expected speech failed.\n\nExpected:\n" + str ( expected ) + ".\n\nActual:\n" + str ( lines ) ) ; return False time . sleep ( 0.1 )
Block until the last speech in NVDA's log file is the given string(s).
Block until the last speech in NVDA ' s log file is the given string ( s ) .
"""Block until the last speech in NVDA's log file is the given string(s).

    Repeatedly parses the log file until the last speech line(s) in the
    log file match the given strings, or it times out.

    Args:
      expected: string or a list of string - only succeeds if these are the last
        strings spoken, in order.
    """
self
expected
string or a list of string - only succeeds if these are the last
strings spoken, in order.
string or a list of string - only succeeds if these are the last strings spoken in order .