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

Side by Side Diff: extensions/common/permissions/usb_device_permission_unittest.cc

Issue 2515353006: Fix USB device permissions tests (Closed)
Patch Set: Created 4 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 <memory> 5 #include <memory>
6 6
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "device/usb/mock_usb_device.h" 8 #include "device/usb/mock_usb_device.h"
9 #include "device/usb/usb_descriptors.h" 9 #include "device/usb/usb_descriptors.h"
10 #include "extensions/common/extension_builder.h" 10 #include "extensions/common/extension_builder.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 .Set("background", 55 .Set("background",
56 DictionaryBuilder() 56 DictionaryBuilder()
57 .Set("scripts", ListBuilder() 57 .Set("scripts", ListBuilder()
58 .Append("background.js") 58 .Append("background.js")
59 .Build()) 59 .Build())
60 .Build()) 60 .Build())
61 .Build()) 61 .Build())
62 .Set("permissions", 62 .Set("permissions",
63 ListBuilder() 63 ListBuilder()
64 .Append("usb") 64 .Append("usb")
65 .Append( 65 .Append(DictionaryBuilder()
66 DictionaryBuilder() 66 .Set("usbDevices",
67 .Set("usbDevice", ListBuilder() 67 ListBuilder()
68 .Append(std::move( 68 .Append(std::move(
69 usb_device_permission)) 69 usb_device_permission))
70 .Build()) 70 .Build())
71 .Build()) 71 .Build())
72 .Build()) 72 .Build())
73 .Build()) 73 .Build())
74 .Build(); 74 .Build();
75 } 75 }
76 76
77 } // namespace 77 } // namespace
78 78
79 TEST(USBDevicePermissionTest, PermissionDataOrder) { 79 TEST(USBDevicePermissionTest, PermissionDataOrder) {
80 EXPECT_LT(UsbDevicePermissionData(0x02ad, 0x138c, -1, -1), 80 EXPECT_LT(UsbDevicePermissionData(0x02ad, 0x138c, -1, -1),
81 UsbDevicePermissionData(0x02ad, 0x138d, -1, -1)); 81 UsbDevicePermissionData(0x02ad, 0x138d, -1, -1));
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 .Set("vendorId", 0x02ad) 588 .Set("vendorId", 0x02ad)
589 .Set("productId", 0x128c) 589 .Set("productId", 0x128c)
590 .Set("interfaceId", 3) 590 .Set("interfaceId", 3)
591 .Set("interfaceClass", 7) 591 .Set("interfaceClass", 7)
592 .Build(); 592 .Build();
593 UsbDevicePermissionData permission_data; 593 UsbDevicePermissionData permission_data;
594 ASSERT_FALSE(permission_data.FromValue(permission_data_value.get())); 594 ASSERT_FALSE(permission_data.FromValue(permission_data_value.get()));
595 } 595 }
596 596
597 } // namespace extensions 597 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698