| 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 runTestCase(painterTestProxyConfigOneProxyAllSchemes()); | 193 runTestCase(painterTestProxyConfigOneProxyAllSchemes()); |
| 194 runTestCase(painterTestProxyConfigTwoProxiesAllSchemes()); | 194 runTestCase(painterTestProxyConfigTwoProxiesAllSchemes()); |
| 195 runTestCase(painterTestDontStripCookiesURLRequest()); | 195 runTestCase(painterTestDontStripCookiesURLRequest()); |
| 196 runTestCase(painterTestStripCookiesURLRequest()); | 196 runTestCase(painterTestStripCookiesURLRequest()); |
| 197 runTestCase(painterTestDontStripCookiesSPDYSession()); | 197 runTestCase(painterTestDontStripCookiesSPDYSession()); |
| 198 runTestCase(painterTestStripCookiesSPDYSession()); | 198 runTestCase(painterTestStripCookiesSPDYSession()); |
| 199 runTestCase(painterTestSpdyURLRequestDontStripCookies()); | 199 runTestCase(painterTestSpdyURLRequestDontStripCookies()); |
| 200 runTestCase(painterTestSpdyURLRequestStripCookies()); | 200 runTestCase(painterTestSpdyURLRequestStripCookies()); |
| 201 runTestCase(painterTestExtraCustomParameter()); | 201 runTestCase(painterTestExtraCustomParameter()); |
| 202 runTestCase(painterTestMissingCustomParameter()); | 202 runTestCase(painterTestMissingCustomParameter()); |
| 203 runTestCase(painterTestSSLVersionFallback()); | |
| 204 runTestCase(painterTestInProgressURLRequest()); | 203 runTestCase(painterTestInProgressURLRequest()); |
| 205 runTestCase(painterTestBaseTime()); | 204 runTestCase(painterTestBaseTime()); |
| 206 | 205 |
| 207 testDone(); | 206 testDone(); |
| 208 }); | 207 }); |
| 209 | 208 |
| 210 /** | 209 /** |
| 211 * Test case for a URLRequest. This includes custom formatting for load flags, | 210 * Test case for a URLRequest. This includes custom formatting for load flags, |
| 212 * request/response HTTP headers, dependent sources, as well as basic | 211 * request/response HTTP headers, dependent sources, as well as basic |
| 213 * indentation and grouping. Also makes sure that no extra event is logged | 212 * indentation and grouping. Also makes sure that no extra event is logged |
| (...skipping 1793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2007 testCase.expectedText = | 2006 testCase.expectedText = |
| 2008 't=1338864633356 [st=0] HTTP_TRANSACTION_SEND_REQUEST_HEADERS\n' + | 2007 't=1338864633356 [st=0] HTTP_TRANSACTION_SEND_REQUEST_HEADERS\n' + |
| 2009 ' --> headersWRONG = ["Host: www.google.com",' + | 2008 ' --> headersWRONG = ["Host: www.google.com",' + |
| 2010 '"Connection: keep-alive"]\n' + | 2009 '"Connection: keep-alive"]\n' + |
| 2011 ' --> line = "GET / HTTP/1.1\\r\\n"'; | 2010 ' --> line = "GET / HTTP/1.1\\r\\n"'; |
| 2012 | 2011 |
| 2013 return testCase; | 2012 return testCase; |
| 2014 } | 2013 } |
| 2015 | 2014 |
| 2016 /** | 2015 /** |
| 2017 * Tests the formatting for an SSL version fallback event. | |
| 2018 */ | |
| 2019 function painterTestSSLVersionFallback() { | |
| 2020 var testCase = {}; | |
| 2021 testCase.tickOffset = '1337911098400'; | |
| 2022 | |
| 2023 testCase.logEntries = [ | |
| 2024 { | |
| 2025 'params': { | |
| 2026 'host_and_port': 'www-927.ibm.com:443', | |
| 2027 'net_error': -107, | |
| 2028 'version_after': 0x301, | |
| 2029 'version_before': 0x302 | |
| 2030 }, | |
| 2031 'phase': EventPhase.PHASE_NONE, | |
| 2032 'source': { | |
| 2033 'id': 124, | |
| 2034 'type': EventSourceType.URL_REQUEST | |
| 2035 }, | |
| 2036 'time': '1119062679', | |
| 2037 'type': EventType.SSL_VERSION_FALLBACK | |
| 2038 }, | |
| 2039 { | |
| 2040 'params': { | |
| 2041 'host_and_port': 'www-927.ibm.com:443', | |
| 2042 'net_error': -107, | |
| 2043 'version_after': 0x300, | |
| 2044 'version_before': 0x301 | |
| 2045 }, | |
| 2046 'phase': EventPhase.PHASE_NONE, | |
| 2047 'source': { | |
| 2048 'id': 124, | |
| 2049 'type': EventSourceType.URL_REQUEST | |
| 2050 }, | |
| 2051 'time': '1119062850', | |
| 2052 'type': EventType.SSL_VERSION_FALLBACK | |
| 2053 }, | |
| 2054 { | |
| 2055 'params': { | |
| 2056 'version_after': 0x123456, | |
| 2057 'version_before': 0x300 | |
| 2058 }, | |
| 2059 'phase': EventPhase.PHASE_NONE, | |
| 2060 'source': { | |
| 2061 'id': 124, | |
| 2062 'type': EventSourceType.URL_REQUEST | |
| 2063 }, | |
| 2064 'time': '1119062850', | |
| 2065 'type': EventType.SSL_VERSION_FALLBACK | |
| 2066 }, | |
| 2067 ]; | |
| 2068 | |
| 2069 testCase.expectedText = | |
| 2070 't=1339030161079 [st= 0] SSL_VERSION_FALLBACK\n' + | |
| 2071 ' --> TLS 1.1 ==> TLS 1.0\n' + | |
| 2072 ' --> host_and_port = "www-927.ibm.com:443"\n' + | |
| 2073 ' --> net_error = -107 (ERR_SSL_PROTOCOL_ERROR)\n' + | |
| 2074 't=1339030161250 [st=171] SSL_VERSION_FALLBACK\n' + | |
| 2075 ' --> TLS 1.0 ==> SSL 3.0\n' + | |
| 2076 ' --> host_and_port = "www-927.ibm.com:443"\n' + | |
| 2077 ' --> net_error = -107 (ERR_SSL_PROTOCOL_ERROR)\n' + | |
| 2078 't=1339030161250 [st=171] SSL_VERSION_FALLBACK\n' + | |
| 2079 ' --> SSL 3.0 ==> SSL 0x123456'; | |
| 2080 | |
| 2081 return testCase; | |
| 2082 } | |
| 2083 | |
| 2084 /** | |
| 2085 * Tests the formatting of a URL request that was just finishing up when | 2016 * Tests the formatting of a URL request that was just finishing up when |
| 2086 * net-internals was opened. | 2017 * net-internals was opened. |
| 2087 */ | 2018 */ |
| 2088 function painterTestInProgressURLRequest() { | 2019 function painterTestInProgressURLRequest() { |
| 2089 var testCase = {}; | 2020 var testCase = {}; |
| 2090 testCase.tickOffset = '1337911098446'; | 2021 testCase.tickOffset = '1337911098446'; |
| 2091 testCase.loadFlags = LoadFlag.MAIN_FRAME | LoadFlag.MAYBE_USER_GESTURE | | 2022 testCase.loadFlags = LoadFlag.MAIN_FRAME | LoadFlag.MAYBE_USER_GESTURE | |
| 2092 LoadFlag.VERIFY_EV_CERT; | 2023 LoadFlag.VERIFY_EV_CERT; |
| 2093 | 2024 |
| 2094 testCase.logEntries = [ | 2025 testCase.logEntries = [ |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2195 | 2126 |
| 2196 testCase.expectedText = | 2127 testCase.expectedText = |
| 2197 't= 2 [st= 0] +REQUEST_ALIVE [dt=789+]\n' + | 2128 't= 2 [st= 0] +REQUEST_ALIVE [dt=789+]\n' + |
| 2198 't=152 [st=150] HTTP_STREAM_REQUEST [dt=1]\n' + | 2129 't=152 [st=150] HTTP_STREAM_REQUEST [dt=1]\n' + |
| 2199 't=791 [st=789]'; | 2130 't=791 [st=789]'; |
| 2200 | 2131 |
| 2201 return testCase; | 2132 return testCase; |
| 2202 } | 2133 } |
| 2203 | 2134 |
| 2204 })(); // Anonymous namespace | 2135 })(); // Anonymous namespace |
| OLD | NEW |