OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "base/strings/string_piece.h" | 8 #include "base/strings/string_piece.h" |
9 #include "device/serial/data_sender.h" | 9 #include "device/serial/data_sender.h" |
10 #include "device/serial/data_sink_receiver.h" | 10 #include "device/serial/data_sink_receiver.h" |
11 #include "device/serial/data_stream.mojom.h" | 11 #include "device/serial/data_stream.mojom.h" |
| 12 #include "mojo/public/cpp/bindings/interface_ptr.h" |
| 13 #include "mojo/public/cpp/environment/async_waiter.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
13 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_ptr.h" | |
14 #include "third_party/mojo/src/mojo/public/cpp/environment/async_waiter.h" | |
15 | 15 |
16 namespace device { | 16 namespace device { |
17 | 17 |
18 class DataSinkTest : public testing::Test { | 18 class DataSinkTest : public testing::Test { |
19 public: | 19 public: |
20 enum Event { | 20 enum Event { |
21 EVENT_NONE, | 21 EVENT_NONE, |
22 EVENT_READ_BUFFER_READY, | 22 EVENT_READ_BUFFER_READY, |
23 EVENT_CANCEL_RECEIVED, | 23 EVENT_CANCEL_RECEIVED, |
24 EVENT_SEND_SUCCESS, | 24 EVENT_SEND_SUCCESS, |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 sender_.reset(); | 403 sender_.reset(); |
404 ExpectSendError(0, kFatalError); | 404 ExpectSendError(0, kFatalError); |
405 ExpectSendError(0, kFatalError); | 405 ExpectSendError(0, kFatalError); |
406 ExpectCancelResult(); | 406 ExpectCancelResult(); |
407 if (!seen_connection_error_) | 407 if (!seen_connection_error_) |
408 WaitForEvent(EVENT_ERROR); | 408 WaitForEvent(EVENT_ERROR); |
409 EXPECT_TRUE(seen_connection_error_); | 409 EXPECT_TRUE(seen_connection_error_); |
410 } | 410 } |
411 | 411 |
412 } // namespace device | 412 } // namespace device |
OLD | NEW |