OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 session_params.ssl_config_service = ssl_config_.get(); | 63 session_params.ssl_config_service = ssl_config_.get(); |
64 session_params.http_auth_handler_factory = auth_handler_factory_.get(); | 64 session_params.http_auth_handler_factory = auth_handler_factory_.get(); |
65 session_params.http_server_properties = &http_server_properties_; | 65 session_params.http_server_properties = &http_server_properties_; |
66 session_ = new HttpNetworkSession(session_params); | 66 session_ = new HttpNetworkSession(session_params); |
67 } | 67 } |
68 | 68 |
69 void AddExpectedConnection(MockRead* reads, size_t reads_count, | 69 void AddExpectedConnection(MockRead* reads, size_t reads_count, |
70 MockWrite* writes, size_t writes_count) { | 70 MockWrite* writes, size_t writes_count) { |
71 DeterministicSocketData* data = new DeterministicSocketData( | 71 DeterministicSocketData* data = new DeterministicSocketData( |
72 reads, reads_count, writes, writes_count); | 72 reads, reads_count, writes, writes_count); |
73 data->set_connect_data(MockConnect(false, 0)); | 73 data->set_connect_data(MockConnect(SYNCHRONOUS, OK)); |
74 if (reads_count || writes_count) { | 74 if (reads_count || writes_count) { |
75 data->StopAfter(reads_count + writes_count); | 75 data->StopAfter(reads_count + writes_count); |
76 } | 76 } |
77 factory_.AddSocketDataProvider(data); | 77 factory_.AddSocketDataProvider(data); |
78 data_vector_.push_back(data); | 78 data_vector_.push_back(data); |
79 } | 79 } |
80 | 80 |
81 const HttpRequestInfo* GetRequestInfo(const char* filename) { | 81 const HttpRequestInfo* GetRequestInfo(const char* filename) { |
82 std::string url = StringPrintf("http://localhost/%s", filename); | 82 std::string url = StringPrintf("http://localhost/%s", filename); |
83 HttpRequestInfo* request_info = new HttpRequestInfo; | 83 HttpRequestInfo* request_info = new HttpRequestInfo; |
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 | 735 |
736 EXPECT_EQ(OK, one_callback.WaitForResult()); | 736 EXPECT_EQ(OK, one_callback.WaitForResult()); |
737 ExpectResponse("one.html", one_transaction); | 737 ExpectResponse("one.html", one_transaction); |
738 EXPECT_EQ(OK, two_callback.WaitForResult()); | 738 EXPECT_EQ(OK, two_callback.WaitForResult()); |
739 ExpectResponse("two.html", two_transaction); | 739 ExpectResponse("two.html", two_transaction); |
740 } | 740 } |
741 | 741 |
742 } // anonymous namespace | 742 } // anonymous namespace |
743 | 743 |
744 } // namespace net | 744 } // namespace net |
OLD | NEW |