| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/synchronization/waitable_event.h" | 8 #include "base/synchronization/waitable_event.h" |
| 9 #include "base/system_monitor/system_monitor.h" | 9 #include "base/system_monitor/system_monitor.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 const char kUniqueId[] = "VendorModelSerial:ABC:1233:1237912873"; | 24 const char kUniqueId[] = "VendorModelSerial:ABC:1233:1237912873"; |
| 25 const char kImageCaptureDeviceId[] = "ic:xyz"; | 25 const char kImageCaptureDeviceId[] = "ic:xyz"; |
| 26 | 26 |
| 27 } // namespace | 27 } // namespace |
| 28 | 28 |
| 29 class MediaStorageUtilTest : public testing::Test { | 29 class MediaStorageUtilTest : public testing::Test { |
| 30 public: | 30 public: |
| 31 void ProcessAttach(const std::string& id, | 31 void ProcessAttach(const std::string& id, |
| 32 const string16& name, | 32 const string16& name, |
| 33 const FilePath::StringType& location) { | 33 const FilePath::StringType& location) { |
| 34 RemovableStorageNotifications::GetInstance()->ProcessAttach( | 34 notifications_.ProcessAttach(id, name, location); |
| 35 id, name, location); | |
| 36 } | 35 } |
| 37 | 36 |
| 38 private: | 37 private: |
| 39 chrome::test::TestRemovableStorageNotifications notifications_; | 38 chrome::test::TestRemovableStorageNotifications notifications_; |
| 40 }; | 39 }; |
| 41 | 40 |
| 42 // Test to verify |MediaStorageUtil::MakeDeviceId| functionality using a sample | 41 // Test to verify |MediaStorageUtil::MakeDeviceId| functionality using a sample |
| 43 // mtp device unique id. | 42 // mtp device unique id. |
| 44 TEST_F(MediaStorageUtilTest, MakeMtpDeviceId) { | 43 TEST_F(MediaStorageUtilTest, MakeMtpDeviceId) { |
| 45 std::string device_id = | 44 std::string device_id = |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 event.Reset(); | 102 event.Reset(); |
| 104 MediaStorageUtil::FilterAttachedDevices(&devices, | 103 MediaStorageUtil::FilterAttachedDevices(&devices, |
| 105 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&event))); | 104 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&event))); |
| 106 loop.RunUntilIdle(); | 105 loop.RunUntilIdle(); |
| 107 event.Wait(); | 106 event.Wait(); |
| 108 | 107 |
| 109 EXPECT_TRUE(devices.find(kImageCaptureDeviceId) != devices.end()); | 108 EXPECT_TRUE(devices.find(kImageCaptureDeviceId) != devices.end()); |
| 110 } | 109 } |
| 111 | 110 |
| 112 } // namespace chrome | 111 } // namespace chrome |
| OLD | NEW |