chrome/test/chromedriver/log_replay/client_replay_test.py
def CheckResponsesMatch(self, real, logged):
    """Asserts that the given pair of responses match.

    These are usually the replay response and the logged response.
    Checks that they match, up to differences in session, window, element
    IDs, timestamps, etc.

    Args:
      real: actual response from running the command
      logged: logged response, taken from the log file
    """
    if not real and not logged:
      return

    if isinstance(real, dict) and "message" in real:
      real = "ERROR " + real["message"].split("\n")[0]

    # pylint: disable=unidiomatic-typecheck
    self.assertTrue(type(logged) == type(real)
                    or (isinstance(real, basestring)
                        and isinstance(logged, basestring)))
    # pylint: enable=unidiomatic-typecheck

    if isinstance(real, basestring) \
        and (real[:14] == "<!DOCTYPE html" or real[:5] == "<html"):
      real = "".join(real.split())
      logged = "".join(logged.split())

    if not isinstance(real, basestring):
      real = json.dumps(real)
      logged = json.dumps(logged)

    real = ClearPort(real)
    logged = ClearPort(logged)
    real = SubstituteVariableEntries(real)
    logged = SubstituteVariableEntries(logged)

    self.assertEqual(real, logged)
Asserts that the given pair of responses match.

    These are usually the replay response and the logged response.
    Checks that they match, up to differences in session, window, element
    IDs, timestamps, etc.

    Args:
      real: actual response from running the command
      logged: logged response, taken from the log file
    
Asserts that the given pair of responses match.
These are usually the replay response and the logged response.
Checks that they match, up to differences in session, window, element
IDs, timestamps, etc.
Asserts that the given pair of responses match . These are usually the replay response and the logged response . Checks that they match up to differences in session window element IDs timestamps etc .
def CheckResponsesMatch(self, real, logged):
    if not real and not logged:
      return
    if isinstance(real, dict) and "message" in real:
      real = "ERROR " + real["message"].split("\n")[0]
    self.assertTrue(type(logged) == type(real)
                    or (isinstance(real, basestring)
                        and isinstance(logged, basestring)))
    if isinstance(real, basestring) \
        and (real[:14] == "<!DOCTYPE html" or real[:5] == "<html"):
      real = "".join(real.split())
      logged = "".join(logged.split())
    if not isinstance(real, basestring):
      real = json.dumps(real)
      logged = json.dumps(logged)
    real = ClearPort(real)
    logged = ClearPort(logged)
    real = SubstituteVariableEntries(real)
    logged = SubstituteVariableEntries(logged)
    self.assertEqual(real, logged)
def CheckResponsesMatch ( self , real , logged ) : if not real and not logged : return if isinstance ( real , dict ) and "message" in real : real = "ERROR " + real [ "message" ] . split ( "\n" ) [ 0 ] self . assertTrue ( type ( logged ) == type ( real ) or ( isinstance ( real , basestring ) and isinstance ( logged , basestring ) ) ) if isinstance ( real , basestring ) and ( real [ : 14 ] == "<!DOCTYPE html" or real [ : 5 ] == "<html" ) : real = "" . join ( real . split ( ) ) logged = "" . join ( logged . split ( ) ) if not isinstance ( real , basestring ) : real = json . dumps ( real ) logged = json . dumps ( logged ) real = ClearPort ( real ) logged = ClearPort ( logged ) real = SubstituteVariableEntries ( real ) logged = SubstituteVariableEntries ( logged ) self . assertEqual ( real , logged )
Asserts that the given pair of responses match.
Asserts that the given pair of responses match .
"""Asserts that the given pair of responses match.

    These are usually the replay response and the logged response.
    Checks that they match, up to differences in session, window, element
    IDs, timestamps, etc.

    Args:
      real: actual response from running the command
      logged: logged response, taken from the log file
    """ # pylint: disable=unidiomatic-typecheck # pylint: enable=unidiomatic-typecheck
self
real
actual response from running the command
actual response from running the command
logged
logged response, taken from the log file
logged response taken from the log file