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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 new TestMediaTransferProtocolManagerLinux()); | 127 new TestMediaTransferProtocolManagerLinux()); |
128 SetGetDeviceInfoCallbackForTest(base::Bind(&GetDeviceInfo)); | 128 SetGetDeviceInfoCallbackForTest(base::Bind(&GetDeviceInfo)); |
129 } | 129 } |
130 ~TestStorageMonitorLinux() override {} | 130 ~TestStorageMonitorLinux() override {} |
131 | 131 |
132 private: | 132 private: |
133 void UpdateMtab( | 133 void UpdateMtab( |
134 const MtabWatcherLinux::MountPointDeviceMap& new_mtab) override { | 134 const MtabWatcherLinux::MountPointDeviceMap& new_mtab) override { |
135 StorageMonitorLinux::UpdateMtab(new_mtab); | 135 StorageMonitorLinux::UpdateMtab(new_mtab); |
136 base::ThreadTaskRunnerHandle::Get()->PostTask( | 136 base::ThreadTaskRunnerHandle::Get()->PostTask( |
137 FROM_HERE, base::MessageLoop::QuitClosure()); | 137 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); |
138 } | 138 } |
139 | 139 |
140 DISALLOW_COPY_AND_ASSIGN(TestStorageMonitorLinux); | 140 DISALLOW_COPY_AND_ASSIGN(TestStorageMonitorLinux); |
141 }; | 141 }; |
142 | 142 |
143 class StorageMonitorLinuxTest : public testing::Test { | 143 class StorageMonitorLinuxTest : public testing::Test { |
144 public: | 144 public: |
145 struct MtabTestData { | 145 struct MtabTestData { |
146 MtabTestData(const std::string& mount_device, | 146 MtabTestData(const std::string& mount_device, |
147 const std::string& mount_point, | 147 const std::string& mount_point, |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
677 GetStorageSize(test_path_a)); | 677 GetStorageSize(test_path_a)); |
678 EXPECT_EQ(GetDevicePartitionSize(kDeviceNoDCIM), | 678 EXPECT_EQ(GetDevicePartitionSize(kDeviceNoDCIM), |
679 GetStorageSize(test_path_b)); | 679 GetStorageSize(test_path_b)); |
680 EXPECT_EQ(GetDevicePartitionSize(kInvalidPath), | 680 EXPECT_EQ(GetDevicePartitionSize(kInvalidPath), |
681 GetStorageSize(base::FilePath(kInvalidPath))); | 681 GetStorageSize(base::FilePath(kInvalidPath))); |
682 } | 682 } |
683 | 683 |
684 } // namespace | 684 } // namespace |
685 | 685 |
686 } // namespace storage_monitor | 686 } // namespace storage_monitor |
OLD | NEW |