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 #import <Foundation/Foundation.h> | 5 #import <Foundation/Foundation.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 #include <list> | 7 #include <list> |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 virtual bool MaybeCancel(cronet_bidirectional_stream* stream, | 160 virtual bool MaybeCancel(cronet_bidirectional_stream* stream, |
161 ResponseStep step) { | 161 ResponseStep step) { |
162 DCHECK_EQ(stream, this->stream); | 162 DCHECK_EQ(stream, this->stream); |
163 response_step = step; | 163 response_step = step; |
164 DLOG(WARNING) << "Step: " << step; | 164 DLOG(WARNING) << "Step: " << step; |
165 | 165 |
166 if (step != cancel_from_step) | 166 if (step != cancel_from_step) |
167 return false; | 167 return false; |
168 | 168 |
169 cronet_bidirectional_stream_cancel(stream); | 169 cronet_bidirectional_stream_cancel(stream); |
| 170 cronet_bidirectional_stream_write(stream, "abc", 3, false); |
| 171 |
170 return true; | 172 return true; |
171 } | 173 } |
172 | 174 |
173 void SignalDone() { stream_done_event.Signal(); } | 175 void SignalDone() { stream_done_event.Signal(); } |
174 | 176 |
175 void BlockForDone() { stream_done_event.Wait(); } | 177 void BlockForDone() { stream_done_event.Wait(); } |
176 | 178 |
177 void AddWriteData(const std::string& data) { AddWriteData(data, true); } | 179 void AddWriteData(const std::string& data) { AddWriteData(data, true); } |
178 void AddWriteData(const std::string& data, bool flush) { | 180 void AddWriteData(const std::string& data, bool flush) { |
179 write_data.push_back(base::MakeUnique<WriteData>(data, flush)); | 181 write_data.push_back(base::MakeUnique<WriteData>(data, flush)); |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 ASSERT_EQ(TestBidirectionalStreamCallback::ON_FAILED, test.response_step); | 678 ASSERT_EQ(TestBidirectionalStreamCallback::ON_FAILED, test.response_step); |
677 ASSERT_EQ(net::ERR_NAME_NOT_RESOLVED, test.net_error); | 679 ASSERT_EQ(net::ERR_NAME_NOT_RESOLVED, test.net_error); |
678 cronet_bidirectional_stream_destroy(test.stream); | 680 cronet_bidirectional_stream_destroy(test.stream); |
679 } | 681 } |
680 | 682 |
681 INSTANTIATE_TEST_CASE_P(CronetBidirectionalStreamDelayRequestHeadersUntilFlush, | 683 INSTANTIATE_TEST_CASE_P(CronetBidirectionalStreamDelayRequestHeadersUntilFlush, |
682 CronetBidirectionalStreamTest, | 684 CronetBidirectionalStreamTest, |
683 ::testing::Values(true, false)); | 685 ::testing::Values(true, false)); |
684 | 686 |
685 } // namespace cronet | 687 } // namespace cronet |
OLD | NEW |