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 <stddef.h> | 5 #include <stddef.h> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
11 #include "base/synchronization/waitable_event.h" | 11 #include "base/synchronization/waitable_event.h" |
12 #include "base/threading/simple_thread.h" | 12 #include "base/threading/simple_thread.h" |
13 #include "net/base/ip_endpoint.h" | 13 #include "net/base/ip_endpoint.h" |
14 // TODO(rtenneti): Delete this when NSS is supported. | 14 // TODO(rtenneti): Delete this when NSS is supported. |
15 #include "net/quic/crypto/aes_128_gcm_encrypter.h" | 15 #include "net/quic/crypto/aes_128_gcm_encrypter.h" |
16 #include "net/quic/crypto/null_encrypter.h" | 16 #include "net/quic/crypto/null_encrypter.h" |
17 #include "net/quic/quic_framer.h" | 17 #include "net/quic/quic_framer.h" |
18 #include "net/quic/quic_packet_creator.h" | 18 #include "net/quic/quic_packet_creator.h" |
19 #include "net/quic/quic_protocol.h" | 19 #include "net/quic/quic_protocol.h" |
20 #include "net/quic/test_tools/quic_session_peer.h" | 20 #include "net/quic/test_tools/quic_session_peer.h" |
21 #include "net/quic/test_tools/reliable_quic_stream_peer.h" | 21 #include "net/quic/test_tools/reliable_quic_stream_peer.h" |
22 #include "net/tools/quic/quic_in_memory_cache.h" | 22 #include "net/tools/quic/quic_in_memory_cache.h" |
23 #include "net/tools/quic/quic_server.h" | 23 #include "net/tools/quic/quic_server.h" |
24 #include "net/tools/quic/test_tools/http_message_test_utils.h" | 24 #include "net/tools/quic/test_tools/http_message_test_utils.h" |
25 #include "net/tools/quic/test_tools/quic_test_client.h" | 25 #include "net/tools/quic/test_tools/quic_test_client.h" |
26 #include "testing/gtest/include/gtest/gtest.h" | 26 #include "testing/gtest/include/gtest/gtest.h" |
27 | 27 |
28 using base::StringPiece; | 28 using base::StringPiece; |
29 using base::WaitableEvent; | 29 using base::WaitableEvent; |
| 30 using net::test::QuicSessionPeer; |
| 31 using net::test::ReliableQuicStreamPeer; |
30 using std::string; | 32 using std::string; |
31 | 33 |
32 namespace net { | 34 namespace net { |
| 35 namespace tools { |
33 namespace test { | 36 namespace test { |
34 namespace { | 37 namespace { |
35 | 38 |
36 const char* kFooResponseBody = "Artichoke hearts make me happy."; | 39 const char* kFooResponseBody = "Artichoke hearts make me happy."; |
37 const char* kBarResponseBody = "Palm hearts are pretty delicious, also."; | 40 const char* kBarResponseBody = "Palm hearts are pretty delicious, also."; |
38 const size_t kCongestionFeedbackFrameSize = 25; | 41 const size_t kCongestionFeedbackFrameSize = 25; |
39 // If kCongestionFeedbackFrameSize increase we need to expand this string | 42 // If kCongestionFeedbackFrameSize increase we need to expand this string |
40 // accordingly. | 43 // accordingly. |
41 const char* kLargeRequest = | 44 const char* kLargeRequest = |
42 "https://www.google.com/foo/test/a/request/string/longer/than/25/bytes"; | 45 "https://www.google.com/foo/test/a/request/string/longer/than/25/bytes"; |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 | 516 |
514 EXPECT_EQ(kFooResponseBody, client_->SendSynchronousRequest("/foo")); | 517 EXPECT_EQ(kFooResponseBody, client_->SendSynchronousRequest("/foo")); |
515 EXPECT_EQ(200ul, client_->response_headers()->parsed_response_code()); | 518 EXPECT_EQ(200ul, client_->response_headers()->parsed_response_code()); |
516 client_->ResetConnection(); | 519 client_->ResetConnection(); |
517 EXPECT_EQ(kBarResponseBody, client_->SendSynchronousRequest("/bar")); | 520 EXPECT_EQ(kBarResponseBody, client_->SendSynchronousRequest("/bar")); |
518 EXPECT_EQ(200ul, client_->response_headers()->parsed_response_code()); | 521 EXPECT_EQ(200ul, client_->response_headers()->parsed_response_code()); |
519 } | 522 } |
520 | 523 |
521 } // namespace | 524 } // namespace |
522 } // namespace test | 525 } // namespace test |
| 526 } // namespace tools |
523 } // namespace net | 527 } // namespace net |
OLD | NEW |