| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // chromeos::StorageMonitorCros unit tests. | 5 // chromeos::StorageMonitorCros unit tests. |
| 6 | 6 |
| 7 #include "chrome/browser/storage_monitor/storage_monitor_chromeos.h" | 7 #include "chrome/browser/storage_monitor/storage_monitor_chromeos.h" |
| 8 | 8 |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 return info.total_size_in_bytes(); | 229 return info.total_size_in_bytes(); |
| 230 } | 230 } |
| 231 | 231 |
| 232 base::FilePath StorageMonitorCrosTest::CreateMountPoint( | 232 base::FilePath StorageMonitorCrosTest::CreateMountPoint( |
| 233 const std::string& dir, bool with_dcim_dir) { | 233 const std::string& dir, bool with_dcim_dir) { |
| 234 base::FilePath return_path(scoped_temp_dir_.path()); | 234 base::FilePath return_path(scoped_temp_dir_.path()); |
| 235 return_path = return_path.AppendASCII(dir); | 235 return_path = return_path.AppendASCII(dir); |
| 236 base::FilePath path(return_path); | 236 base::FilePath path(return_path); |
| 237 if (with_dcim_dir) | 237 if (with_dcim_dir) |
| 238 path = path.Append(kDCIMDirectoryName); | 238 path = path.Append(kDCIMDirectoryName); |
| 239 if (!file_util::CreateDirectory(path)) | 239 if (!base::CreateDirectory(path)) |
| 240 return base::FilePath(); | 240 return base::FilePath(); |
| 241 return return_path; | 241 return return_path; |
| 242 } | 242 } |
| 243 | 243 |
| 244 // static | 244 // static |
| 245 void StorageMonitorCrosTest::PostQuitToUIThread() { | 245 void StorageMonitorCrosTest::PostQuitToUIThread() { |
| 246 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 246 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
| 247 base::MessageLoop::QuitClosure()); | 247 base::MessageLoop::QuitClosure()); |
| 248 } | 248 } |
| 249 | 249 |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 base::Bind(&StorageMonitorCrosTest::EjectNotify, | 475 base::Bind(&StorageMonitorCrosTest::EjectNotify, |
| 476 base::Unretained(this))); | 476 base::Unretained(this))); |
| 477 base::RunLoop().RunUntilIdle(); | 477 base::RunLoop().RunUntilIdle(); |
| 478 | 478 |
| 479 EXPECT_EQ(StorageMonitor::EJECT_OK, status_); | 479 EXPECT_EQ(StorageMonitor::EJECT_OK, status_); |
| 480 } | 480 } |
| 481 | 481 |
| 482 } // namespace | 482 } // namespace |
| 483 | 483 |
| 484 } // namespace chromeos | 484 } // namespace chromeos |
| OLD | NEW |