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 // RemovableDeviceNotificationsLinux unit tests. | 5 // RemovableDeviceNotificationsLinux unit tests. |
6 | 6 |
7 #include "chrome/browser/system_monitor/removable_device_notifications_linux.h" | 7 #include "chrome/browser/system_monitor/removable_device_notifications_linux.h" |
8 | 8 |
9 #include <mntent.h> | 9 #include <mntent.h> |
10 #include <stdio.h> | 10 #include <stdio.h> |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 RemovableDeviceNotificationsLinuxTestWrapper(const base::FilePath& path, | 140 RemovableDeviceNotificationsLinuxTestWrapper(const base::FilePath& path, |
141 MessageLoop* message_loop) | 141 MessageLoop* message_loop) |
142 : RemovableDeviceNotificationsLinux(path, &GetDeviceInfo), | 142 : RemovableDeviceNotificationsLinux(path, &GetDeviceInfo), |
143 message_loop_(message_loop) { | 143 message_loop_(message_loop) { |
144 } | 144 } |
145 | 145 |
146 private: | 146 private: |
147 // Avoids code deleting the object while there are references to it. | 147 // Avoids code deleting the object while there are references to it. |
148 // Aside from the base::RefCountedThreadSafe friend class, any attempts to | 148 // Aside from the base::RefCountedThreadSafe friend class, any attempts to |
149 // call this dtor will result in a compile-time error. | 149 // call this dtor will result in a compile-time error. |
150 ~RemovableDeviceNotificationsLinuxTestWrapper() {} | 150 virtual ~RemovableDeviceNotificationsLinuxTestWrapper() {} |
151 | 151 |
152 virtual void OnFilePathChanged(const base::FilePath& path, | 152 virtual void OnFilePathChanged(const base::FilePath& path, |
153 bool error) OVERRIDE { | 153 bool error) OVERRIDE { |
154 RemovableDeviceNotificationsLinux::OnFilePathChanged(path, error); | 154 RemovableDeviceNotificationsLinux::OnFilePathChanged(path, error); |
155 message_loop_->PostTask(FROM_HERE, MessageLoop::QuitClosure()); | 155 message_loop_->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
156 } | 156 } |
157 | 157 |
158 MessageLoop* message_loop_; | 158 MessageLoop* message_loop_; |
159 | 159 |
160 DISALLOW_COPY_AND_ASSIGN(RemovableDeviceNotificationsLinuxTestWrapper); | 160 DISALLOW_COPY_AND_ASSIGN(RemovableDeviceNotificationsLinuxTestWrapper); |
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 notifier()->GetStorageSize(test_path_a.value())); | 693 notifier()->GetStorageSize(test_path_a.value())); |
694 EXPECT_EQ(GetDevicePartitionSize(kDeviceNoDCIM), | 694 EXPECT_EQ(GetDevicePartitionSize(kDeviceNoDCIM), |
695 notifier()->GetStorageSize(test_path_b.value())); | 695 notifier()->GetStorageSize(test_path_b.value())); |
696 EXPECT_EQ(GetDevicePartitionSize(kInvalidPath), | 696 EXPECT_EQ(GetDevicePartitionSize(kInvalidPath), |
697 notifier()->GetStorageSize(kInvalidPath)); | 697 notifier()->GetStorageSize(kInvalidPath)); |
698 } | 698 } |
699 | 699 |
700 } // namespace | 700 } // namespace |
701 | 701 |
702 } // namespace chrome | 702 } // namespace chrome |
OLD | NEW |