Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(692)

Side by Side Diff: chrome/browser/system_monitor/removable_device_notifications_window_win_unittest.cc

Issue 12147002: Add a receiver interface to RemovableStorageNotifications. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merging Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698