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

Unified Diff: device/usb/mojo/device_impl_unittest.cc

Issue 1693433003: webusb: Reject the promise if the device is already open. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « device/usb/mojo/device_impl.cc ('k') | device/usb/public/interfaces/device.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/usb/mojo/device_impl_unittest.cc
diff --git a/device/usb/mojo/device_impl_unittest.cc b/device/usb/mojo/device_impl_unittest.cc
index 626edd912491860d08106218b927ce0e0c5eeea2..c6c2e495053e8461831093d9a0242b9811d83f2e 100644
--- a/device/usb/mojo/device_impl_unittest.cc
+++ b/device/usb/mojo/device_impl_unittest.cc
@@ -459,10 +459,19 @@ TEST_F(USBDeviceImplTest, Open) {
EXPECT_CALL(mock_device(), Open(_));
- base::RunLoop loop;
- device->Open(
- base::Bind(&ExpectOpenAndThen, OpenDeviceError::OK, loop.QuitClosure()));
- loop.Run();
+ {
+ base::RunLoop loop;
+ device->Open(base::Bind(&ExpectOpenAndThen, OpenDeviceError::OK,
+ loop.QuitClosure()));
+ loop.Run();
+ }
+
+ {
+ base::RunLoop loop;
+ device->Open(base::Bind(&ExpectOpenAndThen, OpenDeviceError::ALREADY_OPEN,
+ loop.QuitClosure()));
+ loop.Run();
+ }
EXPECT_CALL(mock_handle(), Close());
}
« no previous file with comments | « device/usb/mojo/device_impl.cc ('k') | device/usb/public/interfaces/device.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698