| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 runTestCase(painterTestProxyConfigOneProxyAllSchemes()); | 194 runTestCase(painterTestProxyConfigOneProxyAllSchemes()); |
| 195 runTestCase(painterTestProxyConfigTwoProxiesAllSchemes()); | 195 runTestCase(painterTestProxyConfigTwoProxiesAllSchemes()); |
| 196 runTestCase(painterTestDontStripCookiesURLRequest()); | 196 runTestCase(painterTestDontStripCookiesURLRequest()); |
| 197 runTestCase(painterTestStripCookiesURLRequest()); | 197 runTestCase(painterTestStripCookiesURLRequest()); |
| 198 runTestCase(painterTestDontStripCookiesSPDYSession()); | 198 runTestCase(painterTestDontStripCookiesSPDYSession()); |
| 199 runTestCase(painterTestStripCookiesSPDYSession()); | 199 runTestCase(painterTestStripCookiesSPDYSession()); |
| 200 runTestCase(painterTestSpdyURLRequestDontStripCookies()); | 200 runTestCase(painterTestSpdyURLRequestDontStripCookies()); |
| 201 runTestCase(painterTestSpdyURLRequestStripCookies()); | 201 runTestCase(painterTestSpdyURLRequestStripCookies()); |
| 202 runTestCase(painterTestExtraCustomParameter()); | 202 runTestCase(painterTestExtraCustomParameter()); |
| 203 runTestCase(painterTestMissingCustomParameter()); | 203 runTestCase(painterTestMissingCustomParameter()); |
| 204 runTestCase(painterTestSSLVersionFallback()); | |
| 205 runTestCase(painterTestInProgressURLRequest()); | 204 runTestCase(painterTestInProgressURLRequest()); |
| 206 runTestCase(painterTestBaseTime()); | 205 runTestCase(painterTestBaseTime()); |
| 207 | 206 |
| 208 testDone(); | 207 testDone(); |
| 209 }); | 208 }); |
| 210 | 209 |
| 211 /** | 210 /** |
| 212 * Test case for a URLRequest. This includes custom formatting for load flags, | 211 * Test case for a URLRequest. This includes custom formatting for load flags, |
| 213 * request/response HTTP headers, dependent sources, as well as basic | 212 * request/response HTTP headers, dependent sources, as well as basic |
| 214 * indentation and grouping. Also makes sure that no extra event is logged | 213 * indentation and grouping. Also makes sure that no extra event is logged |
| (...skipping 1837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2052 testCase.expectedText = | 2051 testCase.expectedText = |
| 2053 't=1338864633356 [st=0] HTTP_TRANSACTION_SEND_REQUEST_HEADERS\n' + | 2052 't=1338864633356 [st=0] HTTP_TRANSACTION_SEND_REQUEST_HEADERS\n' + |
| 2054 ' --> headersWRONG = ["Host: www.google.com",' + | 2053 ' --> headersWRONG = ["Host: www.google.com",' + |
| 2055 '"Connection: keep-alive"]\n' + | 2054 '"Connection: keep-alive"]\n' + |
| 2056 ' --> line = "GET / HTTP/1.1\\r\\n"'; | 2055 ' --> line = "GET / HTTP/1.1\\r\\n"'; |
| 2057 | 2056 |
| 2058 return testCase; | 2057 return testCase; |
| 2059 } | 2058 } |
| 2060 | 2059 |
| 2061 /** | 2060 /** |
| 2062 * Tests the formatting for an SSL version fallback event. | |
| 2063 */ | |
| 2064 function painterTestSSLVersionFallback() { | |
| 2065 var testCase = {}; | |
| 2066 testCase.tickOffset = '1337911098400'; | |
| 2067 | |
| 2068 testCase.logEntries = [ | |
| 2069 { | |
| 2070 'params': { | |
| 2071 'host_and_port': 'www-927.ibm.com:443', | |
| 2072 'net_error': -107, | |
| 2073 'version_after': 0x301, | |
| 2074 'version_before': 0x302 | |
| 2075 }, | |
| 2076 'phase': EventPhase.PHASE_NONE, | |
| 2077 'source': { | |
| 2078 'id': 124, | |
| 2079 'type': EventSourceType.URL_REQUEST | |
| 2080 }, | |
| 2081 'time': '1119062679', | |
| 2082 'type': EventType.SSL_VERSION_FALLBACK | |
| 2083 }, | |
| 2084 { | |
| 2085 'params': { | |
| 2086 'host_and_port': 'www-927.ibm.com:443', | |
| 2087 'net_error': -107, | |
| 2088 'version_after': 0x300, | |
| 2089 'version_before': 0x301 | |
| 2090 }, | |
| 2091 'phase': EventPhase.PHASE_NONE, | |
| 2092 'source': { | |
| 2093 'id': 124, | |
| 2094 'type': EventSourceType.URL_REQUEST | |
| 2095 }, | |
| 2096 'time': '1119062850', | |
| 2097 'type': EventType.SSL_VERSION_FALLBACK | |
| 2098 }, | |
| 2099 { | |
| 2100 'params': { | |
| 2101 'version_after': 0x123456, | |
| 2102 'version_before': 0x300 | |
| 2103 }, | |
| 2104 'phase': EventPhase.PHASE_NONE, | |
| 2105 'source': { | |
| 2106 'id': 124, | |
| 2107 'type': EventSourceType.URL_REQUEST | |
| 2108 }, | |
| 2109 'time': '1119062850', | |
| 2110 'type': EventType.SSL_VERSION_FALLBACK | |
| 2111 }, | |
| 2112 ]; | |
| 2113 | |
| 2114 testCase.expectedText = | |
| 2115 't=1339030161079 [st= 0] SSL_VERSION_FALLBACK\n' + | |
| 2116 ' --> TLS 1.1 ==> TLS 1.0\n' + | |
| 2117 ' --> host_and_port = "www-927.ibm.com:443"\n' + | |
| 2118 ' --> net_error = -107 (ERR_SSL_PROTOCOL_ERROR)\n' + | |
| 2119 't=1339030161250 [st=171] SSL_VERSION_FALLBACK\n' + | |
| 2120 ' --> TLS 1.0 ==> SSL 3.0\n' + | |
| 2121 ' --> host_and_port = "www-927.ibm.com:443"\n' + | |
| 2122 ' --> net_error = -107 (ERR_SSL_PROTOCOL_ERROR)\n' + | |
| 2123 't=1339030161250 [st=171] SSL_VERSION_FALLBACK\n' + | |
| 2124 ' --> SSL 3.0 ==> SSL 0x123456'; | |
| 2125 | |
| 2126 return testCase; | |
| 2127 } | |
| 2128 | |
| 2129 /** | |
| 2130 * Tests the formatting of a URL request that was just finishing up when | 2061 * Tests the formatting of a URL request that was just finishing up when |
| 2131 * net-internals was opened. | 2062 * net-internals was opened. |
| 2132 */ | 2063 */ |
| 2133 function painterTestInProgressURLRequest() { | 2064 function painterTestInProgressURLRequest() { |
| 2134 var testCase = {}; | 2065 var testCase = {}; |
| 2135 testCase.tickOffset = '1337911098446'; | 2066 testCase.tickOffset = '1337911098446'; |
| 2136 testCase.loadFlags = LoadFlag.MAIN_FRAME_DEPRECATED | | 2067 testCase.loadFlags = LoadFlag.MAIN_FRAME_DEPRECATED | |
| 2137 LoadFlag.MAYBE_USER_GESTURE | | 2068 LoadFlag.MAYBE_USER_GESTURE | |
| 2138 LoadFlag.VERIFY_EV_CERT; | 2069 LoadFlag.VERIFY_EV_CERT; |
| 2139 | 2070 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2241 | 2172 |
| 2242 testCase.expectedText = | 2173 testCase.expectedText = |
| 2243 't= 2 [st= 0] +REQUEST_ALIVE [dt=789+]\n' + | 2174 't= 2 [st= 0] +REQUEST_ALIVE [dt=789+]\n' + |
| 2244 't=152 [st=150] HTTP_STREAM_REQUEST [dt=1]\n' + | 2175 't=152 [st=150] HTTP_STREAM_REQUEST [dt=1]\n' + |
| 2245 't=791 [st=789]'; | 2176 't=791 [st=789]'; |
| 2246 | 2177 |
| 2247 return testCase; | 2178 return testCase; |
| 2248 } | 2179 } |
| 2249 | 2180 |
| 2250 })(); // Anonymous namespace | 2181 })(); // Anonymous namespace |
| OLD | NEW |