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 21 matching lines...) Expand all Loading... |
32 | 32 |
33 typedef std::vector<int> DeviceIndices; | 33 typedef std::vector<int> DeviceIndices; |
34 | 34 |
35 // StorageMonitorWinTest ------------------------------------------------------- | 35 // StorageMonitorWinTest ------------------------------------------------------- |
36 | 36 |
37 namespace storage_monitor { | 37 namespace storage_monitor { |
38 | 38 |
39 class StorageMonitorWinTest : public testing::Test { | 39 class StorageMonitorWinTest : public testing::Test { |
40 public: | 40 public: |
41 StorageMonitorWinTest(); | 41 StorageMonitorWinTest(); |
42 virtual ~StorageMonitorWinTest(); | 42 ~StorageMonitorWinTest() override; |
43 | 43 |
44 protected: | 44 protected: |
45 // testing::Test: | 45 // testing::Test: |
46 virtual void SetUp() override; | 46 void SetUp() override; |
47 virtual void TearDown() override; | 47 void TearDown() override; |
48 | 48 |
49 void PreAttachDevices(); | 49 void PreAttachDevices(); |
50 | 50 |
51 // Runs all the pending tasks on UI thread, FILE thread and blocking thread. | 51 // Runs all the pending tasks on UI thread, FILE thread and blocking thread. |
52 void RunUntilIdle(); | 52 void RunUntilIdle(); |
53 | 53 |
54 void DoMassStorageDeviceAttachedTest(const DeviceIndices& device_indices); | 54 void DoMassStorageDeviceAttachedTest(const DeviceIndices& device_indices); |
55 void DoMassStorageDevicesDetachedTest(const DeviceIndices& device_indices); | 55 void DoMassStorageDevicesDetachedTest(const DeviceIndices& device_indices); |
56 | 56 |
57 // Injects a device attach or detach change (depending on the value of | 57 // Injects a device attach or detach change (depending on the value of |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 TestPortableDeviceWatcherWin::kMTPDeviceWithValidInfo); | 539 TestPortableDeviceWatcherWin::kMTPDeviceWithValidInfo); |
540 EXPECT_EQ(expected, pnp_device_id); | 540 EXPECT_EQ(expected, pnp_device_id); |
541 EXPECT_EQ(it->object_persistent_id, | 541 EXPECT_EQ(it->object_persistent_id, |
542 TestPortableDeviceWatcherWin::GetMTPStorageUniqueId( | 542 TestPortableDeviceWatcherWin::GetMTPStorageUniqueId( |
543 pnp_device_id, storage_object_id)); | 543 pnp_device_id, storage_object_id)); |
544 } | 544 } |
545 DoMTPDeviceTest(TestPortableDeviceWatcherWin::kMTPDeviceWithValidInfo, false); | 545 DoMTPDeviceTest(TestPortableDeviceWatcherWin::kMTPDeviceWithValidInfo, false); |
546 } | 546 } |
547 | 547 |
548 } // namespace storage_monitor | 548 } // namespace storage_monitor |
OLD | NEW |