| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chromeos/dbus/cros_disks_client.h" | 5 #include "chromeos/dbus/cros_disks_client.h" |
| 6 | 6 |
| 7 #include <stdint.h> |
| 8 |
| 7 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 8 #include "dbus/message.h" | 10 #include "dbus/message.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "third_party/cros_system_api/dbus/service_constants.h" | 12 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 11 | 13 |
| 12 namespace chromeos { | 14 namespace chromeos { |
| 13 | 15 |
| 14 namespace { | 16 namespace { |
| 15 | 17 |
| 16 // Appends a boolean entry to a dictionary of type "a{sv}" | 18 // Appends a boolean entry to a dictionary of type "a{sv}" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 38 } // namespace | 40 } // namespace |
| 39 | 41 |
| 40 TEST(CrosDisksClientTest, DiskInfo) { | 42 TEST(CrosDisksClientTest, DiskInfo) { |
| 41 const std::string kDeviceFile = "/dev/sdb1"; | 43 const std::string kDeviceFile = "/dev/sdb1"; |
| 42 const bool kDeviceIsDrive = true; | 44 const bool kDeviceIsDrive = true; |
| 43 const bool kDeviceIsMediaAvailable = true; | 45 const bool kDeviceIsMediaAvailable = true; |
| 44 const bool kDeviceIsMounted = true; | 46 const bool kDeviceIsMounted = true; |
| 45 const bool kDeviceIsOnBootDevice = true; | 47 const bool kDeviceIsOnBootDevice = true; |
| 46 const bool kDeviceIsOnRemovableDevice = true; | 48 const bool kDeviceIsOnRemovableDevice = true; |
| 47 const bool kDeviceIsReadOnly = true; | 49 const bool kDeviceIsReadOnly = true; |
| 48 const uint32 kDeviceMediaType = cros_disks::DEVICE_MEDIA_SD; | 50 const uint32_t kDeviceMediaType = cros_disks::DEVICE_MEDIA_SD; |
| 49 const std::string kMountPath = "/media/removable/UNTITLED"; | 51 const std::string kMountPath = "/media/removable/UNTITLED"; |
| 50 const bool kDevicePresentationHide = false; | 52 const bool kDevicePresentationHide = false; |
| 51 const uint64 kDeviceSize = 16005464064; | 53 const uint64_t kDeviceSize = 16005464064; |
| 52 const std::string kDriveModel = "DriveModel"; | 54 const std::string kDriveModel = "DriveModel"; |
| 53 const std::string kIdLabel = "UNTITLED"; | 55 const std::string kIdLabel = "UNTITLED"; |
| 54 const std::string kIdUuid = "XXXX-YYYY"; | 56 const std::string kIdUuid = "XXXX-YYYY"; |
| 55 const std::string kNativePath = "/sys/devices/.../sdb/sdb1"; | 57 const std::string kNativePath = "/sys/devices/.../sdb/sdb1"; |
| 56 const std::string kProductId = "1234"; | 58 const std::string kProductId = "1234"; |
| 57 const std::string kProductName = "Product Name"; | 59 const std::string kProductName = "Product Name"; |
| 58 const std::string kVendorId = "0000"; | 60 const std::string kVendorId = "0000"; |
| 59 const std::string kVendorName = "Vendor Name"; | 61 const std::string kVendorName = "Vendor Name"; |
| 60 | 62 |
| 61 // Construct a fake response of GetDeviceProperties(). | 63 // Construct a fake response of GetDeviceProperties(). |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 EXPECT_EQ(kProductName, result.product_name()); | 146 EXPECT_EQ(kProductName, result.product_name()); |
| 145 EXPECT_EQ(kDriveModel, result.drive_label()); | 147 EXPECT_EQ(kDriveModel, result.drive_label()); |
| 146 EXPECT_EQ(kIdLabel, result.label()); | 148 EXPECT_EQ(kIdLabel, result.label()); |
| 147 EXPECT_EQ(kIdUuid, result.uuid()); | 149 EXPECT_EQ(kIdUuid, result.uuid()); |
| 148 EXPECT_EQ(kDeviceSize, result.total_size_in_bytes()); | 150 EXPECT_EQ(kDeviceSize, result.total_size_in_bytes()); |
| 149 EXPECT_EQ(DEVICE_TYPE_SD, result.device_type()); | 151 EXPECT_EQ(DEVICE_TYPE_SD, result.device_type()); |
| 150 EXPECT_EQ(kMountPath, result.mount_path()); | 152 EXPECT_EQ(kMountPath, result.mount_path()); |
| 151 } | 153 } |
| 152 | 154 |
| 153 } // namespace chromeos | 155 } // namespace chromeos |
| OLD | NEW |