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

Unified Diff: device/usb/usb_device_filter_unittest.cc

Issue 2615353002: Typemap device.usb.DeviceFilter to device::UsbDeviceFilter. (Closed)
Patch Set: Addressed juncai@'s feedback. Created 3 years, 11 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/usb_device_filter.cc ('k') | extensions/browser/api/device_permissions_prompt.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/usb/usb_device_filter_unittest.cc
diff --git a/device/usb/usb_device_filter_unittest.cc b/device/usb/usb_device_filter_unittest.cc
index a12d54758cd8599965e6699e78de8fc7b8a58bef..0336e16dafcaf6e0a69a6c4de5664c8f4094428a 100644
--- a/device/usb/usb_device_filter_unittest.cc
+++ b/device/usb/usb_device_filter_unittest.cc
@@ -37,69 +37,69 @@ TEST_F(UsbFilterTest, MatchAny) {
TEST_F(UsbFilterTest, MatchVendorId) {
UsbDeviceFilter filter;
- filter.SetVendorId(0x18d1);
+ filter.vendor_id = 0x18d1;
ASSERT_TRUE(filter.Matches(android_phone_));
}
TEST_F(UsbFilterTest, MatchVendorIdNegative) {
UsbDeviceFilter filter;
- filter.SetVendorId(0x1d6b);
+ filter.vendor_id = 0x1d6b;
ASSERT_FALSE(filter.Matches(android_phone_));
}
TEST_F(UsbFilterTest, MatchProductId) {
UsbDeviceFilter filter;
- filter.SetVendorId(0x18d1);
- filter.SetProductId(0x4ee2);
+ filter.vendor_id = 0x18d1;
+ filter.product_id = 0x4ee2;
ASSERT_TRUE(filter.Matches(android_phone_));
}
TEST_F(UsbFilterTest, MatchProductIdNegative) {
UsbDeviceFilter filter;
- filter.SetVendorId(0x18d1);
- filter.SetProductId(0x4ee1);
+ filter.vendor_id = 0x18d1;
+ filter.product_id = 0x4ee1;
ASSERT_FALSE(filter.Matches(android_phone_));
}
TEST_F(UsbFilterTest, MatchInterfaceClass) {
UsbDeviceFilter filter;
- filter.SetInterfaceClass(0xff);
+ filter.interface_class = 0xff;
ASSERT_TRUE(filter.Matches(android_phone_));
}
TEST_F(UsbFilterTest, MatchInterfaceClassNegative) {
UsbDeviceFilter filter;
- filter.SetInterfaceClass(0xe0);
+ filter.interface_class = 0xe0;
ASSERT_FALSE(filter.Matches(android_phone_));
}
TEST_F(UsbFilterTest, MatchInterfaceSubclass) {
UsbDeviceFilter filter;
- filter.SetInterfaceClass(0xff);
- filter.SetInterfaceSubclass(0x42);
+ filter.interface_class = 0xff;
+ filter.interface_subclass = 0x42;
ASSERT_TRUE(filter.Matches(android_phone_));
}
TEST_F(UsbFilterTest, MatchInterfaceSubclassNegative) {
UsbDeviceFilter filter;
- filter.SetInterfaceClass(0xff);
- filter.SetInterfaceSubclass(0x01);
+ filter.interface_class = 0xff;
+ filter.interface_subclass = 0x01;
ASSERT_FALSE(filter.Matches(android_phone_));
}
TEST_F(UsbFilterTest, MatchInterfaceProtocol) {
UsbDeviceFilter filter;
- filter.SetInterfaceClass(0xff);
- filter.SetInterfaceSubclass(0x42);
- filter.SetInterfaceProtocol(0x01);
+ filter.interface_class = 0xff;
+ filter.interface_subclass = 0x42;
+ filter.interface_protocol = 0x01;
ASSERT_TRUE(filter.Matches(android_phone_));
}
TEST_F(UsbFilterTest, MatchInterfaceProtocolNegative) {
UsbDeviceFilter filter;
- filter.SetInterfaceClass(0xff);
- filter.SetInterfaceSubclass(0x42);
- filter.SetInterfaceProtocol(0x02);
+ filter.interface_class = 0xff;
+ filter.interface_subclass = 0x42;
+ filter.interface_protocol = 0x02;
ASSERT_FALSE(filter.Matches(android_phone_));
}
@@ -110,13 +110,13 @@ TEST_F(UsbFilterTest, MatchAnyEmptyList) {
TEST_F(UsbFilterTest, MatchesAnyVendorId) {
std::vector<UsbDeviceFilter> filters(1);
- filters.back().SetVendorId(0x18d1);
+ filters.back().vendor_id = 0x18d1;
ASSERT_TRUE(UsbDeviceFilter::MatchesAny(android_phone_, filters));
}
TEST_F(UsbFilterTest, MatchesAnyVendorIdNegative) {
std::vector<UsbDeviceFilter> filters(1);
- filters.back().SetVendorId(0x1d6b);
+ filters.back().vendor_id = 0x1d6b;
ASSERT_FALSE(UsbDeviceFilter::MatchesAny(android_phone_, filters));
}
« no previous file with comments | « device/usb/usb_device_filter.cc ('k') | extensions/browser/api/device_permissions_prompt.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698