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

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: fix win x64 compile 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 4b69158ebf95a3c3c8a8f1235b98b7ac86ed182e..a84c9e4e088bd066347e8d1678f0c5f3923968b6 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());
+}
+
+TEST_F(SerialConnectionTest, DisconnectWithReceive) {
+ connection_.reset();
ASSERT_NO_FATAL_FAILURE(Receive());
WaitForEvent(EVENT_RECEIVE_ERROR);
EXPECT_EQ(serial::RECEIVE_ERROR_DISCONNECTED, receive_error_);
« no previous file with comments | « device/serial/data_stream_serialization.mojom ('k') | extensions/renderer/api/serial/data_receiver_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698