Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(153)

Side by Side Diff: components/cronet/ios/test/cronet_bidirectional_stream_test.mm

Issue 2369053002: [Cronet] Use WeakPtr in CronetBidirectionalStream on iOS. (Closed)
Patch Set: Remove build/config/sanitizers/BUILD.gn changes. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/cronet/ios/cronet_bidirectional_stream.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « components/cronet/ios/cronet_bidirectional_stream.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698