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 30 matching lines...) Expand all Loading... |
41 } // namespace | 41 } // namespace |
42 | 42 |
43 class RemovableDeviceNotificationsMacTest : public testing::Test { | 43 class RemovableDeviceNotificationsMacTest : public testing::Test { |
44 public: | 44 public: |
45 RemovableDeviceNotificationsMacTest() | 45 RemovableDeviceNotificationsMacTest() |
46 : message_loop_(MessageLoop::TYPE_IO), | 46 : message_loop_(MessageLoop::TYPE_IO), |
47 file_thread_(content::BrowserThread::FILE, &message_loop_) { | 47 file_thread_(content::BrowserThread::FILE, &message_loop_) { |
48 } | 48 } |
49 | 49 |
50 virtual void SetUp() OVERRIDE { | 50 virtual void SetUp() OVERRIDE { |
51 base::SystemMonitor::AllocateSystemIOPorts(); | |
52 system_monitor_.reset(new base::SystemMonitor()); | 51 system_monitor_.reset(new base::SystemMonitor()); |
53 | 52 |
54 mock_devices_changed_observer_.reset(new base::MockDevicesChangedObserver); | 53 mock_devices_changed_observer_.reset(new base::MockDevicesChangedObserver); |
55 system_monitor_->AddDevicesChangedObserver( | 54 system_monitor_->AddDevicesChangedObserver( |
56 mock_devices_changed_observer_.get()); | 55 mock_devices_changed_observer_.get()); |
57 | 56 |
58 notifications_ = new RemovableDeviceNotificationsMac; | 57 notifications_ = new RemovableDeviceNotificationsMac; |
59 | 58 |
60 unique_id_ = "test_id"; | 59 unique_id_ = "test_id"; |
61 display_name_ = ASCIIToUTF16("Test Display Name"); | 60 display_name_ = ASCIIToUTF16("Test Display Name"); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 mount_point_.AppendASCII("foo"), &info)); | 167 mount_point_.AppendASCII("foo"), &info)); |
169 EXPECT_EQ(info.device_id, device_id_); | 168 EXPECT_EQ(info.device_id, device_id_); |
170 EXPECT_EQ(info.name, display_name_); | 169 EXPECT_EQ(info.name, display_name_); |
171 EXPECT_EQ(info.location, mount_point_.value()); | 170 EXPECT_EQ(info.location, mount_point_.value()); |
172 | 171 |
173 EXPECT_FALSE(notifications_->GetDeviceInfoForPath( | 172 EXPECT_FALSE(notifications_->GetDeviceInfoForPath( |
174 FilePath("/non/matching/path"), &info)); | 173 FilePath("/non/matching/path"), &info)); |
175 } | 174 } |
176 | 175 |
177 } // namespace chrome | 176 } // namespace chrome |
OLD | NEW |