| 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 "chrome/browser/extensions/extension_apitest.h" | 5 #include "chrome/browser/extensions/extension_apitest.h" |
| 6 #include "content/public/browser/browser_thread.h" | 6 #include "content/public/browser/browser_thread.h" |
| 7 #include "content/public/test/test_utils.h" | 7 #include "content/public/test/test_utils.h" |
| 8 #include "device/usb/usb_service.h" | 8 #include "device/usb/usb_service.h" |
| 9 #include "extensions/browser/api/device_permissions_prompt.h" | 9 #include "extensions/browser/api/device_permissions_prompt.h" |
| 10 #include "extensions/browser/api/usb/usb_api.h" | 10 #include "extensions/browser/api/usb/usb_api.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 MOCK_METHOD2(SetConfiguration, | 123 MOCK_METHOD2(SetConfiguration, |
| 124 void(int configuration_value, const ResultCallback& callback)); | 124 void(int configuration_value, const ResultCallback& callback)); |
| 125 MOCK_METHOD2(ClaimInterface, | 125 MOCK_METHOD2(ClaimInterface, |
| 126 void(int interface_number, const ResultCallback& callback)); | 126 void(int interface_number, const ResultCallback& callback)); |
| 127 MOCK_METHOD1(ReleaseInterface, bool(int interface_number)); | 127 MOCK_METHOD1(ReleaseInterface, bool(int interface_number)); |
| 128 MOCK_METHOD3(SetInterfaceAlternateSetting, | 128 MOCK_METHOD3(SetInterfaceAlternateSetting, |
| 129 void(int interface_number, | 129 void(int interface_number, |
| 130 int alternate_setting, | 130 int alternate_setting, |
| 131 const ResultCallback& callback)); | 131 const ResultCallback& callback)); |
| 132 | 132 |
| 133 virtual scoped_refptr<UsbDevice> GetDevice() const override { | 133 scoped_refptr<UsbDevice> GetDevice() const override { return device_; } |
| 134 return device_; | |
| 135 } | |
| 136 | 134 |
| 137 void set_device(UsbDevice* device) { device_ = device; } | 135 void set_device(UsbDevice* device) { device_ = device; } |
| 138 | 136 |
| 139 protected: | 137 protected: |
| 140 UsbDevice* device_; | 138 UsbDevice* device_; |
| 141 | 139 |
| 142 virtual ~MockUsbDeviceHandle() {} | 140 virtual ~MockUsbDeviceHandle() {} |
| 143 }; | 141 }; |
| 144 | 142 |
| 145 class MockUsbDevice : public UsbDevice { | 143 class MockUsbDevice : public UsbDevice { |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 | 334 |
| 337 TestExtensionsAPIClient test_api_client; | 335 TestExtensionsAPIClient test_api_client; |
| 338 ASSERT_TRUE(LoadApp("api_test/usb/get_user_selected_devices")); | 336 ASSERT_TRUE(LoadApp("api_test/usb/get_user_selected_devices")); |
| 339 ASSERT_TRUE(ready_listener.WaitUntilSatisfied()); | 337 ASSERT_TRUE(ready_listener.WaitUntilSatisfied()); |
| 340 | 338 |
| 341 mock_service_->NotifyDeviceRemoved(mock_device_); | 339 mock_service_->NotifyDeviceRemoved(mock_device_); |
| 342 ASSERT_TRUE(result_listener.WaitUntilSatisfied()); | 340 ASSERT_TRUE(result_listener.WaitUntilSatisfied()); |
| 343 } | 341 } |
| 344 | 342 |
| 345 } // namespace extensions | 343 } // namespace extensions |
| OLD | NEW |