| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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 "net/quic/quartc/quartc_session.h" | 5 #include "net/quic/quartc/quartc_session.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| 11 #include "net/base/ip_endpoint.h" | 11 #include "net/base/ip_endpoint.h" |
| 12 #include "net/quic/core/crypto/crypto_server_config_protobuf.h" | 12 #include "net/quic/core/crypto/crypto_server_config_protobuf.h" |
| 13 #include "net/quic/core/crypto/proof_source.h" | 13 #include "net/quic/core/crypto/proof_source.h" |
| 14 #include "net/quic/core/crypto/proof_verifier.h" | 14 #include "net/quic/core/crypto/proof_verifier.h" |
| 15 #include "net/quic/core/crypto/quic_crypto_client_config.h" | 15 #include "net/quic/core/crypto/quic_crypto_client_config.h" |
| 16 #include "net/quic/core/crypto/quic_crypto_server_config.h" | 16 #include "net/quic/core/crypto/quic_crypto_server_config.h" |
| 17 #include "net/quic/core/crypto/quic_random.h" | 17 #include "net/quic/core/crypto/quic_random.h" |
| 18 #include "net/quic/core/quic_crypto_client_stream.h" | 18 #include "net/quic/core/quic_crypto_client_stream.h" |
| 19 #include "net/quic/core/quic_crypto_server_stream.h" | 19 #include "net/quic/core/quic_crypto_server_stream.h" |
| 20 #include "net/quic/core/quic_simple_buffer_allocator.h" | 20 #include "net/quic/core/quic_simple_buffer_allocator.h" |
| 21 #include "net/quic/platform/impl/quic_chromium_clock.h" |
| 21 #include "net/quic/quartc/quartc_alarm_factory.h" | 22 #include "net/quic/quartc/quartc_alarm_factory.h" |
| 22 #include "net/quic/quartc/quartc_packet_writer.h" | 23 #include "net/quic/quartc/quartc_packet_writer.h" |
| 23 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
| 24 | 25 |
| 25 namespace net { | 26 namespace net { |
| 26 namespace test { | 27 namespace test { |
| 27 namespace { | 28 namespace { |
| 28 | 29 |
| 29 static const char kExporterLabel[] = "label"; | 30 static const char kExporterLabel[] = "label"; |
| 30 static const uint8_t kExporterContext[] = "context"; | 31 static const uint8_t kExporterContext[] = "context"; |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 return QuicRandom::GetInstance(); | 442 return QuicRandom::GetInstance(); |
| 442 } | 443 } |
| 443 | 444 |
| 444 QuicBufferAllocator* GetBufferAllocator() override { | 445 QuicBufferAllocator* GetBufferAllocator() override { |
| 445 return &buffer_allocator_; | 446 return &buffer_allocator_; |
| 446 } | 447 } |
| 447 | 448 |
| 448 protected: | 449 protected: |
| 449 std::unique_ptr<QuicAlarmFactory> alarm_factory_; | 450 std::unique_ptr<QuicAlarmFactory> alarm_factory_; |
| 450 SimpleBufferAllocator buffer_allocator_; | 451 SimpleBufferAllocator buffer_allocator_; |
| 451 QuicClock clock_; | 452 QuicChromiumClock clock_; |
| 452 | 453 |
| 453 std::unique_ptr<FakeTransportChannel> client_channel_; | 454 std::unique_ptr<FakeTransportChannel> client_channel_; |
| 454 std::unique_ptr<FakeTransportChannel> server_channel_; | 455 std::unique_ptr<FakeTransportChannel> server_channel_; |
| 455 std::unique_ptr<FakeTransport> client_transport_; | 456 std::unique_ptr<FakeTransport> client_transport_; |
| 456 std::unique_ptr<FakeTransport> server_transport_; | 457 std::unique_ptr<FakeTransport> server_transport_; |
| 457 std::unique_ptr<QuartcPacketWriter> client_writer_; | 458 std::unique_ptr<QuartcPacketWriter> client_writer_; |
| 458 std::unique_ptr<QuartcPacketWriter> server_writer_; | 459 std::unique_ptr<QuartcPacketWriter> server_writer_; |
| 459 std::unique_ptr<QuartcSessionForTest> client_peer_; | 460 std::unique_ptr<QuartcSessionForTest> client_peer_; |
| 460 std::unique_ptr<QuartcSessionForTest> server_peer_; | 461 std::unique_ptr<QuartcSessionForTest> server_peer_; |
| 461 }; | 462 }; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 EXPECT_FALSE(client_peer_->IsClosedStream(id)); | 501 EXPECT_FALSE(client_peer_->IsClosedStream(id)); |
| 501 stream->SetDelegate(client_peer_->stream_delegate()); | 502 stream->SetDelegate(client_peer_->stream_delegate()); |
| 502 stream->Close(); | 503 stream->Close(); |
| 503 RunLoopWithTimeout(); | 504 RunLoopWithTimeout(); |
| 504 EXPECT_TRUE(client_peer_->IsClosedStream(id)); | 505 EXPECT_TRUE(client_peer_->IsClosedStream(id)); |
| 505 } | 506 } |
| 506 | 507 |
| 507 } // namespace | 508 } // namespace |
| 508 } // namespace test | 509 } // namespace test |
| 509 } // namespace net | 510 } // namespace net |
| OLD | NEW |