OLD | NEW |
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 <set> | 5 #include <set> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/pickle.h" | 9 #include "base/pickle.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 scoped_ptr<base::ListValue> permission_list(new base::ListValue()); | 44 scoped_ptr<base::ListValue> permission_list(new base::ListValue()); |
45 permission_list->Append( | 45 permission_list->Append( |
46 UsbDevicePermissionData(0x02ad, 0x138c, -1).ToValue()->DeepCopy()); | 46 UsbDevicePermissionData(0x02ad, 0x138c, -1).ToValue()->DeepCopy()); |
47 permission_list->Append( | 47 permission_list->Append( |
48 UsbDevicePermissionData(0x02ad, 0x138d, -1).ToValue()->DeepCopy()); | 48 UsbDevicePermissionData(0x02ad, 0x138d, -1).ToValue()->DeepCopy()); |
49 permission_list->Append( | 49 permission_list->Append( |
50 UsbDevicePermissionData(0x02ae, 0x138d, -1).ToValue()->DeepCopy()); | 50 UsbDevicePermissionData(0x02ae, 0x138d, -1).ToValue()->DeepCopy()); |
51 | 51 |
52 UsbDevicePermission permission( | 52 UsbDevicePermission permission( |
53 PermissionsInfo::GetInstance()->GetByID(APIPermission::kUsbDevice)); | 53 PermissionsInfo::GetInstance()->GetByID(APIPermission::kUsbDevice)); |
54 ASSERT_TRUE(permission.FromValue(permission_list.get(), NULL, NULL)); | 54 ASSERT_TRUE(permission.FromValue(permission_list.get(), nullptr, NULL)); |
55 | 55 |
56 PermissionMessages messages = permission.GetMessages(); | 56 PermissionMessages messages = permission.GetMessages(); |
57 ASSERT_EQ(3U, messages.size()); | 57 ASSERT_EQ(3U, messages.size()); |
58 EXPECT_EQ(base::ASCIIToUTF16(kMessages[0]), messages.at(0).message()); | 58 EXPECT_EQ(base::ASCIIToUTF16(kMessages[0]), messages.at(0).message()); |
59 EXPECT_EQ(base::ASCIIToUTF16(kMessages[1]), messages.at(1).message()); | 59 EXPECT_EQ(base::ASCIIToUTF16(kMessages[1]), messages.at(1).message()); |
60 EXPECT_EQ(base::ASCIIToUTF16(kMessages[2]), messages.at(2).message()); | 60 EXPECT_EQ(base::ASCIIToUTF16(kMessages[2]), messages.at(2).message()); |
61 } | 61 } |
62 | 62 |
63 } // namespace extensions | 63 } // namespace extensions |
OLD | NEW |