OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "tools/battor_agent/battor_connection_impl.h" | 5 #include "tools/battor_agent/battor_connection_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "base/test/test_simple_task_runner.h" | 11 #include "base/test/test_simple_task_runner.h" |
12 #include "base/thread_task_runner_handle.h" | 12 #include "base/threading/thread_task_runner_handle.h" |
13 #include "device/serial/serial.mojom.h" | 13 #include "device/serial/serial.mojom.h" |
14 #include "device/serial/test_serial_io_handler.h" | 14 #include "device/serial/test_serial_io_handler.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 #include "tools/battor_agent/battor_protocol_types.h" | 16 #include "tools/battor_agent/battor_protocol_types.h" |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 void NullWriteCallback(int, device::serial::SendError) {} | 20 void NullWriteCallback(int, device::serial::SendError) {} |
21 void NullReadCallback(int, device::serial::ReceiveError) {} | 21 void NullReadCallback(int, device::serial::ReceiveError) {} |
22 | 22 |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 BATTOR_CONTROL_BYTE_END, | 389 BATTOR_CONTROL_BYTE_END, |
390 }; | 390 }; |
391 SendBytesRaw(data, 3); | 391 SendBytesRaw(data, 3); |
392 ReadMessage(BATTOR_MESSAGE_TYPE_PRINT); | 392 ReadMessage(BATTOR_MESSAGE_TYPE_PRINT); |
393 | 393 |
394 ASSERT_TRUE(IsReadComplete()); | 394 ASSERT_TRUE(IsReadComplete()); |
395 ASSERT_FALSE(GetReadSuccess()); | 395 ASSERT_FALSE(GetReadSuccess()); |
396 } | 396 } |
397 | 397 |
398 } // namespace battor | 398 } // namespace battor |
OLD | NEW |