OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Include test fixture. | 5 // Include test fixture. |
6 GEN_INCLUDE(['net_internals_test.js']); | 6 GEN_INCLUDE(['net_internals_test.js']); |
7 | 7 |
8 // Anonymous namespace | 8 // Anonymous namespace |
9 (function() { | 9 (function() { |
10 | 10 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 actualText = actualText.replace(/^\s+|\s+$/g, ''); | 143 actualText = actualText.replace(/^\s+|\s+$/g, ''); |
144 | 144 |
145 expectEquals(testCase.expectedText, actualText); | 145 expectEquals(testCase.expectedText, actualText); |
146 } | 146 } |
147 | 147 |
148 runTestCase(painterTestURLRequest()); | 148 runTestCase(painterTestURLRequest()); |
149 runTestCase(painterTestURLRequestIncomplete()); | 149 runTestCase(painterTestURLRequestIncomplete()); |
150 runTestCase(painterTestURLRequestIncompleteFromLoadedLog()); | 150 runTestCase(painterTestURLRequestIncompleteFromLoadedLog()); |
151 runTestCase(painterTestURLRequestIncompleteFromLoadedLogSingleEvent()); | 151 runTestCase(painterTestURLRequestIncompleteFromLoadedLogSingleEvent()); |
152 runTestCase(painterTestNetError()); | 152 runTestCase(painterTestNetError()); |
| 153 runTestCase(painterTestQuicError()); |
153 runTestCase(painterTestHexEncodedBytes()); | 154 runTestCase(painterTestHexEncodedBytes()); |
154 runTestCase(painterTestCertVerifierJob()); | 155 runTestCase(painterTestCertVerifierJob()); |
155 runTestCase(painterTestProxyConfigOneProxyAllSchemes()); | 156 runTestCase(painterTestProxyConfigOneProxyAllSchemes()); |
156 runTestCase(painterTestProxyConfigTwoProxiesAllSchemes()); | 157 runTestCase(painterTestProxyConfigTwoProxiesAllSchemes()); |
157 runTestCase(painterTestDontStripCookiesURLRequest()); | 158 runTestCase(painterTestDontStripCookiesURLRequest()); |
158 runTestCase(painterTestStripCookiesURLRequest()); | 159 runTestCase(painterTestStripCookiesURLRequest()); |
159 runTestCase(painterTestDontStripCookiesSPDYSession()); | 160 runTestCase(painterTestDontStripCookiesSPDYSession()); |
160 runTestCase(painterTestStripCookiesSPDYSession()); | 161 runTestCase(painterTestStripCookiesSPDYSession()); |
161 runTestCase(painterTestSpdyURLRequestDontStripCookies()); | 162 runTestCase(painterTestSpdyURLRequestDontStripCookies()); |
162 runTestCase(painterTestSpdyURLRequestStripCookies()); | 163 runTestCase(painterTestSpdyURLRequestStripCookies()); |
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1075 't=1338864773920 [st= 26] HTTP_STREAM_REQUEST [dt=225]\n' + | 1076 't=1338864773920 [st= 26] HTTP_STREAM_REQUEST [dt=225]\n' + |
1076 't=1338864774151 [st=257] -URL_REQUEST_START_JOB\n' + | 1077 't=1338864774151 [st=257] -URL_REQUEST_START_JOB\n' + |
1077 ' --> net_error = -105 (ERR_NAME_NOT_RESOLVED)\n' + | 1078 ' --> net_error = -105 (ERR_NAME_NOT_RESOLVED)\n' + |
1078 't=1338864774369 [st=475] -REQUEST_ALIVE\n' + | 1079 't=1338864774369 [st=475] -REQUEST_ALIVE\n' + |
1079 ' --> net_error = -105 (ERR_NAME_NOT_RESOLVED)'; | 1080 ' --> net_error = -105 (ERR_NAME_NOT_RESOLVED)'; |
1080 | 1081 |
1081 return testCase; | 1082 return testCase; |
1082 } | 1083 } |
1083 | 1084 |
1084 /** | 1085 /** |
| 1086 * Tests the custom formatting of QUIC errors across several different event |
| 1087 * types. |
| 1088 */ |
| 1089 function painterTestQuicError() { |
| 1090 var testCase = {}; |
| 1091 testCase.tickOffset = '1337911098446'; |
| 1092 |
| 1093 testCase.logEntries = [ |
| 1094 { |
| 1095 'params': { |
| 1096 "host": "www.example.com" |
| 1097 }, |
| 1098 'phase': EventPhase.PHASE_BEGIN, |
| 1099 'source': { |
| 1100 'id': 318, |
| 1101 'type': EventSourceType.URL_REQUEST |
| 1102 }, |
| 1103 'time': '953675448', |
| 1104 'type': EventType.QUIC_SESSION |
| 1105 }, |
| 1106 { |
| 1107 'params': { |
| 1108 'details': "invalid headers", |
| 1109 'quic_rst_stream_error': |
| 1110 QuicRstStreamError.QUIC_BAD_APPLICATION_PAYLOAD, |
| 1111 'stream_id': 1 |
| 1112 }, |
| 1113 'phase': EventPhase.PHASE_NONE, |
| 1114 'source': { |
| 1115 'id': 318, |
| 1116 'type': EventSourceType.URL_REQUEST |
| 1117 }, |
| 1118 'time': '953675460', |
| 1119 'type': EventType.QUIC_SESSION_RST_STREAM_FRAME_RECEIVED |
| 1120 }, |
| 1121 { |
| 1122 'params': { |
| 1123 'quic_error': QuicError.QUIC_CONNECTION_TIMED_OUT, |
| 1124 }, |
| 1125 'phase': EventPhase.PHASE_NONE, |
| 1126 'source': { |
| 1127 'id': 318, |
| 1128 'type': EventSourceType.URL_REQUEST |
| 1129 }, |
| 1130 'time': '953675705', |
| 1131 'type': EventType.QUIC_SESSION_CONNECTION_CLOSE_FRAME_RECEIVED |
| 1132 }, |
| 1133 { |
| 1134 'params': { |
| 1135 'quic_error': QuicError.QUIC_CONNECTION_TIMED_OUT |
| 1136 }, |
| 1137 'phase': EventPhase.PHASE_END, |
| 1138 'source': { |
| 1139 'id': 318, |
| 1140 'type': EventSourceType.URL_REQUEST |
| 1141 }, |
| 1142 'time': '953675923', |
| 1143 'type': EventType.QUIC_SESSION |
| 1144 } |
| 1145 ]; |
| 1146 |
| 1147 testCase.expectedText = |
| 1148 't=1338864773894 [st= 0] +QUIC_SESSION [dt=475]\n' + |
| 1149 ' --> host = "www.example.com"\n' + |
| 1150 't=1338864773906 [st= 12] QUIC_SESSION_RST_STREAM_FRAME_RECEIVED\n' + |
| 1151 ' --> details = "invalid headers"\n' + |
| 1152 ' --> quic_rst_stream_error = ' + |
| 1153 QuicRstStreamError.QUIC_BAD_APPLICATION_PAYLOAD + ' (' + |
| 1154 'QUIC_BAD_APPLICATION_PAYLOAD)\n' + |
| 1155 ' --> stream_id = 1\n' + |
| 1156 't=1338864774151 [st=257] QUIC_SESSION_CONNECTION_CLOSE_FRAME_RECEIVED\n' + |
| 1157 ' --> quic_error = ' + |
| 1158 QuicError.QUIC_CONNECTION_TIMED_OUT + ' (QUIC_CONNECTION_TIMED_OUT)\n' + |
| 1159 't=1338864774369 [st=475] -QUIC_SESSION\n' + |
| 1160 ' --> quic_error = ' + |
| 1161 QuicError.QUIC_CONNECTION_TIMED_OUT + ' (QUIC_CONNECTION_TIMED_OUT)'; |
| 1162 |
| 1163 return testCase; |
| 1164 } |
| 1165 |
| 1166 /** |
1085 * Tests the formatting of bytes sent/received as hex + ASCII. Note that the | 1167 * Tests the formatting of bytes sent/received as hex + ASCII. Note that the |
1086 * test data was truncated which is why the byte_count doesn't quite match the | 1168 * test data was truncated which is why the byte_count doesn't quite match the |
1087 * hex_encoded_bytes. | 1169 * hex_encoded_bytes. |
1088 */ | 1170 */ |
1089 function painterTestHexEncodedBytes() { | 1171 function painterTestHexEncodedBytes() { |
1090 var testCase = {}; | 1172 var testCase = {}; |
1091 testCase.tickOffset = '1337911098473'; | 1173 testCase.tickOffset = '1337911098473'; |
1092 | 1174 |
1093 testCase.logEntries = [ | 1175 testCase.logEntries = [ |
1094 { | 1176 { |
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1840 ' --> method = "GET"\n' + | 1922 ' --> method = "GET"\n' + |
1841 ' --> url = "http://www.MagicPonyShopper.com"\n' + | 1923 ' --> url = "http://www.MagicPonyShopper.com"\n' + |
1842 't=1338864774145 [st=151] -HTTP_STREAM_REQUEST\n' + | 1924 't=1338864774145 [st=151] -HTTP_STREAM_REQUEST\n' + |
1843 't=1338864774151 [st=157] -URL_REQUEST_START_JOB\n' + | 1925 't=1338864774151 [st=157] -URL_REQUEST_START_JOB\n' + |
1844 't=1338864774369 [st=375] -REQUEST_ALIVE'; | 1926 't=1338864774369 [st=375] -REQUEST_ALIVE'; |
1845 | 1927 |
1846 return testCase; | 1928 return testCase; |
1847 } | 1929 } |
1848 | 1930 |
1849 })(); // Anonymous namespace | 1931 })(); // Anonymous namespace |
OLD | NEW |