Chromium Code Reviews| 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_); |