| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 #include <list> | 6 #include <list> |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 test.AddWriteData("world!"); | 548 test.AddWriteData("world!"); |
| 549 test.read_buffer_size = 2; | 549 test.read_buffer_size = 2; |
| 550 test.stream = bidirectional_stream_create(engine(), &test, test.callback()); | 550 test.stream = bidirectional_stream_create(engine(), &test, test.callback()); |
| 551 DCHECK(test.stream); | 551 DCHECK(test.stream); |
| 552 bidirectional_stream_delay_request_headers_until_flush(test.stream, | 552 bidirectional_stream_delay_request_headers_until_flush(test.stream, |
| 553 GetParam()); | 553 GetParam()); |
| 554 bidirectional_stream_start(test.stream, kTestServerUrl, 0, | 554 bidirectional_stream_start(test.stream, kTestServerUrl, 0, |
| 555 "POST", &kTestHeadersArray, false); | 555 "POST", &kTestHeadersArray, false); |
| 556 test.BlockForDone(); | 556 test.BlockForDone(); |
| 557 ASSERT_EQ(TestBidirectionalStreamCallback::ON_FAILED, test.response_step); | 557 ASSERT_EQ(TestBidirectionalStreamCallback::ON_FAILED, test.response_step); |
| 558 ASSERT_EQ(net::ERR_QUIC_PROTOCOL_ERROR, test.net_error); | 558 ASSERT_TRUE(test.net_error == net::ERR_QUIC_PROTOCOL_ERROR || |
| 559 test.net_error == net::ERR_CONNECTION_REFUSED); |
| 559 bidirectional_stream_destroy(test.stream); | 560 bidirectional_stream_destroy(test.stream); |
| 560 } | 561 } |
| 561 | 562 |
| 562 TEST_P(BidirectionalStreamTest, WriteFailsBeforeRequestStarted) { | 563 TEST_P(BidirectionalStreamTest, WriteFailsBeforeRequestStarted) { |
| 563 TestBidirectionalStreamCallback test; | 564 TestBidirectionalStreamCallback test; |
| 564 test.stream = bidirectional_stream_create(engine(), &test, test.callback()); | 565 test.stream = bidirectional_stream_create(engine(), &test, test.callback()); |
| 565 DCHECK(test.stream); | 566 DCHECK(test.stream); |
| 566 bidirectional_stream_delay_request_headers_until_flush(test.stream, | 567 bidirectional_stream_delay_request_headers_until_flush(test.stream, |
| 567 GetParam()); | 568 GetParam()); |
| 568 bidirectional_stream_write(test.stream, "1", 1, false); | 569 bidirectional_stream_write(test.stream, "1", 1, false); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 ASSERT_EQ(TestBidirectionalStreamCallback::ON_FAILED, test.response_step); | 648 ASSERT_EQ(TestBidirectionalStreamCallback::ON_FAILED, test.response_step); |
| 648 ASSERT_EQ(net::ERR_NAME_NOT_RESOLVED, test.net_error); | 649 ASSERT_EQ(net::ERR_NAME_NOT_RESOLVED, test.net_error); |
| 649 bidirectional_stream_destroy(test.stream); | 650 bidirectional_stream_destroy(test.stream); |
| 650 } | 651 } |
| 651 | 652 |
| 652 INSTANTIATE_TEST_CASE_P(BidirectionalStreamDelayRequestHeadersUntilFlush, | 653 INSTANTIATE_TEST_CASE_P(BidirectionalStreamDelayRequestHeadersUntilFlush, |
| 653 BidirectionalStreamTest, | 654 BidirectionalStreamTest, |
| 654 ::testing::Values(true, false)); | 655 ::testing::Values(true, false)); |
| 655 | 656 |
| 656 } // namespace grpc_support | 657 } // namespace grpc_support |
| OLD | NEW |