| 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 #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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 window_->Init(); | 93 window_->Init(); |
| 94 RunUntilIdle(); | 94 RunUntilIdle(); |
| 95 window_->AddObserver(&observer_); | 95 window_->AddObserver(&observer_); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void RemovableDeviceNotificationsWindowWinTest::TearDown() { | 98 void RemovableDeviceNotificationsWindowWinTest::TearDown() { |
| 99 RunUntilIdle(); | 99 RunUntilIdle(); |
| 100 window_->RemoveObserver(&observer_); | 100 window_->RemoveObserver(&observer_); |
| 101 } | 101 } |
| 102 | 102 |
| 103 | |
| 104 void RemovableDeviceNotificationsWindowWinTest::PreAttachDevices() { | 103 void RemovableDeviceNotificationsWindowWinTest::PreAttachDevices() { |
| 105 window_.reset(); | 104 window_.reset(); |
| 106 volume_mount_watcher_ = new TestVolumeMountWatcherWin; | 105 volume_mount_watcher_ = new TestVolumeMountWatcherWin; |
| 107 volume_mount_watcher_->SetAttachedDevicesFake(); | 106 volume_mount_watcher_->SetAttachedDevicesFake(); |
| 108 | 107 |
| 109 int expect_attach_calls = 0; | 108 int expect_attach_calls = 0; |
| 110 std::vector<base::FilePath> initial_devices = | 109 std::vector<base::FilePath> initial_devices = |
| 111 volume_mount_watcher_->GetAttachedDevices(); | 110 volume_mount_watcher_->GetAttachedDevices(); |
| 112 for (std::vector<base::FilePath>::const_iterator it = initial_devices.begin(); | 111 for (std::vector<base::FilePath>::const_iterator it = initial_devices.begin(); |
| 113 it != initial_devices.end(); ++it) { | 112 it != initial_devices.end(); ++it) { |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 pnp_device_id); | 509 pnp_device_id); |
| 511 EXPECT_EQ(it->object_persistent_id, | 510 EXPECT_EQ(it->object_persistent_id, |
| 512 TestPortableDeviceWatcherWin::GetMTPStorageUniqueId( | 511 TestPortableDeviceWatcherWin::GetMTPStorageUniqueId( |
| 513 pnp_device_id, storage_object_id)); | 512 pnp_device_id, storage_object_id)); |
| 514 } | 513 } |
| 515 DoMTPDeviceTest(TestPortableDeviceWatcherWin::kMTPDeviceWithValidInfo, false); | 514 DoMTPDeviceTest(TestPortableDeviceWatcherWin::kMTPDeviceWithValidInfo, false); |
| 516 } | 515 } |
| 517 | 516 |
| 518 } // namespace test | 517 } // namespace test |
| 519 } // namespace chrome | 518 } // namespace chrome |
| OLD | NEW |