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 #include "components/storage_monitor/storage_monitor_chromeos.h" | 5 #include "components/storage_monitor/storage_monitor_chromeos.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 const std::string& device_location) { | 230 const std::string& device_location) { |
231 StorageInfo info; | 231 StorageInfo info; |
232 if (!monitor_->GetStorageInfoForPath(base::FilePath(device_location), &info)) | 232 if (!monitor_->GetStorageInfoForPath(base::FilePath(device_location), &info)) |
233 return 0; | 233 return 0; |
234 | 234 |
235 return info.total_size_in_bytes(); | 235 return info.total_size_in_bytes(); |
236 } | 236 } |
237 | 237 |
238 base::FilePath StorageMonitorCrosTest::CreateMountPoint( | 238 base::FilePath StorageMonitorCrosTest::CreateMountPoint( |
239 const std::string& dir, bool with_dcim_dir) { | 239 const std::string& dir, bool with_dcim_dir) { |
240 base::FilePath return_path(scoped_temp_dir_.path()); | 240 base::FilePath return_path(scoped_temp_dir_.GetPath()); |
241 return_path = return_path.AppendASCII(dir); | 241 return_path = return_path.AppendASCII(dir); |
242 base::FilePath path(return_path); | 242 base::FilePath path(return_path); |
243 if (with_dcim_dir) | 243 if (with_dcim_dir) |
244 path = path.Append(kDCIMDirectoryName); | 244 path = path.Append(kDCIMDirectoryName); |
245 if (!base::CreateDirectory(path)) | 245 if (!base::CreateDirectory(path)) |
246 return base::FilePath(); | 246 return base::FilePath(); |
247 return return_path; | 247 return return_path; |
248 } | 248 } |
249 | 249 |
250 // static | 250 // static |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 base::Bind(&StorageMonitorCrosTest::EjectNotify, | 550 base::Bind(&StorageMonitorCrosTest::EjectNotify, |
551 base::Unretained(this))); | 551 base::Unretained(this))); |
552 base::RunLoop().RunUntilIdle(); | 552 base::RunLoop().RunUntilIdle(); |
553 | 553 |
554 EXPECT_EQ(StorageMonitor::EJECT_OK, status_); | 554 EXPECT_EQ(StorageMonitor::EJECT_OK, status_); |
555 } | 555 } |
556 | 556 |
557 } // namespace | 557 } // namespace |
558 | 558 |
559 } // namespace storage_monitor | 559 } // namespace storage_monitor |
OLD | NEW |