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

Unified Diff: device/serial/test_serial_io_handler.h

Issue 488363002: Implement the host side of serial connection I/O on data pipe. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix win x64 build Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/serial/serial_service_unittest.cc ('k') | device/serial/test_serial_io_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/serial/test_serial_io_handler.h
diff --git a/device/serial/test_serial_io_handler.h b/device/serial/test_serial_io_handler.h
index 7f0073c126e7b9d7fc91d7f969860d030250aafb..af62b586383d7769be23a6e47fbf6d1a419b86ce 100644
--- a/device/serial/test_serial_io_handler.h
+++ b/device/serial/test_serial_io_handler.h
@@ -40,6 +40,11 @@ class TestSerialIoHandler : public SerialIoHandler {
bool dtr() { return dtr_; }
bool rts() { return rts_; }
int flushes() { return flushes_; }
+ // This callback will be called when this IoHandler processes its next write,
+ // instead of the normal behavior of echoing the data to reads.
+ void set_send_callback(const base::Closure& callback) {
+ send_callback_ = callback;
+ }
protected:
virtual ~TestSerialIoHandler();
@@ -51,6 +56,8 @@ class TestSerialIoHandler : public SerialIoHandler {
bool dtr_;
bool rts_;
mutable int flushes_;
+ std::string buffer_;
+ base::Closure send_callback_;
DISALLOW_COPY_AND_ASSIGN(TestSerialIoHandler);
};
« no previous file with comments | « device/serial/serial_service_unittest.cc ('k') | device/serial/test_serial_io_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698