OLD | NEW |
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 "device/serial/test_serial_io_handler.h" | 5 #include "device/serial/test_serial_io_handler.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
11 | 11 |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "device/serial/serial.mojom.h" | 13 #include "device/serial/serial.mojom.h" |
14 | 14 |
15 namespace device { | 15 namespace device { |
16 | 16 |
17 TestSerialIoHandler::TestSerialIoHandler() | 17 TestSerialIoHandler::TestSerialIoHandler() |
18 : SerialIoHandler(NULL, NULL), | 18 : SerialIoHandler(NULL), |
19 opened_(false), | 19 opened_(false), |
20 dtr_(false), | 20 dtr_(false), |
21 rts_(false), | 21 rts_(false), |
22 flushes_(0) { | 22 flushes_(0) {} |
23 } | |
24 | 23 |
25 scoped_refptr<SerialIoHandler> TestSerialIoHandler::Create() { | 24 scoped_refptr<SerialIoHandler> TestSerialIoHandler::Create() { |
26 return scoped_refptr<SerialIoHandler>(new TestSerialIoHandler); | 25 return scoped_refptr<SerialIoHandler>(new TestSerialIoHandler); |
27 } | 26 } |
28 | 27 |
29 void TestSerialIoHandler::Open(const std::string& port, | 28 void TestSerialIoHandler::Open(const std::string& port, |
30 const serial::ConnectionOptions& options, | 29 const serial::ConnectionOptions& options, |
31 const OpenCompleteCallback& callback) { | 30 const OpenCompleteCallback& callback) { |
32 DCHECK(!opened_); | 31 DCHECK(!opened_); |
33 opened_ = true; | 32 opened_ = true; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 } | 108 } |
110 | 109 |
111 bool TestSerialIoHandler::ClearBreak() { | 110 bool TestSerialIoHandler::ClearBreak() { |
112 return true; | 111 return true; |
113 } | 112 } |
114 | 113 |
115 TestSerialIoHandler::~TestSerialIoHandler() { | 114 TestSerialIoHandler::~TestSerialIoHandler() { |
116 } | 115 } |
117 | 116 |
118 } // namespace device | 117 } // namespace device |
OLD | NEW |