OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 } | 138 } |
139 | 139 |
140 void HttpBaseTest::VerifyHeaderComplete(size_t event_count, bool empty_doc) { | 140 void HttpBaseTest::VerifyHeaderComplete(size_t event_count, bool empty_doc) { |
141 LOG_F(LS_VERBOSE) << "Enter"; | 141 LOG_F(LS_VERBOSE) << "Enter"; |
142 | 142 |
143 ASSERT_EQ(event_count, events.size()); | 143 ASSERT_EQ(event_count, events.size()); |
144 EXPECT_EQ(E_HEADER_COMPLETE, events[0].event); | 144 EXPECT_EQ(E_HEADER_COMPLETE, events[0].event); |
145 | 145 |
146 std::string header; | 146 std::string header; |
147 EXPECT_EQ(HVER_1_1, data.version); | 147 EXPECT_EQ(HVER_1_1, data.version); |
148 EXPECT_EQ(static_cast<uint32>(HC_OK), data.scode); | 148 EXPECT_EQ(static_cast<uint32_t>(HC_OK), data.scode); |
149 EXPECT_TRUE(data.hasHeader(HH_PROXY_AUTHORIZATION, &header)); | 149 EXPECT_TRUE(data.hasHeader(HH_PROXY_AUTHORIZATION, &header)); |
150 EXPECT_EQ("42", header); | 150 EXPECT_EQ("42", header); |
151 EXPECT_TRUE(data.hasHeader(HH_CONNECTION, &header)); | 151 EXPECT_TRUE(data.hasHeader(HH_CONNECTION, &header)); |
152 EXPECT_EQ("Keep-Alive", header); | 152 EXPECT_EQ("Keep-Alive", header); |
153 | 153 |
154 if (empty_doc) { | 154 if (empty_doc) { |
155 EXPECT_FALSE(events[0].chunked); | 155 EXPECT_FALSE(events[0].chunked); |
156 EXPECT_EQ(0U, events[0].data_size); | 156 EXPECT_EQ(0U, events[0].data_size); |
157 | 157 |
158 EXPECT_TRUE(data.hasHeader(HH_CONTENT_LENGTH, &header)); | 158 EXPECT_TRUE(data.hasHeader(HH_CONTENT_LENGTH, &header)); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 | 208 |
209 void HttpBaseTest::VerifyDocumentStreamOpenEvent() { | 209 void HttpBaseTest::VerifyDocumentStreamOpenEvent() { |
210 LOG_F(LS_VERBOSE) << "Enter"; | 210 LOG_F(LS_VERBOSE) << "Enter"; |
211 | 211 |
212 ASSERT_TRUE(NULL != http_stream); | 212 ASSERT_TRUE(NULL != http_stream); |
213 EXPECT_EQ(SE_OPEN | SE_READ, sink.Events(http_stream)); | 213 EXPECT_EQ(SE_OPEN | SE_READ, sink.Events(http_stream)); |
214 EXPECT_EQ(SS_OPEN, http_stream->GetState()); | 214 EXPECT_EQ(SS_OPEN, http_stream->GetState()); |
215 | 215 |
216 // HTTP headers haven't arrived yet | 216 // HTTP headers haven't arrived yet |
217 EXPECT_EQ(0U, events.size()); | 217 EXPECT_EQ(0U, events.size()); |
218 EXPECT_EQ(static_cast<uint32>(HC_INTERNAL_SERVER_ERROR), data.scode); | 218 EXPECT_EQ(static_cast<uint32_t>(HC_INTERNAL_SERVER_ERROR), data.scode); |
219 LOG_F(LS_VERBOSE) << "Exit"; | 219 LOG_F(LS_VERBOSE) << "Exit"; |
220 } | 220 } |
221 | 221 |
222 void HttpBaseTest::ReadDocumentStreamData(const char* expected_data) { | 222 void HttpBaseTest::ReadDocumentStreamData(const char* expected_data) { |
223 LOG_F(LS_VERBOSE) << "Enter"; | 223 LOG_F(LS_VERBOSE) << "Enter"; |
224 | 224 |
225 ASSERT_TRUE(NULL != http_stream); | 225 ASSERT_TRUE(NULL != http_stream); |
226 EXPECT_EQ(SS_OPEN, http_stream->GetState()); | 226 EXPECT_EQ(SS_OPEN, http_stream->GetState()); |
227 | 227 |
228 // Pump the HTTP I/O using Read, and verify the results. | 228 // Pump the HTTP I/O using Read, and verify the results. |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 EXPECT_EQ(SR_ERROR, http_stream->Read(buffer, sizeof(buffer), NULL, &error)); | 514 EXPECT_EQ(SR_ERROR, http_stream->Read(buffer, sizeof(buffer), NULL, &error)); |
515 EXPECT_EQ(HE_DISCONNECTED, error); | 515 EXPECT_EQ(HE_DISCONNECTED, error); |
516 | 516 |
517 // Document completed with error | 517 // Document completed with error |
518 VerifyHeaderComplete(2, false); | 518 VerifyHeaderComplete(2, false); |
519 VerifyTransferComplete(HM_RECV, HE_DISCONNECTED); | 519 VerifyTransferComplete(HM_RECV, HE_DISCONNECTED); |
520 VerifyDocumentContents(""); | 520 VerifyDocumentContents(""); |
521 } | 521 } |
522 | 522 |
523 } // namespace rtc | 523 } // namespace rtc |
OLD | NEW |