| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // StorageMonitorLinux unit tests. | 5 // StorageMonitorLinux unit tests. |
| 6 | 6 |
| 7 #include "components/storage_monitor/storage_monitor_linux.h" | 7 #include "components/storage_monitor/storage_monitor_linux.h" |
| 8 | 8 |
| 9 #include <mntent.h> | 9 #include <mntent.h> |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 81 |
| 82 scoped_ptr<StorageInfo> storage_info; | 82 scoped_ptr<StorageInfo> storage_info; |
| 83 if (!device_found) { | 83 if (!device_found) { |
| 84 NOTREACHED(); | 84 NOTREACHED(); |
| 85 return storage_info.Pass(); | 85 return storage_info.Pass(); |
| 86 } | 86 } |
| 87 | 87 |
| 88 StorageInfo::Type type = kTestDeviceData[i].type; | 88 StorageInfo::Type type = kTestDeviceData[i].type; |
| 89 storage_info.reset(new StorageInfo( | 89 storage_info.reset(new StorageInfo( |
| 90 StorageInfo::MakeDeviceId(type, kTestDeviceData[i].unique_id), | 90 StorageInfo::MakeDeviceId(type, kTestDeviceData[i].unique_id), |
| 91 base::string16(), | |
| 92 mount_point.value(), | 91 mount_point.value(), |
| 93 base::ASCIIToUTF16("volume label"), | 92 base::ASCIIToUTF16("volume label"), |
| 94 base::ASCIIToUTF16("vendor name"), | 93 base::ASCIIToUTF16("vendor name"), |
| 95 base::ASCIIToUTF16("model name"), | 94 base::ASCIIToUTF16("model name"), |
| 96 kTestDeviceData[i].partition_size_in_bytes)); | 95 kTestDeviceData[i].partition_size_in_bytes)); |
| 97 return storage_info.Pass(); | 96 return storage_info.Pass(); |
| 98 } | 97 } |
| 99 | 98 |
| 100 uint64 GetDevicePartitionSize(const std::string& device) { | 99 uint64 GetDevicePartitionSize(const std::string& device) { |
| 101 for (size_t i = 0; i < arraysize(kTestDeviceData); ++i) { | 100 for (size_t i = 0; i < arraysize(kTestDeviceData); ++i) { |
| (...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 GetStorageSize(test_path_a)); | 675 GetStorageSize(test_path_a)); |
| 677 EXPECT_EQ(GetDevicePartitionSize(kDeviceNoDCIM), | 676 EXPECT_EQ(GetDevicePartitionSize(kDeviceNoDCIM), |
| 678 GetStorageSize(test_path_b)); | 677 GetStorageSize(test_path_b)); |
| 679 EXPECT_EQ(GetDevicePartitionSize(kInvalidPath), | 678 EXPECT_EQ(GetDevicePartitionSize(kInvalidPath), |
| 680 GetStorageSize(base::FilePath(kInvalidPath))); | 679 GetStorageSize(base::FilePath(kInvalidPath))); |
| 681 } | 680 } |
| 682 | 681 |
| 683 } // namespace | 682 } // namespace |
| 684 | 683 |
| 685 } // namespace storage_monitor | 684 } // namespace storage_monitor |
| OLD | NEW |