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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 mock_device_ = | 174 mock_device_ = |
175 new MockUsbDevice(vendor_id, product_id, manufacturer, product, serial); | 175 new MockUsbDevice(vendor_id, product_id, manufacturer, product, serial); |
176 mock_handle_ = new MockUsbDeviceHandle(mock_device_.get()); | 176 mock_handle_ = new MockUsbDeviceHandle(mock_device_.get()); |
177 | 177 |
178 DevicePtr proxy; | 178 DevicePtr proxy; |
179 | 179 |
180 // Owns itself. | 180 // Owns itself. |
181 new DeviceImpl( | 181 new DeviceImpl( |
182 mock_device_, | 182 mock_device_, |
183 DeviceInfo::From(static_cast<const UsbDevice&>(*mock_device_)), | 183 DeviceInfo::From(static_cast<const UsbDevice&>(*mock_device_)), |
184 permission_provider_.GetWeakPtr(), mojo::GetProxy(&proxy)); | 184 permission_provider_.GetWeakPtr(), mojo::MakeRequest(&proxy)); |
185 | 185 |
186 // Set up mock handle calls to respond based on mock device configs | 186 // Set up mock handle calls to respond based on mock device configs |
187 // established by the test. | 187 // established by the test. |
188 ON_CALL(mock_device(), Open(_)) | 188 ON_CALL(mock_device(), Open(_)) |
189 .WillByDefault(Invoke(this, &USBDeviceImplTest::OpenMockHandle)); | 189 .WillByDefault(Invoke(this, &USBDeviceImplTest::OpenMockHandle)); |
190 ON_CALL(mock_handle(), Close()) | 190 ON_CALL(mock_handle(), Close()) |
191 .WillByDefault(Invoke(this, &USBDeviceImplTest::CloseMockHandle)); | 191 .WillByDefault(Invoke(this, &USBDeviceImplTest::CloseMockHandle)); |
192 ON_CALL(mock_handle(), SetConfiguration(_, _)) | 192 ON_CALL(mock_handle(), SetConfiguration(_, _)) |
193 .WillByDefault(Invoke(this, &USBDeviceImplTest::SetConfiguration)); | 193 .WillByDefault(Invoke(this, &USBDeviceImplTest::SetConfiguration)); |
194 ON_CALL(mock_handle(), ClaimInterface(_, _)) | 194 ON_CALL(mock_handle(), ClaimInterface(_, _)) |
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
895 base::Bind(&ExpectPacketsInAndThen, fake_inbound_data, | 895 base::Bind(&ExpectPacketsInAndThen, fake_inbound_data, |
896 expected_transferred_lengths, loop.QuitClosure())); | 896 expected_transferred_lengths, loop.QuitClosure())); |
897 loop.Run(); | 897 loop.Run(); |
898 } | 898 } |
899 | 899 |
900 EXPECT_CALL(mock_handle(), Close()); | 900 EXPECT_CALL(mock_handle(), Close()); |
901 } | 901 } |
902 | 902 |
903 } // namespace usb | 903 } // namespace usb |
904 } // namespace device | 904 } // namespace device |
OLD | NEW |