| 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 // TestVolumeMountWatcherWin implementation. | 5 // TestVolumeMountWatcherWin implementation. |
| 6 | 6 |
| 7 #include "components/storage_monitor/test_volume_mount_watcher_win.h" | 7 #include "components/storage_monitor/test_volume_mount_watcher_win.h" |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 TestVolumeMountWatcherWin::TestVolumeMountWatcherWin() | 92 TestVolumeMountWatcherWin::TestVolumeMountWatcherWin() |
| 93 : attached_devices_fake_(false) {} | 93 : attached_devices_fake_(false) {} |
| 94 | 94 |
| 95 TestVolumeMountWatcherWin::~TestVolumeMountWatcherWin() { | 95 TestVolumeMountWatcherWin::~TestVolumeMountWatcherWin() { |
| 96 } | 96 } |
| 97 | 97 |
| 98 void TestVolumeMountWatcherWin::AddDeviceForTesting( | 98 void TestVolumeMountWatcherWin::AddDeviceForTesting( |
| 99 const base::FilePath& device_path, | 99 const base::FilePath& device_path, |
| 100 const std::string& device_id, | 100 const std::string& device_id, |
| 101 const base::string16& storage_label, | 101 const base::string16& storage_label, |
| 102 uint64 total_size_in_bytes) { | 102 uint64_t total_size_in_bytes) { |
| 103 StorageInfo info(device_id, device_path.value(), storage_label, | 103 StorageInfo info(device_id, device_path.value(), storage_label, |
| 104 base::string16(), base::string16(), total_size_in_bytes); | 104 base::string16(), base::string16(), total_size_in_bytes); |
| 105 HandleDeviceAttachEventOnUIThread(device_path, info); | 105 HandleDeviceAttachEventOnUIThread(device_path, info); |
| 106 } | 106 } |
| 107 | 107 |
| 108 void TestVolumeMountWatcherWin::SetAttachedDevicesFake() { | 108 void TestVolumeMountWatcherWin::SetAttachedDevicesFake() { |
| 109 attached_devices_fake_ = true; | 109 attached_devices_fake_ = true; |
| 110 } | 110 } |
| 111 | 111 |
| 112 void TestVolumeMountWatcherWin::FlushWorkerPoolForTesting() { | 112 void TestVolumeMountWatcherWin::FlushWorkerPoolForTesting() { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 } | 146 } |
| 147 | 147 |
| 148 VolumeMountWatcherWin::GetAttachedDevicesCallbackType | 148 VolumeMountWatcherWin::GetAttachedDevicesCallbackType |
| 149 TestVolumeMountWatcherWin::GetAttachedDevicesCallback() const { | 149 TestVolumeMountWatcherWin::GetAttachedDevicesCallback() const { |
| 150 if (attached_devices_fake_) | 150 if (attached_devices_fake_) |
| 151 return base::Bind(&FakeGetAttachedDevices); | 151 return base::Bind(&FakeGetAttachedDevices); |
| 152 return base::Bind(&FakeGetSingleAttachedDevice); | 152 return base::Bind(&FakeGetSingleAttachedDevice); |
| 153 } | 153 } |
| 154 | 154 |
| 155 } // namespace storage_monitor | 155 } // namespace storage_monitor |
| OLD | NEW |