Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Unified Diff: extensions/browser/api/usb/usb_apitest.cc

Issue 1034333002: Check USB device path access when prompting users to select a device. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move MockPermissionBrokerClient into its own header. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/browser/api/usb/usb_api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/usb/usb_apitest.cc
diff --git a/extensions/browser/api/usb/usb_apitest.cc b/extensions/browser/api/usb/usb_apitest.cc
index 2bf42caea3cc06823755dca97c59f5339f9bf323..ad36408d0bc32dc9771517a7033f9c2c3268d139 100644
--- a/extensions/browser/api/usb/usb_apitest.cc
+++ b/extensions/browser/api/usb/usb_apitest.cc
@@ -39,11 +39,6 @@ ACTION_TEMPLATE(InvokeUsbTransferCallback,
::std::tr1::get<k>(args).Run(p1, io_buffer, 1);
}
-void RequestUsbAccess(int interface_id,
- const base::Callback<void(bool success)>& callback) {
- base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(callback, true));
-}
-
class TestDevicePermissionsPrompt
: public DevicePermissionsPrompt,
public DevicePermissionsPrompt::Prompt::Observer {
@@ -145,7 +140,6 @@ class MockUsbDevice : public UsbDevice {
MockUsbDevice(uint16 vendor_id, uint16 product_id, uint32 unique_id)
: UsbDevice(vendor_id, product_id, unique_id) {}
- MOCK_METHOD2(RequestUsbAccess, void(int, const base::Callback<void(bool)>&));
MOCK_METHOD0(Open, scoped_refptr<UsbDeviceHandle>());
MOCK_METHOD1(Close, bool(scoped_refptr<UsbDeviceHandle>));
MOCK_METHOD0(GetConfiguration, const device::UsbConfigDescriptor*());
@@ -200,8 +194,6 @@ class UsbApiTest : public ShellApiTest {
mock_device_handle_ = new MockUsbDeviceHandle();
mock_device_handle_->set_device(mock_device_.get());
- EXPECT_CALL(*mock_device_.get(), RequestUsbAccess(_, _))
- .WillRepeatedly(Invoke(RequestUsbAccess));
EXPECT_CALL(*mock_device_.get(), Open())
.WillRepeatedly(Return(mock_device_handle_));
« no previous file with comments | « extensions/browser/api/usb/usb_api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698