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 "base/message_loop.h" | 5 #include "base/message_loop.h" |
6 #include "base/system_monitor/system_monitor.h" | 6 #include "base/system_monitor/system_monitor.h" |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/system_monitor/mock_removable_storage_observer.h" | 8 #include "chrome/browser/system_monitor/mock_removable_storage_observer.h" |
9 #include "chrome/browser/system_monitor/removable_storage_notifications.h" | 9 #include "chrome/browser/system_monitor/removable_storage_notifications.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 | 11 |
12 namespace chrome { | 12 namespace chrome { |
13 | 13 |
14 class TestStorageNotifications : public RemovableStorageNotifications { | 14 class TestStorageNotifications : public RemovableStorageNotifications { |
15 public: | 15 public: |
16 TestStorageNotifications() { | 16 TestStorageNotifications() { |
17 } | 17 } |
18 | 18 |
19 virtual ~TestStorageNotifications() {} | 19 virtual ~TestStorageNotifications() {} |
20 | 20 |
21 virtual bool GetDeviceInfoForPath( | 21 virtual bool GetDeviceInfoForPath( |
22 const base::FilePath& path, | 22 const base::FilePath& path, |
23 StorageInfo* device_info) const OVERRIDE { | 23 StorageInfo* device_info) const OVERRIDE { |
24 return false; | 24 return false; |
25 } | 25 } |
26 virtual uint64 GetStorageSize( | 26 virtual uint64 GetStorageSize( |
27 const FilePath::StringType& location) const OVERRIDE { | 27 const base::FilePath::StringType& location) const OVERRIDE { |
28 return 0; | 28 return 0; |
29 } | 29 } |
30 | 30 |
31 #if defined(OS_WIN) | 31 #if defined(OS_WIN) |
32 virtual bool GetMTPStorageInfoFromDeviceId( | 32 virtual bool GetMTPStorageInfoFromDeviceId( |
33 const std::string& storage_device_id, | 33 const std::string& storage_device_id, |
34 string16* device_location, | 34 string16* device_location, |
35 string16* storage_object_id) const OVERRIDE { | 35 string16* storage_object_id) const OVERRIDE { |
36 return false; | 36 return false; |
37 } | 37 } |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 EXPECT_EQ(kDeviceName2, devices[0].name); | 141 EXPECT_EQ(kDeviceName2, devices[0].name); |
142 EXPECT_EQ(kDevicePath2.value(), devices[0].location); | 142 EXPECT_EQ(kDevicePath2.value(), devices[0].location); |
143 | 143 |
144 notifications.ProcessDetach(kDeviceId2); | 144 notifications.ProcessDetach(kDeviceId2); |
145 message_loop.RunUntilIdle(); | 145 message_loop.RunUntilIdle(); |
146 devices = notifications.GetAttachedStorage(); | 146 devices = notifications.GetAttachedStorage(); |
147 EXPECT_EQ(0U, devices.size()); | 147 EXPECT_EQ(0U, devices.size()); |
148 } | 148 } |
149 | 149 |
150 } // namespace chrome | 150 } // namespace chrome |
OLD | NEW |