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 <memory> | 5 #include <memory> |
6 #include <ostream> | 6 #include <ostream> |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "net/cert/multi_log_ct_verifier.h" | 21 #include "net/cert/multi_log_ct_verifier.h" |
22 #include "net/dns/mock_host_resolver.h" | 22 #include "net/dns/mock_host_resolver.h" |
23 #include "net/http/http_auth_handler_factory.h" | 23 #include "net/http/http_auth_handler_factory.h" |
24 #include "net/http/http_network_session.h" | 24 #include "net/http/http_network_session.h" |
25 #include "net/http/http_network_transaction.h" | 25 #include "net/http/http_network_transaction.h" |
26 #include "net/http/http_server_properties_impl.h" | 26 #include "net/http/http_server_properties_impl.h" |
27 #include "net/http/http_stream.h" | 27 #include "net/http/http_stream.h" |
28 #include "net/http/http_stream_factory.h" | 28 #include "net/http/http_stream_factory.h" |
29 #include "net/http/http_transaction_test_util.h" | 29 #include "net/http/http_transaction_test_util.h" |
30 #include "net/http/transport_security_state.h" | 30 #include "net/http/transport_security_state.h" |
| 31 #include "net/log/net_log_event_type.h" |
31 #include "net/log/test_net_log.h" | 32 #include "net/log/test_net_log.h" |
32 #include "net/log/test_net_log_entry.h" | 33 #include "net/log/test_net_log_entry.h" |
33 #include "net/log/test_net_log_util.h" | 34 #include "net/log/test_net_log_util.h" |
34 #include "net/proxy/proxy_config_service_fixed.h" | 35 #include "net/proxy/proxy_config_service_fixed.h" |
35 #include "net/proxy/proxy_resolver.h" | 36 #include "net/proxy/proxy_resolver.h" |
36 #include "net/proxy/proxy_service.h" | 37 #include "net/proxy/proxy_service.h" |
37 #include "net/quic/chromium/crypto/proof_verifier_chromium.h" | 38 #include "net/quic/chromium/crypto/proof_verifier_chromium.h" |
38 #include "net/quic/chromium/mock_network_change_notifier.h" | 39 #include "net/quic/chromium/mock_network_change_notifier.h" |
39 #include "net/quic/chromium/mock_quic_data.h" | 40 #include "net/quic/chromium/mock_quic_data.h" |
40 #include "net/quic/core/crypto/quic_decrypter.h" | 41 #include "net/quic/core/crypto/quic_decrypter.h" |
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
737 EXPECT_TRUE( | 738 EXPECT_TRUE( |
738 test_socket_performance_watcher_factory_.rtt_notification_received()); | 739 test_socket_performance_watcher_factory_.rtt_notification_received()); |
739 | 740 |
740 // Check that the NetLog was filled reasonably. | 741 // Check that the NetLog was filled reasonably. |
741 TestNetLogEntry::List entries; | 742 TestNetLogEntry::List entries; |
742 net_log_.GetEntries(&entries); | 743 net_log_.GetEntries(&entries); |
743 EXPECT_LT(0u, entries.size()); | 744 EXPECT_LT(0u, entries.size()); |
744 | 745 |
745 // Check that we logged a QUIC_SESSION_PACKET_RECEIVED. | 746 // Check that we logged a QUIC_SESSION_PACKET_RECEIVED. |
746 int pos = ExpectLogContainsSomewhere( | 747 int pos = ExpectLogContainsSomewhere( |
747 entries, 0, NetLog::TYPE_QUIC_SESSION_PACKET_RECEIVED, | 748 entries, 0, NetLogEventType::QUIC_SESSION_PACKET_RECEIVED, |
748 NetLog::PHASE_NONE); | 749 NetLogEventPhase::NONE); |
749 EXPECT_LT(0, pos); | 750 EXPECT_LT(0, pos); |
750 | 751 |
751 // ... and also a TYPE_QUIC_SESSION_UNAUTHENTICATED_PACKET_HEADER_RECEIVED. | 752 // ... and also a TYPE_QUIC_SESSION_UNAUTHENTICATED_PACKET_HEADER_RECEIVED. |
752 pos = ExpectLogContainsSomewhere( | 753 pos = ExpectLogContainsSomewhere( |
753 entries, 0, | 754 entries, 0, |
754 NetLog::TYPE_QUIC_SESSION_UNAUTHENTICATED_PACKET_HEADER_RECEIVED, | 755 NetLogEventType::QUIC_SESSION_UNAUTHENTICATED_PACKET_HEADER_RECEIVED, |
755 NetLog::PHASE_NONE); | 756 NetLogEventPhase::NONE); |
756 EXPECT_LT(0, pos); | 757 EXPECT_LT(0, pos); |
757 | 758 |
758 std::string packet_number; | 759 std::string packet_number; |
759 ASSERT_TRUE(entries[pos].GetStringValue("packet_number", &packet_number)); | 760 ASSERT_TRUE(entries[pos].GetStringValue("packet_number", &packet_number)); |
760 EXPECT_EQ("1", packet_number); | 761 EXPECT_EQ("1", packet_number); |
761 | 762 |
762 // ... and also a TYPE_QUIC_SESSION_PACKET_AUTHENTICATED. | 763 // ... and also a TYPE_QUIC_SESSION_PACKET_AUTHENTICATED. |
763 pos = ExpectLogContainsSomewhere( | 764 pos = ExpectLogContainsSomewhere( |
764 entries, 0, NetLog::TYPE_QUIC_SESSION_PACKET_AUTHENTICATED, | 765 entries, 0, NetLogEventType::QUIC_SESSION_PACKET_AUTHENTICATED, |
765 NetLog::PHASE_NONE); | 766 NetLogEventPhase::NONE); |
766 EXPECT_LT(0, pos); | 767 EXPECT_LT(0, pos); |
767 | 768 |
768 // ... and also a QUIC_SESSION_STREAM_FRAME_RECEIVED. | 769 // ... and also a QUIC_SESSION_STREAM_FRAME_RECEIVED. |
769 pos = ExpectLogContainsSomewhere( | 770 pos = ExpectLogContainsSomewhere( |
770 entries, 0, NetLog::TYPE_QUIC_SESSION_STREAM_FRAME_RECEIVED, | 771 entries, 0, NetLogEventType::QUIC_SESSION_STREAM_FRAME_RECEIVED, |
771 NetLog::PHASE_NONE); | 772 NetLogEventPhase::NONE); |
772 EXPECT_LT(0, pos); | 773 EXPECT_LT(0, pos); |
773 | 774 |
774 int log_stream_id; | 775 int log_stream_id; |
775 ASSERT_TRUE(entries[pos].GetIntegerValue("stream_id", &log_stream_id)); | 776 ASSERT_TRUE(entries[pos].GetIntegerValue("stream_id", &log_stream_id)); |
776 EXPECT_EQ(3, log_stream_id); | 777 EXPECT_EQ(3, log_stream_id); |
777 } | 778 } |
778 | 779 |
779 TEST_P(QuicNetworkTransactionTest, ForceQuicForAll) { | 780 TEST_P(QuicNetworkTransactionTest, ForceQuicForAll) { |
780 params_.origins_to_force_quic_on.insert(HostPortPair()); | 781 params_.origins_to_force_quic_on.insert(HostPortPair()); |
781 | 782 |
(...skipping 1765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2547 request_.url = GURL("https://mail.example.org/pushed.jpg"); | 2548 request_.url = GURL("https://mail.example.org/pushed.jpg"); |
2548 SendRequestAndExpectQuicResponse("and hello!"); | 2549 SendRequestAndExpectQuicResponse("and hello!"); |
2549 | 2550 |
2550 // Check that the NetLog was filled reasonably. | 2551 // Check that the NetLog was filled reasonably. |
2551 TestNetLogEntry::List entries; | 2552 TestNetLogEntry::List entries; |
2552 net_log_.GetEntries(&entries); | 2553 net_log_.GetEntries(&entries); |
2553 EXPECT_LT(0u, entries.size()); | 2554 EXPECT_LT(0u, entries.size()); |
2554 | 2555 |
2555 // Check that we logged a QUIC_HTTP_STREAM_ADOPTED_PUSH_STREAM | 2556 // Check that we logged a QUIC_HTTP_STREAM_ADOPTED_PUSH_STREAM |
2556 int pos = ExpectLogContainsSomewhere( | 2557 int pos = ExpectLogContainsSomewhere( |
2557 entries, 0, NetLog::TYPE_QUIC_HTTP_STREAM_ADOPTED_PUSH_STREAM, | 2558 entries, 0, NetLogEventType::QUIC_HTTP_STREAM_ADOPTED_PUSH_STREAM, |
2558 NetLog::PHASE_NONE); | 2559 NetLogEventPhase::NONE); |
2559 EXPECT_LT(0, pos); | 2560 EXPECT_LT(0, pos); |
2560 } | 2561 } |
2561 | 2562 |
2562 TEST_P(QuicNetworkTransactionTest, QuicForceHolBlocking) { | 2563 TEST_P(QuicNetworkTransactionTest, QuicForceHolBlocking) { |
2563 FLAGS_quic_enable_version_35 = true; | 2564 FLAGS_quic_enable_version_35 = true; |
2564 FLAGS_quic_enable_version_36 = true; | 2565 FLAGS_quic_enable_version_36 = true; |
2565 params_.quic_force_hol_blocking = true; | 2566 params_.quic_force_hol_blocking = true; |
2566 params_.origins_to_force_quic_on.insert( | 2567 params_.origins_to_force_quic_on.insert( |
2567 HostPortPair::FromString("mail.example.org:443")); | 2568 HostPortPair::FromString("mail.example.org:443")); |
2568 | 2569 |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3024 AddHangingSocketData(); | 3025 AddHangingSocketData(); |
3025 | 3026 |
3026 SendRequestAndExpectQuicResponse(origin1_); | 3027 SendRequestAndExpectQuicResponse(origin1_); |
3027 SendRequestAndExpectQuicResponse(origin2_); | 3028 SendRequestAndExpectQuicResponse(origin2_); |
3028 | 3029 |
3029 EXPECT_TRUE(AllDataConsumed()); | 3030 EXPECT_TRUE(AllDataConsumed()); |
3030 } | 3031 } |
3031 | 3032 |
3032 } // namespace test | 3033 } // namespace test |
3033 } // namespace net | 3034 } // namespace net |
OLD | NEW |