| 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 "device/usb/mojo/device_impl.h" | 5 #include "device/usb/mojo/device_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 149 |
| 150 class USBDeviceImplTest : public testing::Test { | 150 class USBDeviceImplTest : public testing::Test { |
| 151 public: | 151 public: |
| 152 USBDeviceImplTest() | 152 USBDeviceImplTest() |
| 153 : message_loop_(new base::MessageLoop), | 153 : message_loop_(new base::MessageLoop), |
| 154 is_device_open_(false), | 154 is_device_open_(false), |
| 155 allow_reset_(false) {} | 155 allow_reset_(false) {} |
| 156 | 156 |
| 157 ~USBDeviceImplTest() override {} | 157 ~USBDeviceImplTest() override {} |
| 158 | 158 |
| 159 void TearDown() override { base::RunLoop().RunUntilIdle(); } |
| 160 |
| 159 protected: | 161 protected: |
| 160 MockPermissionProvider& permission_provider() { return permission_provider_; } | 162 MockPermissionProvider& permission_provider() { return permission_provider_; } |
| 161 MockUsbDevice& mock_device() { return *mock_device_.get(); } | 163 MockUsbDevice& mock_device() { return *mock_device_.get(); } |
| 162 bool is_device_open() const { return is_device_open_; } | 164 bool is_device_open() const { return is_device_open_; } |
| 163 MockUsbDeviceHandle& mock_handle() { return *mock_handle_.get(); } | 165 MockUsbDeviceHandle& mock_handle() { return *mock_handle_.get(); } |
| 164 | 166 |
| 165 void set_allow_reset(bool allow_reset) { allow_reset_ = allow_reset; } | 167 void set_allow_reset(bool allow_reset) { allow_reset_ = allow_reset; } |
| 166 | 168 |
| 167 // Creates a mock device and binds a Device proxy to a Device service impl | 169 // Creates a mock device and binds a Device proxy to a Device service impl |
| 168 // wrapping the mock device. | 170 // wrapping the mock device. |
| (...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 895 base::Bind(&ExpectPacketsInAndThen, fake_inbound_data, | 897 base::Bind(&ExpectPacketsInAndThen, fake_inbound_data, |
| 896 expected_transferred_lengths, loop.QuitClosure())); | 898 expected_transferred_lengths, loop.QuitClosure())); |
| 897 loop.Run(); | 899 loop.Run(); |
| 898 } | 900 } |
| 899 | 901 |
| 900 EXPECT_CALL(mock_handle(), Close()); | 902 EXPECT_CALL(mock_handle(), Close()); |
| 901 } | 903 } |
| 902 | 904 |
| 903 } // namespace usb | 905 } // namespace usb |
| 904 } // namespace device | 906 } // namespace device |
| OLD | NEW |