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

Unified Diff: device/serial/serial_connection_unittest.cc

Issue 646063003: Change data pipe wrappers used by SerialConnection to use message pipe. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
Index: device/serial/serial_connection_unittest.cc
diff --git a/device/serial/serial_connection_unittest.cc b/device/serial/serial_connection_unittest.cc
index b18e95eced9271906eb083f58cdf08f50d8cb3fd..33ee88f1e2c2cd12566023fb137f6b41496a0832 100644
--- a/device/serial/serial_connection_unittest.cc
+++ b/device/serial/serial_connection_unittest.cc
@@ -269,13 +269,18 @@ TEST_F(SerialConnectionTest, Flush) {
EXPECT_EQ(1, io_handler_->flushes());
}
-TEST_F(SerialConnectionTest, Disconnect) {
+TEST_F(SerialConnectionTest, DisconnectWithSend) {
connection_.reset();
io_handler_->set_send_callback(base::Bind(base::DoNothing));
ASSERT_NO_FATAL_FAILURE(Send("data"));
WaitForEvent(EVENT_SEND_ERROR);
EXPECT_EQ(serial::SEND_ERROR_DISCONNECTED, send_error_);
EXPECT_EQ(0, bytes_sent_);
+ EXPECT_TRUE(io_handler_->HasOneRef());
raymes 2014/10/17 02:11:10 Hmm, what does this check?
Sam McNally 2014/10/20 05:12:59 This checks that the connection object has actuall
+}
+
+TEST_F(SerialConnectionTest, DisconnectWithReceive) {
+ connection_.reset();
raymes 2014/10/17 02:11:10 And how come this is needed now?
Sam McNally 2014/10/20 05:12:59 Timing is different when data goes over the contro
ASSERT_NO_FATAL_FAILURE(Receive());
WaitForEvent(EVENT_RECEIVE_ERROR);
EXPECT_EQ(serial::RECEIVE_ERROR_DISCONNECTED, receive_error_);

Powered by Google App Engine
This is Rietveld 408576698