| 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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 // static | 250 // static |
| 251 void StorageMonitorCrosTest::PostQuitToUIThread() { | 251 void StorageMonitorCrosTest::PostQuitToUIThread() { |
| 252 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 252 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
| 253 base::MessageLoop::QuitWhenIdleClosure()); | 253 base::MessageLoop::QuitWhenIdleClosure()); |
| 254 } | 254 } |
| 255 | 255 |
| 256 // static | 256 // static |
| 257 void StorageMonitorCrosTest::WaitForFileThread() { | 257 void StorageMonitorCrosTest::WaitForFileThread() { |
| 258 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 258 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
| 259 base::Bind(&PostQuitToUIThread)); | 259 base::Bind(&PostQuitToUIThread)); |
| 260 base::MessageLoop::current()->Run(); | 260 base::RunLoop().Run(); |
| 261 } | 261 } |
| 262 | 262 |
| 263 void StorageMonitorCrosTest::EjectNotify(StorageMonitor::EjectStatus status) { | 263 void StorageMonitorCrosTest::EjectNotify(StorageMonitor::EjectStatus status) { |
| 264 status_ = status; | 264 status_ = status; |
| 265 } | 265 } |
| 266 | 266 |
| 267 // Simple test case where we attach and detach a media device. | 267 // Simple test case where we attach and detach a media device. |
| 268 TEST_F(StorageMonitorCrosTest, BasicAttachDetach) { | 268 TEST_F(StorageMonitorCrosTest, BasicAttachDetach) { |
| 269 base::FilePath mount_path1 = CreateMountPoint(kMountPointA, true); | 269 base::FilePath mount_path1 = CreateMountPoint(kMountPointA, true); |
| 270 ASSERT_FALSE(mount_path1.empty()); | 270 ASSERT_FALSE(mount_path1.empty()); |
| (...skipping 279 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 |