| 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 <windows.h> | 5 #include <windows.h> |
| 6 #include <dbt.h> | 6 #include <dbt.h> |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 new TestPortableDeviceWatcherWin)); | 90 new TestPortableDeviceWatcherWin)); |
| 91 | 91 |
| 92 monitor_->Init(); | 92 monitor_->Init(); |
| 93 RunUntilIdle(); | 93 RunUntilIdle(); |
| 94 monitor_->AddObserver(&observer_); | 94 monitor_->AddObserver(&observer_); |
| 95 } | 95 } |
| 96 | 96 |
| 97 void StorageMonitorWinTest::TearDown() { | 97 void StorageMonitorWinTest::TearDown() { |
| 98 RunUntilIdle(); | 98 RunUntilIdle(); |
| 99 monitor_->RemoveObserver(&observer_); | 99 monitor_->RemoveObserver(&observer_); |
| 100 volume_mount_watcher_->ShutdownWorkerPool(); | |
| 101 | 100 |
| 102 // Windows storage monitor must be destroyed on the same thread | 101 // Windows storage monitor must be destroyed on the same thread |
| 103 // as construction. | 102 // as construction. |
| 104 monitor_.reset(); | 103 monitor_.reset(); |
| 105 } | 104 } |
| 106 | 105 |
| 107 void StorageMonitorWinTest::PreAttachDevices() { | 106 void StorageMonitorWinTest::PreAttachDevices() { |
| 108 monitor_.reset(); | 107 monitor_.reset(); |
| 109 volume_mount_watcher_ = new TestVolumeMountWatcherWin; | 108 volume_mount_watcher_ = new TestVolumeMountWatcherWin; |
| 110 volume_mount_watcher_->SetAttachedDevicesFake(); | 109 volume_mount_watcher_->SetAttachedDevicesFake(); |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 TestPortableDeviceWatcherWin::kMTPDeviceWithValidInfo); | 539 TestPortableDeviceWatcherWin::kMTPDeviceWithValidInfo); |
| 541 EXPECT_EQ(expected, pnp_device_id); | 540 EXPECT_EQ(expected, pnp_device_id); |
| 542 EXPECT_EQ(it->object_persistent_id, | 541 EXPECT_EQ(it->object_persistent_id, |
| 543 TestPortableDeviceWatcherWin::GetMTPStorageUniqueId( | 542 TestPortableDeviceWatcherWin::GetMTPStorageUniqueId( |
| 544 pnp_device_id, storage_object_id)); | 543 pnp_device_id, storage_object_id)); |
| 545 } | 544 } |
| 546 DoMTPDeviceTest(TestPortableDeviceWatcherWin::kMTPDeviceWithValidInfo, false); | 545 DoMTPDeviceTest(TestPortableDeviceWatcherWin::kMTPDeviceWithValidInfo, false); |
| 547 } | 546 } |
| 548 | 547 |
| 549 } // namespace storage_monitor | 548 } // namespace storage_monitor |
| OLD | NEW |