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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
11 #include "net/base/test_completion_callback.h" | 11 #include "net/base/test_completion_callback.h" |
12 #include "net/cert/mock_cert_verifier.h" | 12 #include "net/cert/mock_cert_verifier.h" |
13 #include "net/dns/mock_host_resolver.h" | 13 #include "net/dns/mock_host_resolver.h" |
14 #include "net/http/http_auth_handler_factory.h" | 14 #include "net/http/http_auth_handler_factory.h" |
15 #include "net/http/http_network_session.h" | 15 #include "net/http/http_network_session.h" |
16 #include "net/http/http_network_transaction.h" | 16 #include "net/http/http_network_transaction.h" |
17 #include "net/http/http_server_properties_impl.h" | 17 #include "net/http/http_server_properties_impl.h" |
18 #include "net/http/http_stream.h" | 18 #include "net/http/http_stream.h" |
19 #include "net/http/http_stream_factory.h" | 19 #include "net/http/http_stream_factory.h" |
20 #include "net/http/http_transaction_test_util.h" | 20 #include "net/http/http_transaction_test_util.h" |
21 #include "net/http/transport_security_state.h" | 21 #include "net/http/transport_security_state.h" |
| 22 #include "net/log/captured_net_log_entry.h" |
22 #include "net/log/net_log_unittest.h" | 23 #include "net/log/net_log_unittest.h" |
23 #include "net/log/test_net_log.h" | 24 #include "net/log/test_net_log.h" |
24 #include "net/proxy/proxy_config_service_fixed.h" | 25 #include "net/proxy/proxy_config_service_fixed.h" |
25 #include "net/proxy/proxy_resolver.h" | 26 #include "net/proxy/proxy_resolver.h" |
26 #include "net/proxy/proxy_service.h" | 27 #include "net/proxy/proxy_service.h" |
27 #include "net/quic/crypto/quic_decrypter.h" | 28 #include "net/quic/crypto/quic_decrypter.h" |
28 #include "net/quic/crypto/quic_encrypter.h" | 29 #include "net/quic/crypto/quic_encrypter.h" |
29 #include "net/quic/quic_framer.h" | 30 #include "net/quic/quic_framer.h" |
30 #include "net/quic/quic_http_utils.h" | 31 #include "net/quic/quic_http_utils.h" |
31 #include "net/quic/test_tools/crypto_test_utils.h" | 32 #include "net/quic/test_tools/crypto_test_utils.h" |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 | 406 |
406 // The non-alternate protocol job needs to hang in order to guarantee that | 407 // The non-alternate protocol job needs to hang in order to guarantee that |
407 // the alternate-protocol job will "win". | 408 // the alternate-protocol job will "win". |
408 AddHangingNonAlternateProtocolSocketData(); | 409 AddHangingNonAlternateProtocolSocketData(); |
409 | 410 |
410 CreateSession(); | 411 CreateSession(); |
411 | 412 |
412 SendRequestAndExpectQuicResponse("hello!"); | 413 SendRequestAndExpectQuicResponse("hello!"); |
413 | 414 |
414 // Check that the NetLog was filled reasonably. | 415 // Check that the NetLog was filled reasonably. |
415 TestNetLog::CapturedEntryList entries; | 416 CapturedNetLogEntry::List entries; |
416 net_log_.GetEntries(&entries); | 417 net_log_.GetEntries(&entries); |
417 EXPECT_LT(0u, entries.size()); | 418 EXPECT_LT(0u, entries.size()); |
418 | 419 |
419 // Check that we logged a QUIC_SESSION_PACKET_RECEIVED. | 420 // Check that we logged a QUIC_SESSION_PACKET_RECEIVED. |
420 int pos = ExpectLogContainsSomewhere( | 421 int pos = ExpectLogContainsSomewhere( |
421 entries, 0, NetLog::TYPE_QUIC_SESSION_PACKET_RECEIVED, | 422 entries, 0, NetLog::TYPE_QUIC_SESSION_PACKET_RECEIVED, |
422 NetLog::PHASE_NONE); | 423 NetLog::PHASE_NONE); |
423 EXPECT_LT(0, pos); | 424 EXPECT_LT(0, pos); |
424 | 425 |
425 // ... and also a TYPE_QUIC_SESSION_PACKET_HEADER_RECEIVED. | 426 // ... and also a TYPE_QUIC_SESSION_PACKET_HEADER_RECEIVED. |
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1171 nullptr, | 1172 nullptr, |
1172 net_log_.bound()); | 1173 net_log_.bound()); |
1173 | 1174 |
1174 CreateSessionWithNextProtos(); | 1175 CreateSessionWithNextProtos(); |
1175 AddQuicAlternateProtocolMapping(MockCryptoClientStream::ZERO_RTT); | 1176 AddQuicAlternateProtocolMapping(MockCryptoClientStream::ZERO_RTT); |
1176 SendRequestAndExpectHttpResponse("hello world"); | 1177 SendRequestAndExpectHttpResponse("hello world"); |
1177 } | 1178 } |
1178 | 1179 |
1179 } // namespace test | 1180 } // namespace test |
1180 } // namespace net | 1181 } // namespace net |
OLD | NEW |