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 "chrome/browser/system_monitor/removable_device_notifications_mac.h" | 5 #include "chrome/browser/system_monitor/removable_device_notifications_mac.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/mac/foundation_util.h" | 8 #include "base/mac/foundation_util.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/scoped_temp_dir.h" | 10 #include "base/scoped_temp_dir.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 } // namespace | 46 } // namespace |
47 | 47 |
48 class RemovableDeviceNotificationsMacTest : public testing::Test { | 48 class RemovableDeviceNotificationsMacTest : public testing::Test { |
49 public: | 49 public: |
50 RemovableDeviceNotificationsMacTest() | 50 RemovableDeviceNotificationsMacTest() |
51 : message_loop_(MessageLoop::TYPE_IO), | 51 : message_loop_(MessageLoop::TYPE_IO), |
52 file_thread_(content::BrowserThread::FILE, &message_loop_) { | 52 file_thread_(content::BrowserThread::FILE, &message_loop_) { |
53 } | 53 } |
54 | 54 |
55 virtual void SetUp() OVERRIDE { | 55 virtual void SetUp() OVERRIDE { |
56 base::SystemMonitor::AllocateSystemIOPorts(); | |
57 system_monitor_.reset(new base::SystemMonitor()); | 56 system_monitor_.reset(new base::SystemMonitor()); |
58 | 57 |
59 mock_devices_changed_observer_.reset(new base::MockDevicesChangedObserver); | 58 mock_devices_changed_observer_.reset(new base::MockDevicesChangedObserver); |
60 system_monitor_->AddDevicesChangedObserver( | 59 system_monitor_->AddDevicesChangedObserver( |
61 mock_devices_changed_observer_.get()); | 60 mock_devices_changed_observer_.get()); |
62 | 61 |
63 notifications_ = new RemovableDeviceNotificationsMac; | 62 notifications_ = new RemovableDeviceNotificationsMac; |
64 | 63 |
65 unique_id_ = "test_id"; | 64 unique_id_ = "test_id"; |
66 display_name_ = ASCIIToUTF16("Test Display Name"); | 65 display_name_ = ASCIIToUTF16("Test Display Name"); |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 testing::_, | 186 testing::_, |
188 testing::_)).Times(0); | 187 testing::_)).Times(0); |
189 DiskInfoMac info = CreateDiskInfoMac( | 188 DiskInfoMac info = CreateDiskInfoMac( |
190 unique_id_, "Disk Image", display_name_, mount_point_); | 189 unique_id_, "Disk Image", display_name_, mount_point_); |
191 notifications_->UpdateDisk( | 190 notifications_->UpdateDisk( |
192 info, RemovableDeviceNotificationsMac::UPDATE_DEVICE_ADDED); | 191 info, RemovableDeviceNotificationsMac::UPDATE_DEVICE_ADDED); |
193 message_loop_.RunAllPending(); | 192 message_loop_.RunAllPending(); |
194 } | 193 } |
195 | 194 |
196 } // namespace chrome | 195 } // namespace chrome |
OLD | NEW |