| 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/utf_string_conversions.h" | 6 #include "base/utf_string_conversions.h" |
| 7 #include "chrome/browser/system_monitor/removable_storage_notifications.h" | 7 #include "chrome/browser/system_monitor/removable_storage_notifications.h" |
| 8 #include "chrome/browser/system_monitor/removable_storage_notifications_test_uti
l.h" | 8 #include "chrome/browser/system_monitor/removable_storage_notifications_test_uti
l.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| 11 namespace chrome { | 11 namespace chrome { |
| 12 | 12 |
| 13 class TestStorageNotifications : public RemovableStorageNotifications { | 13 class TestStorageNotifications : public RemovableStorageNotifications { |
| 14 public: | 14 public: |
| 15 TestStorageNotifications() : RemovableStorageNotifications() {} | 15 TestStorageNotifications() : RemovableStorageNotifications() {} |
| 16 ~TestStorageNotifications() {} | 16 ~TestStorageNotifications() {} |
| 17 | 17 |
| 18 virtual bool GetDeviceInfoForPath( | 18 virtual bool GetDeviceInfoForPath( |
| 19 const FilePath& path, | 19 const FilePath& path, |
| 20 base::SystemMonitor::RemovableStorageInfo* device_info) const OVERRIDE { | 20 StorageInfo* device_info) const OVERRIDE { |
| 21 return false; | 21 return false; |
| 22 } | 22 } |
| 23 virtual uint64 GetStorageSize(const std::string& location) const OVERRIDE { | 23 virtual uint64 GetStorageSize(const std::string& location) const OVERRIDE { |
| 24 return 0; | 24 return 0; |
| 25 } | 25 } |
| 26 | 26 |
| 27 void ProcessAttach(const std::string& id, | 27 void ProcessAttach(const std::string& id, |
| 28 const string16& name, | 28 const string16& name, |
| 29 const FilePath::StringType& location) { | 29 const FilePath::StringType& location) { |
| 30 RemovableStorageNotifications::ProcessAttach(id, name, location); | 30 RemovableStorageNotifications::ProcessAttach(id, name, location); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 EXPECT_EQ(kDeviceName2, devices[0].name); | 125 EXPECT_EQ(kDeviceName2, devices[0].name); |
| 126 EXPECT_EQ(kDevicePath2.value(), devices[0].location); | 126 EXPECT_EQ(kDevicePath2.value(), devices[0].location); |
| 127 | 127 |
| 128 notifications.ProcessDetach(kDeviceId2); | 128 notifications.ProcessDetach(kDeviceId2); |
| 129 message_loop.RunUntilIdle(); | 129 message_loop.RunUntilIdle(); |
| 130 devices = notifications.GetAttachedStorage(); | 130 devices = notifications.GetAttachedStorage(); |
| 131 EXPECT_EQ(0U, devices.size()); | 131 EXPECT_EQ(0U, devices.size()); |
| 132 } | 132 } |
| 133 | 133 |
| 134 } // namespace chrome | 134 } // namespace chrome |
| OLD | NEW |