function painterTestNetError() {
  var testCase = {};
  testCase.tickOffset = '1337911098446';
  testCase.loadFlags =
      LoadFlag.MAIN_FRAME_DEPRECATED | LoadFlag.MAYBE_USER_GESTURE;

  testCase.logEntries = [
    {
      'phase': EventPhase.PHASE_BEGIN,
      'source': {'id': 318, 'type': EventSourceType.URL_REQUEST},
      'time': '953675448',
      'type': EventType.REQUEST_ALIVE
    },
    {
      'params': {
        'load_flags': testCase.loadFlags,
        'method': 'GET',
        'priority': 4,
        'url': 'http://www.doesnotexistdomain.com/'
      },
      'phase': EventPhase.PHASE_BEGIN,
      'source': {'id': 318, 'type': EventSourceType.URL_REQUEST},
      'time': '953675455',
      'type': EventType.URL_REQUEST_START_JOB
    },
    {
      'phase': EventPhase.PHASE_END,
      'source': {'id': 318, 'type': EventSourceType.URL_REQUEST},
      'time': '953675460',
      'type': EventType.URL_REQUEST_START_JOB
    },
    {
      'params': {
        'load_flags': testCase.loadFlags,
        'method': 'GET',
        'priority': 4,
        'url': 'http://www.doesnotexistdomain.com/'
      },
      'phase': EventPhase.PHASE_BEGIN,
      'source': {'id': 318, 'type': EventSourceType.URL_REQUEST},
      'time': '953675460',
      'type': EventType.URL_REQUEST_START_JOB
    },
    {
      'phase': EventPhase.PHASE_BEGIN,
      'source': {'id': 318, 'type': EventSourceType.URL_REQUEST},
      'time': '953675469',
      'type': EventType.HTTP_CACHE_GET_BACKEND
    },
    {
      'phase': EventPhase.PHASE_END,
      'source': {'id': 318, 'type': EventSourceType.URL_REQUEST},
      'time': '953675469',
      'type': EventType.HTTP_CACHE_GET_BACKEND
    },
    {
      'phase': EventPhase.PHASE_BEGIN,
      'source': {'id': 318, 'type': EventSourceType.URL_REQUEST},
      'time': '953675469',
      'type': EventType.HTTP_CACHE_OPEN_ENTRY
    },
    {
      'params': {'net_error': -2},
      'phase': EventPhase.PHASE_END,
      'source': {'id': 318, 'type': EventSourceType.URL_REQUEST},
      'time': '953675470',
      'type': EventType.HTTP_CACHE_OPEN_ENTRY
    },
    {
      'phase': EventPhase.PHASE_BEGIN,
      'source': {'id': 318, 'type': EventSourceType.URL_REQUEST},
      'time': '953675471',
      'type': EventType.HTTP_CACHE_CREATE_ENTRY
    },
    {
      'phase': EventPhase.PHASE_END,
      'source': {'id': 318, 'type': EventSourceType.URL_REQUEST},
      'time': '953675473',
      'type': EventType.HTTP_CACHE_CREATE_ENTRY
    },
    {
      'phase': EventPhase.PHASE_BEGIN,
      'source': {'id': 318, 'type': EventSourceType.URL_REQUEST},
      'time': '953675473',
      'type': EventType.HTTP_CACHE_ADD_TO_ENTRY
    },
    {
      'phase': EventPhase.PHASE_END,
      'source': {'id': 318, 'type': EventSourceType.URL_REQUEST},
      'time': '953675474',
      'type': EventType.HTTP_CACHE_ADD_TO_ENTRY
    },
    {
      'phase': EventPhase.PHASE_BEGIN,
      'source': {'id': 318, 'type': EventSourceType.URL_REQUEST},
      'time': '953675474',
      'type': EventType.HTTP_STREAM_REQUEST
    },
    {
      'phase': EventPhase.PHASE_END,
      'source': {'id': 318, 'type': EventSourceType.URL_REQUEST},
      'time': '953675699',
      'type': EventType.HTTP_STREAM_REQUEST
    },
    {
      'params': {'net_error': -105},
      'phase': EventPhase.PHASE_END,
      'source': {'id': 318, 'type': EventSourceType.URL_REQUEST},
      'time': '953675705',
      'type': EventType.URL_REQUEST_START_JOB
    },
    {
      'params': {'net_error': -105},
      'phase': EventPhase.PHASE_END,
      'source': {'id': 318, 'type': EventSourceType.URL_REQUEST},
      'time': '953675923',
      'type': EventType.REQUEST_ALIVE
    }
  ];

  testCase.expectedText =
      't=1338864773894 [st=  0] +REQUEST_ALIVE  [dt=475]\n' +
      't=1338864773901 [st=  7]    URL_REQUEST_START_JOB  [dt=5]\n' +
      '                            --> load_flags = ' +
      testCase.loadFlags.toString() +
      ' (MAIN_FRAME_DEPRECATED | MAYBE_USER_GESTURE)\n' +
      '                            --> method = "GET"\n' +
      '                            --> priority = 4\n' +
      '                            --> url = "http://www.doesnotexistdomain.com/"\n' +
      't=1338864773906 [st= 12]   +URL_REQUEST_START_JOB  [dt=245]\n' +
      '                            --> load_flags = ' +
      testCase.loadFlags.toString() +
      ' (MAIN_FRAME_DEPRECATED | MAYBE_USER_GESTURE)\n' +
      '                            --> method = "GET"\n' +
      '                            --> priority = 4\n' +
      '                            --> url = "http://www.doesnotexistdomain.com/"\n' +
      't=1338864773915 [st= 21]      HTTP_CACHE_GET_BACKEND  [dt=0]\n' +
      't=1338864773915 [st= 21]      HTTP_CACHE_OPEN_ENTRY  [dt=1]\n' +
      '                              --> net_error = -2 (ERR_FAILED)\n' +
      't=1338864773917 [st= 23]      HTTP_CACHE_CREATE_ENTRY  [dt=2]\n' +
      't=1338864773919 [st= 25]      HTTP_CACHE_ADD_TO_ENTRY  [dt=1]\n' +
      't=1338864773920 [st= 26]      HTTP_STREAM_REQUEST  [dt=225]\n' +
      't=1338864774151 [st=257]   -URL_REQUEST_START_JOB\n' +
      '                            --> net_error = -105 (ERR_NAME_NOT_RESOLVED)\n' +
      't=1338864774369 [st=475] -REQUEST_ALIVE\n' +
      '                          --> net_error = -105 (ERR_NAME_NOT_RESOLVED)';

  return testCase;
}
/**
 * Tests the custom formatting of net_errors across several different event
 * types.
 */
Tests the custom formatting of net_errors across several different event
types.
Tests the custom formatting of net_errors across several different event types .
function painterTestNetError() {
  var testCase = {};
  testCase.tickOffset = '1337911098446';
  testCase.loadFlags =
      LoadFlag.MAIN_FRAME_DEPRECATED | LoadFlag.MAYBE_USER_GESTURE;
  testCase.logEntries = [
    {
      'phase': EventPhase.PHASE_BEGIN,
      'source': {'id': 318, 'type': EventSourceType.URL_REQUEST},
      'time': '953675448',
      'type': EventType.REQUEST_ALIVE
    },
    {
      'params': {
        'load_flags': testCase.loadFlags,
        'method': 'GET',
        'priority': 4,
        'url': 'http://www.doesnotexistdomain.com/'
      },
      'phase': EventPhase.PHASE_BEGIN,
      'source': {'id': 318, 'type': EventSourceType.URL_REQUEST},
      'time': '953675455',
      'type': EventType.URL_REQUEST_START_JOB
    },
    {
      'phase': EventPhase.PHASE_END,
      'source': {'id': 318, 'type': EventSourceType.URL_REQUEST},
      'time': '953675460',
      'type': EventType.URL_REQUEST_START_JOB
    },
    {
      'params': {
        'load_flags': testCase.loadFlags,
        'method': 'GET',
        'priority': 4,
        'url': 'http://www.doesnotexistdomain.com/'
      },
      'phase': EventPhase.PHASE_BEGIN,
      'source': {'id': 318, 'type': EventSourceType.URL_REQUEST},
      'time': '953675460',
      'type': EventType.URL_REQUEST_START_JOB
    },
    {
      'phase': EventPhase.PHASE_BEGIN,
      'source': {'id': 318, 'type': EventSourceType.URL_REQUEST},
      'time': '953675469',
      'type': EventType.HTTP_CACHE_GET_BACKEND
    },
    {
      'phase': EventPhase.PHASE_END,
      'source': {'id': 318, 'type': EventSourceType.URL_REQUEST},
      'time': '953675469',
      'type': EventType.HTTP_CACHE_GET_BACKEND
    },
    {
      'phase': EventPhase.PHASE_BEGIN,
      'source': {'id': 318, 'type': EventSourceType.URL_REQUEST},
      'time': '953675469',
      'type': EventType.HTTP_CACHE_OPEN_ENTRY
    },
    {
      'params': {'net_error': -2},
      'phase': EventPhase.PHASE_END,
      'source': {'id': 318, 'type': EventSourceType.URL_REQUEST},
      'time': '953675470',
      'type': EventType.HTTP_CACHE_OPEN_ENTRY
    },
    {
      'phase': EventPhase.PHASE_BEGIN,
      'source': {'id': 318, 'type': EventSourceType.URL_REQUEST},
      'time': '953675471',
      'type': EventType.HTTP_CACHE_CREATE_ENTRY
    },
    {
      'phase': EventPhase.PHASE_END,
      'source': {'id': 318, 'type': EventSourceType.URL_REQUEST},
      'time': '953675473',
      'type': EventType.HTTP_CACHE_CREATE_ENTRY
    },
    {
      'phase': EventPhase.PHASE_BEGIN,
      'source': {'id': 318, 'type': EventSourceType.URL_REQUEST},
      'time': '953675473',
      'type': EventType.HTTP_CACHE_ADD_TO_ENTRY
    },
    {
      'phase': EventPhase.PHASE_END,
      'source': {'id': 318, 'type': EventSourceType.URL_REQUEST},
      'time': '953675474',
      'type': EventType.HTTP_CACHE_ADD_TO_ENTRY
    },
    {
      'phase': EventPhase.PHASE_BEGIN,
      'source': {'id': 318, 'type': EventSourceType.URL_REQUEST},
      'time': '953675474',
      'type': EventType.HTTP_STREAM_REQUEST
    },
    {
      'phase': EventPhase.PHASE_END,
      'source': {'id': 318, 'type': EventSourceType.URL_REQUEST},
      'time': '953675699',
      'type': EventType.HTTP_STREAM_REQUEST
    },
    {
      'params': {'net_error': -105},
      'phase': EventPhase.PHASE_END,
      'source': {'id': 318, 'type': EventSourceType.URL_REQUEST},
      'time': '953675705',
      'type': EventType.URL_REQUEST_START_JOB
    },
    {
      'params': {'net_error': -105},
      'phase': EventPhase.PHASE_END,
      'source': {'id': 318, 'type': EventSourceType.URL_REQUEST},
      'time': '953675923',
      'type': EventType.REQUEST_ALIVE
    }
  ];
  testCase.expectedText =
      't=1338864773894 [st=  0] +REQUEST_ALIVE  [dt=475]\n' +
      't=1338864773901 [st=  7]    URL_REQUEST_START_JOB  [dt=5]\n' +
      '                            --> load_flags = ' +
      testCase.loadFlags.toString() +
      ' (MAIN_FRAME_DEPRECATED | MAYBE_USER_GESTURE)\n' +
      '                            --> method = "GET"\n' +
      '                            --> priority = 4\n' +
      '                            --> url = "http://www.doesnotexistdomain.com/"\n' +
      't=1338864773906 [st= 12]   +URL_REQUEST_START_JOB  [dt=245]\n' +
      '                            --> load_flags = ' +
      testCase.loadFlags.toString() +
      ' (MAIN_FRAME_DEPRECATED | MAYBE_USER_GESTURE)\n' +
      '                            --> method = "GET"\n' +
      '                            --> priority = 4\n' +
      '                            --> url = "http://www.doesnotexistdomain.com/"\n' +
      't=1338864773915 [st= 21]      HTTP_CACHE_GET_BACKEND  [dt=0]\n' +
      't=1338864773915 [st= 21]      HTTP_CACHE_OPEN_ENTRY  [dt=1]\n' +
      '                              --> net_error = -2 (ERR_FAILED)\n' +
      't=1338864773917 [st= 23]      HTTP_CACHE_CREATE_ENTRY  [dt=2]\n' +
      't=1338864773919 [st= 25]      HTTP_CACHE_ADD_TO_ENTRY  [dt=1]\n' +
      't=1338864773920 [st= 26]      HTTP_STREAM_REQUEST  [dt=225]\n' +
      't=1338864774151 [st=257]   -URL_REQUEST_START_JOB\n' +
      '                            --> net_error = -105 (ERR_NAME_NOT_RESOLVED)\n' +
      't=1338864774369 [st=475] -REQUEST_ALIVE\n' +
      '                          --> net_error = -105 (ERR_NAME_NOT_RESOLVED)';
  return testCase;
}
function painterTestNetError ( ) { var testCase = { } ; testCase . tickOffset = '1337911098446' ; testCase . loadFlags = LoadFlag . MAIN_FRAME_DEPRECATED | LoadFlag . MAYBE_USER_GESTURE ; testCase . logEntries = [ { 'phase' : EventPhase . PHASE_BEGIN , 'source' : { 'id' : 318 , 'type' : EventSourceType . URL_REQUEST } , 'time' : '953675448' , 'type' : EventType . REQUEST_ALIVE } , { 'params' : { 'load_flags' : testCase . loadFlags , 'method' : 'GET' , 'priority' : 4 , 'url' : 'http://www.doesnotexistdomain.com/' } , 'phase' : EventPhase . PHASE_BEGIN , 'source' : { 'id' : 318 , 'type' : EventSourceType . URL_REQUEST } , 'time' : '953675455' , 'type' : EventType . URL_REQUEST_START_JOB } , { 'phase' : EventPhase . PHASE_END , 'source' : { 'id' : 318 , 'type' : EventSourceType . URL_REQUEST } , 'time' : '953675460' , 'type' : EventType . URL_REQUEST_START_JOB } , { 'params' : { 'load_flags' : testCase . loadFlags , 'method' : 'GET' , 'priority' : 4 , 'url' : 'http://www.doesnotexistdomain.com/' } , 'phase' : EventPhase . PHASE_BEGIN , 'source' : { 'id' : 318 , 'type' : EventSourceType . URL_REQUEST } , 'time' : '953675460' , 'type' : EventType . URL_REQUEST_START_JOB } , { 'phase' : EventPhase . PHASE_BEGIN , 'source' : { 'id' : 318 , 'type' : EventSourceType . URL_REQUEST } , 'time' : '953675469' , 'type' : EventType . HTTP_CACHE_GET_BACKEND } , { 'phase' : EventPhase . PHASE_END , 'source' : { 'id' : 318 , 'type' : EventSourceType . URL_REQUEST } , 'time' : '953675469' , 'type' : EventType . HTTP_CACHE_GET_BACKEND } , { 'phase' : EventPhase . PHASE_BEGIN , 'source' : { 'id' : 318 , 'type' : EventSourceType . URL_REQUEST } , 'time' : '953675469' , 'type' : EventType . HTTP_CACHE_OPEN_ENTRY } , { 'params' : { 'net_error' : - 2 } , 'phase' : EventPhase . PHASE_END , 'source' : { 'id' : 318 , 'type' : EventSourceType . URL_REQUEST } , 'time' : '953675470' , 'type' : EventType . HTTP_CACHE_OPEN_ENTRY } , { 'phase' : EventPhase . PHASE_BEGIN , 'source' : { 'id' : 318 , 'type' : EventSourceType . URL_REQUEST } , 'time' : '953675471' , 'type' : EventType . HTTP_CACHE_CREATE_ENTRY } , { 'phase' : EventPhase . PHASE_END , 'source' : { 'id' : 318 , 'type' : EventSourceType . URL_REQUEST } , 'time' : '953675473' , 'type' : EventType . HTTP_CACHE_CREATE_ENTRY } , { 'phase' : EventPhase . PHASE_BEGIN , 'source' : { 'id' : 318 , 'type' : EventSourceType . URL_REQUEST } , 'time' : '953675473' , 'type' : EventType . HTTP_CACHE_ADD_TO_ENTRY } , { 'phase' : EventPhase . PHASE_END , 'source' : { 'id' : 318 , 'type' : EventSourceType . URL_REQUEST } , 'time' : '953675474' , 'type' : EventType . HTTP_CACHE_ADD_TO_ENTRY } , { 'phase' : EventPhase . PHASE_BEGIN , 'source' : { 'id' : 318 , 'type' : EventSourceType . URL_REQUEST } , 'time' : '953675474' , 'type' : EventType . HTTP_STREAM_REQUEST } , { 'phase' : EventPhase . PHASE_END , 'source' : { 'id' : 318 , 'type' : EventSourceType . URL_REQUEST } , 'time' : '953675699' , 'type' : EventType . HTTP_STREAM_REQUEST } , { 'params' : { 'net_error' : - 105 } , 'phase' : EventPhase . PHASE_END , 'source' : { 'id' : 318 , 'type' : EventSourceType . URL_REQUEST } , 'time' : '953675705' , 'type' : EventType . URL_REQUEST_START_JOB } , { 'params' : { 'net_error' : - 105 } , 'phase' : EventPhase . PHASE_END , 'source' : { 'id' : 318 , 'type' : EventSourceType . URL_REQUEST } , 'time' : '953675923' , 'type' : EventType . REQUEST_ALIVE } ] ; testCase . expectedText = 't=1338864773894 [st=  0] +REQUEST_ALIVE  [dt=475]\n' + 't=1338864773901 [st=  7]    URL_REQUEST_START_JOB  [dt=5]\n' + '                            --> load_flags = ' + testCase . loadFlags . toString ( ) + ' (MAIN_FRAME_DEPRECATED | MAYBE_USER_GESTURE)\n' + '                            --> method = "GET"\n' + '                            --> priority = 4\n' + '                            --> url = "http://www.doesnotexistdomain.com/"\n' + 't=1338864773906 [st= 12]   +URL_REQUEST_START_JOB  [dt=245]\n' + '                            --> load_flags = ' + testCase . loadFlags . toString ( ) + ' (MAIN_FRAME_DEPRECATED | MAYBE_USER_GESTURE)\n' + '                            --> method = "GET"\n' + '                            --> priority = 4\n' + '                            --> url = "http://www.doesnotexistdomain.com/"\n' + 't=1338864773915 [st= 21]      HTTP_CACHE_GET_BACKEND  [dt=0]\n' + 't=1338864773915 [st= 21]      HTTP_CACHE_OPEN_ENTRY  [dt=1]\n' + '                              --> net_error = -2 (ERR_FAILED)\n' + 't=1338864773917 [st= 23]      HTTP_CACHE_CREATE_ENTRY  [dt=2]\n' + 't=1338864773919 [st= 25]      HTTP_CACHE_ADD_TO_ENTRY  [dt=1]\n' + 't=1338864773920 [st= 26]      HTTP_STREAM_REQUEST  [dt=225]\n' + 't=1338864774151 [st=257]   -URL_REQUEST_START_JOB\n' + '                            --> net_error = -105 (ERR_NAME_NOT_RESOLVED)\n' + 't=1338864774369 [st=475] -REQUEST_ALIVE\n' + '                          --> net_error = -105 (ERR_NAME_NOT_RESOLVED)' ; return testCase ; }
Tests the custom formatting of net_errors across several different event
 types.
Tests the custom formatting of net_errors across several different event types .