function painterTestHexEncodedBytes() {
  var testCase = {};
  testCase.tickOffset = '1337911098473';

  testCase.logEntries = [
    {
      'params': {
        'source_dependency':
            {'id': 634, 'type': EventSourceType.TRANSPORT_CONNECT_JOB}
      },
      'phase': EventPhase.PHASE_BEGIN,
      'source': {'id': 637, 'type': EventSourceType.SOCKET},
      'time': '953918459',
      'type': EventType.SOCKET_ALIVE
    },
    {
      'params': {'address_list': ['184.30.253.15:80']},
      'phase': EventPhase.PHASE_BEGIN,
      'source': {'id': 637, 'type': EventSourceType.SOCKET},
      'time': '953918460',
      'type': EventType.TCP_CONNECT
    },
    {
      'params': {'address': '184.30.253.15:80'},
      'phase': EventPhase.PHASE_BEGIN,
      'source': {'id': 637, 'type': EventSourceType.SOCKET},
      'time': '953918461',
      'type': EventType.TCP_CONNECT_ATTEMPT
    },
    {
      'phase': EventPhase.PHASE_END,
      'source': {'id': 637, 'type': EventSourceType.SOCKET},
      'time': '953918464',
      'type': EventType.TCP_CONNECT_ATTEMPT
    },
    {
      'params': {'source_address': '127.0.0.1:54041'},
      'phase': EventPhase.PHASE_END,
      'source': {'id': 637, 'type': EventSourceType.SOCKET},
      'time': '953918465',
      'type': EventType.TCP_CONNECT
    },
    {
      'params': {
        'source_dependency':
            {'id': 628, 'type': EventSourceType.HTTP_STREAM_JOB}
      },
      'phase': EventPhase.PHASE_BEGIN,
      'source': {'id': 637, 'type': EventSourceType.SOCKET},
      'time': '953918472',
      'type': EventType.SOCKET_IN_USE
    },
    {
      'params': {
        'byte_count': 780,
        'hex_encoded_bytes': '474554202F66617669636F6E2E69636F20485454502' +
            'F312E310D0A486F73743A207777772E6170706C652E' +
            '636F6D0D0A436F6E6E656374696F6E3A20'
      },
      'phase': EventPhase.PHASE_NONE,
      'source': {'id': 637, 'type': EventSourceType.SOCKET},
      'time': '953918484',
      'type': EventType.SOCKET_BYTES_SENT
    },
    {
      'params': {
        'byte_count': 1024,
        'hex_encoded_bytes': '485454502F312E3120323030204F4B0D0A4C6173742' +
            'D4D6F6469666965643A204D6F6E2C20313920446563' +
            '20323031312032323A34363A353920474D'
      },
      'phase': EventPhase.PHASE_NONE,
      'source': {'id': 637, 'type': EventSourceType.SOCKET},
      'time': '953918596',
      'type': EventType.SOCKET_BYTES_RECEIVED
    }
  ];

  testCase.expectedText = 't=1338865016932 [st=  0] +SOCKET_ALIVE  [dt=?]\n' +
      '                          --> source_dependency = 634 (TRANSPORT_CONNECT_JOB' +
      ')\n' +
      't=1338865016933 [st=  1]   +TCP_CONNECT  [dt=5]\n' +
      '                            --> address_list = ["184.30.253.15:80"]\n' +
      't=1338865016934 [st=  2]      TCP_CONNECT_ATTEMPT  [dt=3]\n' +
      '                              --> address = "184.30.253.15:80"\n' +
      't=1338865016938 [st=  6]   -TCP_CONNECT\n' +
      '                            --> source_address = "127.0.0.1:54041"\n' +
      't=1338865016945 [st= 13]   +SOCKET_IN_USE  [dt=?]\n' +
      '                            --> source_dependency = 628 (HTTP_STREAM_JOB)\n' +
      't=1338865016957 [st= 25]      SOCKET_BYTES_SENT\n' +
      '                              --> byte_count = 780\n' +
      '                              --> hex_encoded_bytes =\n' +
      '                                47 45 54 20 2F 66 61 76  69 63 6F 6E 2E 69 ' +
      '63 6F   GET /favicon.ico\n' +
      '                                20 48 54 54 50 2F 31 2E  31 0D 0A 48 6F 73 ' +
      '74 3A    HTTP/1.1..Host:\n' +
      '                                20 77 77 77 2E 61 70 70  6C 65 2E 63 6F 6D ' +
      '0D 0A    www.apple.com..\n' +
      '                                43 6F 6E 6E 65 63 74 69  6F 6E 3A 20       ' +
      '        Connection: \n' +
      't=1338865017069 [st=137]      SOCKET_BYTES_RECEIVED\n' +
      '                              --> byte_count = 1024\n' +
      '                              --> hex_encoded_bytes =\n' +
      '                                48 54 54 50 2F 31 2E 31  20 32 30 30 20 4F ' +
      '4B 0D   HTTP/1.1 200 OK.\n' +
      '                                0A 4C 61 73 74 2D 4D 6F  64 69 66 69 65 64 ' +
      '3A 20   .Last-Modified: \n' +
      '                                4D 6F 6E 2C 20 31 39 20  44 65 63 20 32 30 ' +
      '31 31   Mon, 19 Dec 2011\n' +
      '                                20 32 32 3A 34 36 3A 35  39 20 47 4D       ' +
      '         22:46:59 GM';

  return testCase;
}
/**
 * Tests the formatting of bytes sent/received as hex + ASCII. Note that the
 * test data was truncated which is why the byte_count doesn't quite match the
 * hex_encoded_bytes.
 */
Tests the formatting of bytes sent/received as hex + ASCII. Note that the
test data was truncated which is why the byte_count doesn't quite match the
hex_encoded_bytes.
Tests the formatting of bytes sent / received as hex + ASCII . Note that the test data was truncated which is why the byte_count doesn ' t quite match the hex_encoded_bytes .
function painterTestHexEncodedBytes() {
  var testCase = {};
  testCase.tickOffset = '1337911098473';
  testCase.logEntries = [
    {
      'params': {
        'source_dependency':
            {'id': 634, 'type': EventSourceType.TRANSPORT_CONNECT_JOB}
      },
      'phase': EventPhase.PHASE_BEGIN,
      'source': {'id': 637, 'type': EventSourceType.SOCKET},
      'time': '953918459',
      'type': EventType.SOCKET_ALIVE
    },
    {
      'params': {'address_list': ['184.30.253.15:80']},
      'phase': EventPhase.PHASE_BEGIN,
      'source': {'id': 637, 'type': EventSourceType.SOCKET},
      'time': '953918460',
      'type': EventType.TCP_CONNECT
    },
    {
      'params': {'address': '184.30.253.15:80'},
      'phase': EventPhase.PHASE_BEGIN,
      'source': {'id': 637, 'type': EventSourceType.SOCKET},
      'time': '953918461',
      'type': EventType.TCP_CONNECT_ATTEMPT
    },
    {
      'phase': EventPhase.PHASE_END,
      'source': {'id': 637, 'type': EventSourceType.SOCKET},
      'time': '953918464',
      'type': EventType.TCP_CONNECT_ATTEMPT
    },
    {
      'params': {'source_address': '127.0.0.1:54041'},
      'phase': EventPhase.PHASE_END,
      'source': {'id': 637, 'type': EventSourceType.SOCKET},
      'time': '953918465',
      'type': EventType.TCP_CONNECT
    },
    {
      'params': {
        'source_dependency':
            {'id': 628, 'type': EventSourceType.HTTP_STREAM_JOB}
      },
      'phase': EventPhase.PHASE_BEGIN,
      'source': {'id': 637, 'type': EventSourceType.SOCKET},
      'time': '953918472',
      'type': EventType.SOCKET_IN_USE
    },
    {
      'params': {
        'byte_count': 780,
        'hex_encoded_bytes': '474554202F66617669636F6E2E69636F20485454502' +
            'F312E310D0A486F73743A207777772E6170706C652E' +
            '636F6D0D0A436F6E6E656374696F6E3A20'
      },
      'phase': EventPhase.PHASE_NONE,
      'source': {'id': 637, 'type': EventSourceType.SOCKET},
      'time': '953918484',
      'type': EventType.SOCKET_BYTES_SENT
    },
    {
      'params': {
        'byte_count': 1024,
        'hex_encoded_bytes': '485454502F312E3120323030204F4B0D0A4C6173742' +
            'D4D6F6469666965643A204D6F6E2C20313920446563' +
            '20323031312032323A34363A353920474D'
      },
      'phase': EventPhase.PHASE_NONE,
      'source': {'id': 637, 'type': EventSourceType.SOCKET},
      'time': '953918596',
      'type': EventType.SOCKET_BYTES_RECEIVED
    }
  ];
  testCase.expectedText = 't=1338865016932 [st=  0] +SOCKET_ALIVE  [dt=?]\n' +
      '                          --> source_dependency = 634 (TRANSPORT_CONNECT_JOB' +
      ')\n' +
      't=1338865016933 [st=  1]   +TCP_CONNECT  [dt=5]\n' +
      '                            --> address_list = ["184.30.253.15:80"]\n' +
      't=1338865016934 [st=  2]      TCP_CONNECT_ATTEMPT  [dt=3]\n' +
      '                              --> address = "184.30.253.15:80"\n' +
      't=1338865016938 [st=  6]   -TCP_CONNECT\n' +
      '                            --> source_address = "127.0.0.1:54041"\n' +
      't=1338865016945 [st= 13]   +SOCKET_IN_USE  [dt=?]\n' +
      '                            --> source_dependency = 628 (HTTP_STREAM_JOB)\n' +
      't=1338865016957 [st= 25]      SOCKET_BYTES_SENT\n' +
      '                              --> byte_count = 780\n' +
      '                              --> hex_encoded_bytes =\n' +
      '                                47 45 54 20 2F 66 61 76  69 63 6F 6E 2E 69 ' +
      '63 6F   GET /favicon.ico\n' +
      '                                20 48 54 54 50 2F 31 2E  31 0D 0A 48 6F 73 ' +
      '74 3A    HTTP/1.1..Host:\n' +
      '                                20 77 77 77 2E 61 70 70  6C 65 2E 63 6F 6D ' +
      '0D 0A    www.apple.com..\n' +
      '                                43 6F 6E 6E 65 63 74 69  6F 6E 3A 20       ' +
      '        Connection: \n' +
      't=1338865017069 [st=137]      SOCKET_BYTES_RECEIVED\n' +
      '                              --> byte_count = 1024\n' +
      '                              --> hex_encoded_bytes =\n' +
      '                                48 54 54 50 2F 31 2E 31  20 32 30 30 20 4F ' +
      '4B 0D   HTTP/1.1 200 OK.\n' +
      '                                0A 4C 61 73 74 2D 4D 6F  64 69 66 69 65 64 ' +
      '3A 20   .Last-Modified: \n' +
      '                                4D 6F 6E 2C 20 31 39 20  44 65 63 20 32 30 ' +
      '31 31   Mon, 19 Dec 2011\n' +
      '                                20 32 32 3A 34 36 3A 35  39 20 47 4D       ' +
      '         22:46:59 GM';
  return testCase;
}
function painterTestHexEncodedBytes ( ) { var testCase = { } ; testCase . tickOffset = '1337911098473' ; testCase . logEntries = [ { 'params' : { 'source_dependency' : { 'id' : 634 , 'type' : EventSourceType . TRANSPORT_CONNECT_JOB } } , 'phase' : EventPhase . PHASE_BEGIN , 'source' : { 'id' : 637 , 'type' : EventSourceType . SOCKET } , 'time' : '953918459' , 'type' : EventType . SOCKET_ALIVE } , { 'params' : { 'address_list' : [ '184.30.253.15:80' ] } , 'phase' : EventPhase . PHASE_BEGIN , 'source' : { 'id' : 637 , 'type' : EventSourceType . SOCKET } , 'time' : '953918460' , 'type' : EventType . TCP_CONNECT } , { 'params' : { 'address' : '184.30.253.15:80' } , 'phase' : EventPhase . PHASE_BEGIN , 'source' : { 'id' : 637 , 'type' : EventSourceType . SOCKET } , 'time' : '953918461' , 'type' : EventType . TCP_CONNECT_ATTEMPT } , { 'phase' : EventPhase . PHASE_END , 'source' : { 'id' : 637 , 'type' : EventSourceType . SOCKET } , 'time' : '953918464' , 'type' : EventType . TCP_CONNECT_ATTEMPT } , { 'params' : { 'source_address' : '127.0.0.1:54041' } , 'phase' : EventPhase . PHASE_END , 'source' : { 'id' : 637 , 'type' : EventSourceType . SOCKET } , 'time' : '953918465' , 'type' : EventType . TCP_CONNECT } , { 'params' : { 'source_dependency' : { 'id' : 628 , 'type' : EventSourceType . HTTP_STREAM_JOB } } , 'phase' : EventPhase . PHASE_BEGIN , 'source' : { 'id' : 637 , 'type' : EventSourceType . SOCKET } , 'time' : '953918472' , 'type' : EventType . SOCKET_IN_USE } , { 'params' : { 'byte_count' : 780 , 'hex_encoded_bytes' : '474554202F66617669636F6E2E69636F20485454502' + 'F312E310D0A486F73743A207777772E6170706C652E' + '636F6D0D0A436F6E6E656374696F6E3A20' } , 'phase' : EventPhase . PHASE_NONE , 'source' : { 'id' : 637 , 'type' : EventSourceType . SOCKET } , 'time' : '953918484' , 'type' : EventType . SOCKET_BYTES_SENT } , { 'params' : { 'byte_count' : 1024 , 'hex_encoded_bytes' : '485454502F312E3120323030204F4B0D0A4C6173742' + 'D4D6F6469666965643A204D6F6E2C20313920446563' + '20323031312032323A34363A353920474D' } , 'phase' : EventPhase . PHASE_NONE , 'source' : { 'id' : 637 , 'type' : EventSourceType . SOCKET } , 'time' : '953918596' , 'type' : EventType . SOCKET_BYTES_RECEIVED } ] ; testCase . expectedText = 't=1338865016932 [st=  0] +SOCKET_ALIVE  [dt=?]\n' + '                          --> source_dependency = 634 (TRANSPORT_CONNECT_JOB' + ')\n' + 't=1338865016933 [st=  1]   +TCP_CONNECT  [dt=5]\n' + '                            --> address_list = ["184.30.253.15:80"]\n' + 't=1338865016934 [st=  2]      TCP_CONNECT_ATTEMPT  [dt=3]\n' + '                              --> address = "184.30.253.15:80"\n' + 't=1338865016938 [st=  6]   -TCP_CONNECT\n' + '                            --> source_address = "127.0.0.1:54041"\n' + 't=1338865016945 [st= 13]   +SOCKET_IN_USE  [dt=?]\n' + '                            --> source_dependency = 628 (HTTP_STREAM_JOB)\n' + 't=1338865016957 [st= 25]      SOCKET_BYTES_SENT\n' + '                              --> byte_count = 780\n' + '                              --> hex_encoded_bytes =\n' + '                                47 45 54 20 2F 66 61 76  69 63 6F 6E 2E 69 ' + '63 6F   GET /favicon.ico\n' + '                                20 48 54 54 50 2F 31 2E  31 0D 0A 48 6F 73 ' + '74 3A    HTTP/1.1..Host:\n' + '                                20 77 77 77 2E 61 70 70  6C 65 2E 63 6F 6D ' + '0D 0A    www.apple.com..\n' + '                                43 6F 6E 6E 65 63 74 69  6F 6E 3A 20       ' + '        Connection: \n' + 't=1338865017069 [st=137]      SOCKET_BYTES_RECEIVED\n' + '                              --> byte_count = 1024\n' + '                              --> hex_encoded_bytes =\n' + '                                48 54 54 50 2F 31 2E 31  20 32 30 30 20 4F ' + '4B 0D   HTTP/1.1 200 OK.\n' + '                                0A 4C 61 73 74 2D 4D 6F  64 69 66 69 65 64 ' + '3A 20   .Last-Modified: \n' + '                                4D 6F 6E 2C 20 31 39 20  44 65 63 20 32 30 ' + '31 31   Mon, 19 Dec 2011\n' + '                                20 32 32 3A 34 36 3A 35  39 20 47 4D       ' + '         22:46:59 GM' ; return testCase ; }
Tests the formatting of bytes sent/received as hex + ASCII.
Tests the formatting of bytes sent / received as hex + ASCII .