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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/compiler_specific.h" | 6 #include "base/compiler_specific.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "net/base/mock_cert_verifier.h" | 8 #include "net/base/mock_cert_verifier.h" |
9 #include "net/base/mock_host_resolver.h" | 9 #include "net/base/mock_host_resolver.h" |
10 #include "net/base/ssl_config_service_defaults.h" | |
11 #include "net/base/test_completion_callback.h" | 10 #include "net/base/test_completion_callback.h" |
12 #include "net/http/http_auth_handler_factory.h" | 11 #include "net/http/http_auth_handler_factory.h" |
13 #include "net/http/http_network_session.h" | 12 #include "net/http/http_network_session.h" |
14 #include "net/http/http_network_transaction.h" | 13 #include "net/http/http_network_transaction.h" |
15 #include "net/http/http_server_properties_impl.h" | 14 #include "net/http/http_server_properties_impl.h" |
16 #include "net/http/http_stream.h" | 15 #include "net/http/http_stream.h" |
17 #include "net/http/http_stream_factory.h" | 16 #include "net/http/http_stream_factory.h" |
18 #include "net/http/http_transaction_unittest.h" | 17 #include "net/http/http_transaction_unittest.h" |
19 #include "net/proxy/proxy_config_service_fixed.h" | 18 #include "net/proxy/proxy_config_service_fixed.h" |
20 #include "net/proxy/proxy_resolver.h" | 19 #include "net/proxy/proxy_resolver.h" |
21 #include "net/proxy/proxy_service.h" | 20 #include "net/proxy/proxy_service.h" |
22 #include "net/quic/crypto/quic_decrypter.h" | 21 #include "net/quic/crypto/quic_decrypter.h" |
23 #include "net/quic/crypto/quic_encrypter.h" | 22 #include "net/quic/crypto/quic_encrypter.h" |
24 #include "net/quic/quic_framer.h" | 23 #include "net/quic/quic_framer.h" |
25 #include "net/quic/test_tools/crypto_test_utils.h" | 24 #include "net/quic/test_tools/crypto_test_utils.h" |
26 #include "net/quic/test_tools/mock_clock.h" | 25 #include "net/quic/test_tools/mock_clock.h" |
27 #include "net/quic/test_tools/mock_random.h" | 26 #include "net/quic/test_tools/mock_random.h" |
28 #include "net/quic/test_tools/quic_test_utils.h" | 27 #include "net/quic/test_tools/quic_test_utils.h" |
29 #include "net/socket/client_socket_factory.h" | 28 #include "net/socket/client_socket_factory.h" |
30 #include "net/socket/mock_client_socket_pool_manager.h" | 29 #include "net/socket/mock_client_socket_pool_manager.h" |
31 #include "net/socket/socket_test_util.h" | 30 #include "net/socket/socket_test_util.h" |
32 #include "net/socket/ssl_client_socket.h" | 31 #include "net/socket/ssl_client_socket.h" |
33 #include "net/spdy/spdy_frame_builder.h" | 32 #include "net/spdy/spdy_frame_builder.h" |
34 #include "net/spdy/spdy_framer.h" | 33 #include "net/spdy/spdy_framer.h" |
| 34 #include "net/ssl/ssl_config_service_defaults.h" |
35 #include "testing/gtest/include/gtest/gtest.h" | 35 #include "testing/gtest/include/gtest/gtest.h" |
36 #include "testing/platform_test.h" | 36 #include "testing/platform_test.h" |
37 | 37 |
38 //----------------------------------------------------------------------------- | 38 //----------------------------------------------------------------------------- |
39 | 39 |
40 namespace { | 40 namespace { |
41 | 41 |
42 // This is the expected return from a current server advertising QUIC. | 42 // This is the expected return from a current server advertising QUIC. |
43 static const char kQuicAlternateProtocolHttpHeader[] = | 43 static const char kQuicAlternateProtocolHttpHeader[] = |
44 "Alternate-Protocol: 443:quic/1\r\n\r\n"; | 44 "Alternate-Protocol: 443:quic/1\r\n\r\n"; |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 ASSERT_TRUE(response->headers != NULL); | 447 ASSERT_TRUE(response->headers != NULL); |
448 EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); | 448 EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); |
449 EXPECT_TRUE(response->was_fetched_via_spdy); | 449 EXPECT_TRUE(response->was_fetched_via_spdy); |
450 | 450 |
451 ASSERT_EQ(OK, ReadTransaction(trans.get(), &response_data)); | 451 ASSERT_EQ(OK, ReadTransaction(trans.get(), &response_data)); |
452 EXPECT_EQ("hello!", response_data); | 452 EXPECT_EQ("hello!", response_data); |
453 } | 453 } |
454 | 454 |
455 } // namespace test | 455 } // namespace test |
456 } // namespace net | 456 } // namespace net |
OLD | NEW |