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

Side by Side Diff: device/serial/serial_connection_unittest.cc

Issue 507053002: Remove implicit conversions from scoped_refptr to T* in device/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Regenerate Created 6 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 | « device/serial/serial_connection_factory.cc ('k') | device/serial/serial_io_handler.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <string> 5 #include <string>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/strings/string_piece.h" 10 #include "base/strings/string_piece.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 mojo::Get(&consumer), 82 mojo::Get(&consumer),
83 mojo::Get(&producer)); 83 mojo::Get(&producer));
84 sender_.reset(new DataSender( 84 sender_.reset(new DataSender(
85 consumer.Pass(), kBufferSize, serial::SEND_ERROR_DISCONNECTED)); 85 consumer.Pass(), kBufferSize, serial::SEND_ERROR_DISCONNECTED));
86 receiver_ = new DataReceiver( 86 receiver_ = new DataReceiver(
87 producer.Pass(), kBufferSize, serial::RECEIVE_ERROR_DISCONNECTED); 87 producer.Pass(), kBufferSize, serial::RECEIVE_ERROR_DISCONNECTED);
88 connection_.set_error_handler(this); 88 connection_.set_error_handler(this);
89 connection_->GetInfo( 89 connection_->GetInfo(
90 base::Bind(&SerialConnectionTest::StoreInfo, base::Unretained(this))); 90 base::Bind(&SerialConnectionTest::StoreInfo, base::Unretained(this)));
91 WaitForEvent(EVENT_GOT_INFO); 91 WaitForEvent(EVENT_GOT_INFO);
92 ASSERT_TRUE(io_handler_); 92 ASSERT_TRUE(io_handler_.get());
93 } 93 }
94 94
95 void StoreInfo(serial::ConnectionInfoPtr options) { 95 void StoreInfo(serial::ConnectionInfoPtr options) {
96 info_ = options.Pass(); 96 info_ = options.Pass();
97 EventReceived(EVENT_GOT_INFO); 97 EventReceived(EVENT_GOT_INFO);
98 } 98 }
99 99
100 void StoreControlSignals(serial::DeviceControlSignalsPtr signals) { 100 void StoreControlSignals(serial::DeviceControlSignalsPtr signals) {
101 signals_ = signals.Pass(); 101 signals_ = signals.Pass();
102 EventReceived(EVENT_GOT_CONTROL_SIGNALS); 102 EventReceived(EVENT_GOT_CONTROL_SIGNALS);
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 WaitForEvent(EVENT_DATA_SENT); 318 WaitForEvent(EVENT_DATA_SENT);
319 EXPECT_EQ(serial::SEND_ERROR_NONE, send_error_); 319 EXPECT_EQ(serial::SEND_ERROR_NONE, send_error_);
320 EXPECT_EQ(4, bytes_sent_); 320 EXPECT_EQ(4, bytes_sent_);
321 ASSERT_NO_FATAL_FAILURE(Receive()); 321 ASSERT_NO_FATAL_FAILURE(Receive());
322 WaitForEvent(EVENT_DATA_RECEIVED); 322 WaitForEvent(EVENT_DATA_RECEIVED);
323 EXPECT_EQ("data", data_received_); 323 EXPECT_EQ("data", data_received_);
324 EXPECT_EQ(serial::RECEIVE_ERROR_NONE, receive_error_); 324 EXPECT_EQ(serial::RECEIVE_ERROR_NONE, receive_error_);
325 } 325 }
326 326
327 } // namespace device 327 } // namespace device
OLDNEW
« no previous file with comments | « device/serial/serial_connection_factory.cc ('k') | device/serial/serial_io_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698