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

Side by Side Diff: remoting/base/buffered_socket_writer_unittest.cc

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU Created 4 years, 8 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 | « remoting/base/buffered_socket_writer.cc ('k') | remoting/base/chromium_url_request.h » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "remoting/base/buffered_socket_writer.h" 5 #include "remoting/base/buffered_socket_writer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 base::IgnoreResult(&BufferedSocketWriter::Write), 146 base::IgnoreResult(&BufferedSocketWriter::Write),
147 base::Unretained(writer_.get()), test_buffer_2_, 147 base::Unretained(writer_.get()), test_buffer_2_,
148 base::Closure())); 148 base::Closure()));
149 base::RunLoop().RunUntilIdle(); 149 base::RunLoop().RunUntilIdle();
150 VerifyWrittenData(); 150 VerifyWrittenData();
151 } 151 }
152 152
153 base::MessageLoop message_loop_; 153 base::MessageLoop message_loop_;
154 net::NetLog net_log_; 154 net::NetLog net_log_;
155 SocketDataProvider socket_data_provider_; 155 SocketDataProvider socket_data_provider_;
156 scoped_ptr<net::StreamSocket> socket_; 156 std::unique_ptr<net::StreamSocket> socket_;
157 scoped_ptr<BufferedSocketWriter> writer_; 157 std::unique_ptr<BufferedSocketWriter> writer_;
158 scoped_refptr<net::IOBufferWithSize> test_buffer_; 158 scoped_refptr<net::IOBufferWithSize> test_buffer_;
159 scoped_refptr<net::IOBufferWithSize> test_buffer_2_; 159 scoped_refptr<net::IOBufferWithSize> test_buffer_2_;
160 int write_error_; 160 int write_error_;
161 }; 161 };
162 162
163 // Test synchronous write. 163 // Test synchronous write.
164 TEST_F(BufferedSocketWriterTest, WriteFull) { 164 TEST_F(BufferedSocketWriterTest, WriteFull) {
165 StartWriter(); 165 StartWriter();
166 TestWrite(); 166 TestWrite();
167 } 167 }
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 writer_->Write(test_buffer_, base::Closure()); 251 writer_->Write(test_buffer_, base::Closure());
252 writer_->Write(test_buffer_2_, base::Closure()); 252 writer_->Write(test_buffer_2_, base::Closure());
253 253
254 StartWriter(); 254 StartWriter();
255 base::RunLoop().RunUntilIdle(); 255 base::RunLoop().RunUntilIdle();
256 256
257 VerifyWrittenData(); 257 VerifyWrittenData();
258 } 258 }
259 259
260 } // namespace remoting 260 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/base/buffered_socket_writer.cc ('k') | remoting/base/chromium_url_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698