| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "components/grpc_support/test/quic_test_server.h" | 5 #include "components/grpc_support/test/quic_test_server.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 11 #include "base/files/file_util.h" | 11 #include "base/files/file_util.h" |
| 12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
| 14 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
| 15 #include "base/synchronization/waitable_event.h" | 15 #include "base/synchronization/waitable_event.h" |
| 16 #include "base/threading/thread.h" | 16 #include "base/threading/thread.h" |
| 17 #include "net/base/ip_address.h" | 17 #include "net/base/ip_address.h" |
| 18 #include "net/base/ip_endpoint.h" | 18 #include "net/base/ip_endpoint.h" |
| 19 #include "net/quic/chromium/crypto/proof_source_chromium.h" | 19 #include "net/quic/chromium/crypto/proof_source_chromium.h" |
| 20 #include "net/spdy/core/spdy_header_block.h" | 20 #include "net/spdy/core/spdy_header_block.h" |
| 21 #include "net/test/test_data_directory.h" | 21 #include "net/test/test_data_directory.h" |
| 22 #include "net/tools/quic/quic_http_response_cache.h" | 22 #include "net/tools/quic/quic_http_response_cache.h" |
| 23 #include "net/tools/quic/quic_simple_server.h" | 23 #include "net/tools/quic/quic_simple_server.h" |
| 24 | 24 |
| 25 namespace grpc_support { | 25 namespace grpc_support { |
| 26 | 26 |
| 27 const char kTestServerDomain[] = "example.com"; |
| 27 // This must match the certificate used (quic_test.example.com.crt and | 28 // This must match the certificate used (quic_test.example.com.crt and |
| 28 // quic_test.example.com.key.pkcs8). | 29 // quic_test.example.com.key.pkcs8). |
| 29 const char kTestServerHost[] = "test.example.com"; | 30 const char kTestServerHost[] = "test.example.com"; |
| 30 const char kTestServerUrl[] = "https://test.example.com/hello.txt"; | 31 const char kTestServerUrl[] = "https://test.example.com/hello.txt"; |
| 31 | 32 |
| 32 const char kStatusHeader[] = ":status"; | 33 const char kStatusHeader[] = ":status"; |
| 33 | 34 |
| 34 const char kHelloPath[] = "/hello.txt"; | 35 const char kHelloPath[] = "/hello.txt"; |
| 35 const char kHelloBodyValue[] = "Hello from QUIC Server"; | 36 const char kHelloBodyValue[] = "Hello from QUIC Server"; |
| 36 const char kHelloStatus[] = "200"; | 37 const char kHelloStatus[] = "200"; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 server_stopped_event.Wait(); | 144 server_stopped_event.Wait(); |
| 144 delete g_quic_server_thread; | 145 delete g_quic_server_thread; |
| 145 g_quic_server_thread = nullptr; | 146 g_quic_server_thread = nullptr; |
| 146 } | 147 } |
| 147 | 148 |
| 148 int GetQuicTestServerPort() { | 149 int GetQuicTestServerPort() { |
| 149 return g_quic_server_port; | 150 return g_quic_server_port; |
| 150 } | 151 } |
| 151 | 152 |
| 152 } // namespace grpc_support | 153 } // namespace grpc_support |
| OLD | NEW |