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

Side by Side Diff: net/quic/bidirectional_stream_quic_impl_unittest.cc

Issue 1825423003: Use scoped_ptr for MockUDPClientSocket in quic_http_stream_test.cc and bidirectional_stream_quic_im… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@log
Patch Set: Created 4 years, 9 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 | « no previous file | net/quic/quic_http_stream_test.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/quic/bidirectional_stream_quic_impl.h" 5 #include "net/quic/bidirectional_stream_quic_impl.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 mock_writes_[i] = MockWrite(writes_[i].mode, writes_[i].rv, i); 316 mock_writes_[i] = MockWrite(writes_[i].mode, writes_[i].rv, i);
317 } else { 317 } else {
318 mock_writes_[i] = MockWrite(writes_[i].mode, writes_[i].packet->data(), 318 mock_writes_[i] = MockWrite(writes_[i].mode, writes_[i].packet->data(),
319 writes_[i].packet->length()); 319 writes_[i].packet->length());
320 } 320 }
321 }; 321 };
322 322
323 socket_data_.reset(new StaticSocketDataProvider( 323 socket_data_.reset(new StaticSocketDataProvider(
324 nullptr, 0, mock_writes_.get(), writes_.size())); 324 nullptr, 0, mock_writes_.get(), writes_.size()));
325 325
326 MockUDPClientSocket* socket = new MockUDPClientSocket( 326 scoped_ptr<MockUDPClientSocket> socket(new MockUDPClientSocket(
327 socket_data_.get(), net_log().bound().net_log()); 327 socket_data_.get(), net_log().bound().net_log()));
328 socket->Connect(peer_addr_); 328 socket->Connect(peer_addr_);
329 runner_ = new TestTaskRunner(&clock_); 329 runner_ = new TestTaskRunner(&clock_);
330 helper_.reset(new QuicChromiumConnectionHelper(runner_.get(), &clock_, 330 helper_.reset(new QuicChromiumConnectionHelper(runner_.get(), &clock_,
331 &random_generator_)); 331 &random_generator_));
332 connection_ = new QuicConnection( 332 connection_ = new QuicConnection(
333 connection_id_, peer_addr_, helper_.get(), 333 connection_id_, peer_addr_, helper_.get(),
334 new QuicChromiumPacketWriter(socket), true /* owns_writer */, 334 new QuicChromiumPacketWriter(socket.get()), true /* owns_writer */,
335 Perspective::IS_CLIENT, SupportedVersions(GetParam())); 335 Perspective::IS_CLIENT, SupportedVersions(GetParam()));
336 336
337 session_.reset(new QuicChromiumClientSession( 337 session_.reset(new QuicChromiumClientSession(
338 connection_, scoped_ptr<DatagramClientSocket>(socket), 338 connection_, std::move(socket),
339 /*stream_factory=*/nullptr, &crypto_client_stream_factory_, &clock_, 339 /*stream_factory=*/nullptr, &crypto_client_stream_factory_, &clock_,
340 &transport_security_state_, make_scoped_ptr((QuicServerInfo*)nullptr), 340 &transport_security_state_, make_scoped_ptr((QuicServerInfo*)nullptr),
341 QuicServerId(kDefaultServerHostName, kDefaultServerPort, 341 QuicServerId(kDefaultServerHostName, kDefaultServerPort,
342 PRIVACY_MODE_DISABLED), 342 PRIVACY_MODE_DISABLED),
343 kQuicYieldAfterPacketsRead, 343 kQuicYieldAfterPacketsRead,
344 QuicTime::Delta::FromMilliseconds(kQuicYieldAfterDurationMilliseconds), 344 QuicTime::Delta::FromMilliseconds(kQuicYieldAfterDurationMilliseconds),
345 /*cert_verify_flags=*/0, DefaultQuicConfig(), &crypto_config_, 345 /*cert_verify_flags=*/0, DefaultQuicConfig(), &crypto_config_,
346 "CONNECTION_UNKNOWN", base::TimeTicks::Now(), &push_promise_index_, 346 "CONNECTION_UNKNOWN", base::TimeTicks::Now(), &push_promise_index_,
347 base::ThreadTaskRunnerHandle::Get().get(), 347 base::ThreadTaskRunnerHandle::Get().get(),
348 /*socket_performance_watcher=*/nullptr, net_log().bound().net_log())); 348 /*socket_performance_watcher=*/nullptr, net_log().bound().net_log()));
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after
1145 1145
1146 base::MessageLoop::current()->RunUntilIdle(); 1146 base::MessageLoop::current()->RunUntilIdle();
1147 1147
1148 EXPECT_EQ(1, delegate->on_data_read_count()); 1148 EXPECT_EQ(1, delegate->on_data_read_count());
1149 EXPECT_EQ(0, delegate->on_data_sent_count()); 1149 EXPECT_EQ(0, delegate->on_data_sent_count());
1150 } 1150 }
1151 1151
1152 } // namespace test 1152 } // namespace test
1153 1153
1154 } // namespace net 1154 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/quic/quic_http_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698