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

Side by Side Diff: net/spdy/bidirectional_stream_spdy_impl_unittest.cc

Issue 2259823002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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 | « net/socket/fuzzed_socket_factory.cc ('k') | net/spdy/spdy_network_transaction_unittest.cc » ('j') | 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 #include "net/spdy/bidirectional_stream_spdy_impl.h" 5 #include "net/spdy/bidirectional_stream_spdy_impl.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 error_ = error; 106 error_ = error;
107 on_failed_called_ = true; 107 on_failed_called_ = true;
108 if (run_until_completion_) 108 if (run_until_completion_)
109 loop_->Quit(); 109 loop_->Quit();
110 } 110 }
111 111
112 void Start(const BidirectionalStreamRequestInfo* request, 112 void Start(const BidirectionalStreamRequestInfo* request,
113 const BoundNetLog& net_log) { 113 const BoundNetLog& net_log) {
114 stream_->Start(request, net_log, 114 stream_->Start(request, net_log,
115 /*send_request_headers_automatically=*/false, this, 115 /*send_request_headers_automatically=*/false, this,
116 base::WrapUnique(new base::Timer(false, false))); 116 base::MakeUnique<base::Timer>(false, false));
117 not_expect_callback_ = false; 117 not_expect_callback_ = false;
118 } 118 }
119 119
120 void SendData(IOBuffer* data, int length, bool end_of_stream) { 120 void SendData(IOBuffer* data, int length, bool end_of_stream) {
121 not_expect_callback_ = true; 121 not_expect_callback_ = true;
122 stream_->SendData(data, length, end_of_stream); 122 stream_->SendData(data, length, end_of_stream);
123 not_expect_callback_ = false; 123 not_expect_callback_ = false;
124 } 124 }
125 125
126 void SendvData(const std::vector<scoped_refptr<IOBuffer>>& data, 126 void SendvData(const std::vector<scoped_refptr<IOBuffer>>& data,
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 EXPECT_EQ(0, delegate->on_data_sent_count()); 307 EXPECT_EQ(0, delegate->on_data_sent_count());
308 EXPECT_EQ(kProtoHTTP2, delegate->GetProtocol()); 308 EXPECT_EQ(kProtoHTTP2, delegate->GetProtocol());
309 // BidirectionalStreamSpdyStreamJob does not count the bytes sent for |rst| 309 // BidirectionalStreamSpdyStreamJob does not count the bytes sent for |rst|
310 // because it is sent after SpdyStream::Delegate::OnClose is called. 310 // because it is sent after SpdyStream::Delegate::OnClose is called.
311 EXPECT_EQ(CountWriteBytes(writes, 1), delegate->GetTotalSentBytes()); 311 EXPECT_EQ(CountWriteBytes(writes, 1), delegate->GetTotalSentBytes());
312 EXPECT_EQ(CountReadBytes(reads, arraysize(reads)), 312 EXPECT_EQ(CountReadBytes(reads, arraysize(reads)),
313 delegate->GetTotalReceivedBytes()); 313 delegate->GetTotalReceivedBytes());
314 } 314 }
315 315
316 } // namespace net 316 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/fuzzed_socket_factory.cc ('k') | net/spdy/spdy_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698