Chromium Code Reviews| 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 net_errors across several different event | |
|
eroman
2013/06/18 19:39:17
Update this comment to reflect it is a quic error
Ryan Hamilton
2013/06/19 16:59:11
Done.
| |
| 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': 3, | |
|
eroman
2013/06/18 19:39:17
[optional] Note that in the future if you change t
Ryan Hamilton
2013/06/19 16:59:11
Great idea. Done!
| |
| 1110 'stream_id': 1 | |
| 1111 }, | |
| 1112 'phase': EventPhase.PHASE_NONE, | |
| 1113 'source': { | |
| 1114 'id': 318, | |
| 1115 'type': EventSourceType.URL_REQUEST | |
| 1116 }, | |
| 1117 'time': '953675460', | |
| 1118 'type': EventType.QUIC_SESSION_RST_STREAM_FRAME_RECEIVED | |
| 1119 }, | |
| 1120 { | |
| 1121 'params': { | |
| 1122 'quic_error': 25 | |
|
eroman
2013/06/18 19:39:17
Same comment as above
Ryan Hamilton
2013/06/19 16:59:11
Done.
| |
| 1123 }, | |
| 1124 'phase': EventPhase.PHASE_NONE, | |
| 1125 'source': { | |
| 1126 'id': 318, | |
| 1127 'type': EventSourceType.URL_REQUEST | |
| 1128 }, | |
| 1129 'time': '953675705', | |
| 1130 'type': EventType.QUIC_SESSION_CONNECTION_CLOSE_FRAME_RECEIVED | |
| 1131 }, | |
| 1132 { | |
| 1133 'params': { | |
| 1134 'quic_error': 25 | |
|
Ryan Hamilton
2013/06/19 16:59:11
And done here too.
| |
| 1135 }, | |
| 1136 'phase': EventPhase.PHASE_END, | |
| 1137 'source': { | |
| 1138 'id': 318, | |
| 1139 'type': EventSourceType.URL_REQUEST | |
| 1140 }, | |
| 1141 'time': '953675923', | |
| 1142 'type': EventType.QUIC_SESSION | |
| 1143 } | |
| 1144 ]; | |
| 1145 | |
| 1146 testCase.expectedText = | |
| 1147 't=1338864773894 [st= 0] +QUIC_SESSION [dt=475]\n' + | |
| 1148 ' --> host = "www.example.com"\n' + | |
| 1149 't=1338864773906 [st= 12] QUIC_SESSION_RST_STREAM_FRAME_RECEIVED\n' + | |
| 1150 ' --> details = "invalid headers"\n' + | |
| 1151 ' --> quic_rst_stream_error = 3 (' + | |
|
eroman
2013/06/18 19:39:17
Same comment as above
Ryan Hamilton
2013/06/19 16:59:11
Oh, clever! That didn't occur to me even after th
| |
| 1152 'BAD_APPLICATION_PAYLOAD)\n' + | |
| 1153 ' --> stream_id = 1\n' + | |
| 1154 't=1338864774151 [st=257] QUIC_SESSION_CONNECTION_CLOSE_FRAME_RECEIVED\n' + | |
| 1155 ' --> quic_error = 25 (CONNECTION_TIMED_OUT)\n' + | |
| 1156 't=1338864774369 [st=475] -QUIC_SESSION\n' + | |
| 1157 ' --> quic_error = 25 (CONNECTION_TIMED_OUT)'; | |
|
eroman
2013/06/18 19:39:17
Same comment as above.
Ryan Hamilton
2013/06/19 16:59:11
Done.
| |
| 1158 | |
| 1159 return testCase; | |
| 1160 } | |
| 1161 | |
| 1162 /** | |
| 1085 * Tests the formatting of bytes sent/received as hex + ASCII. Note that the | 1163 * 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 | 1164 * test data was truncated which is why the byte_count doesn't quite match the |
| 1087 * hex_encoded_bytes. | 1165 * hex_encoded_bytes. |
| 1088 */ | 1166 */ |
| 1089 function painterTestHexEncodedBytes() { | 1167 function painterTestHexEncodedBytes() { |
| 1090 var testCase = {}; | 1168 var testCase = {}; |
| 1091 testCase.tickOffset = '1337911098473'; | 1169 testCase.tickOffset = '1337911098473'; |
| 1092 | 1170 |
| 1093 testCase.logEntries = [ | 1171 testCase.logEntries = [ |
| 1094 { | 1172 { |
| (...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1840 ' --> method = "GET"\n' + | 1918 ' --> method = "GET"\n' + |
| 1841 ' --> url = "http://www.MagicPonyShopper.com"\n' + | 1919 ' --> url = "http://www.MagicPonyShopper.com"\n' + |
| 1842 't=1338864774145 [st=151] -HTTP_STREAM_REQUEST\n' + | 1920 't=1338864774145 [st=151] -HTTP_STREAM_REQUEST\n' + |
| 1843 't=1338864774151 [st=157] -URL_REQUEST_START_JOB\n' + | 1921 't=1338864774151 [st=157] -URL_REQUEST_START_JOB\n' + |
| 1844 't=1338864774369 [st=375] -REQUEST_ALIVE'; | 1922 't=1338864774369 [st=375] -REQUEST_ALIVE'; |
| 1845 | 1923 |
| 1846 return testCase; | 1924 return testCase; |
| 1847 } | 1925 } |
| 1848 | 1926 |
| 1849 })(); // Anonymous namespace | 1927 })(); // Anonymous namespace |
| OLD | NEW |