| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include <string> |
| 6 |
| 7 #include "chrome/browser/media_gallery/media_storage_util.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 |
| 10 namespace chrome { |
| 11 |
| 12 class MediaStorageUtilTest : public testing::Test { |
| 13 public: |
| 14 MediaStorageUtilTest() {} |
| 15 }; |
| 16 |
| 17 TEST_F(MediaStorageUtilTest, DeviceId) { |
| 18 std::string unique_id = "uniqueId_abcdef"; |
| 19 MediaStorageUtil::Type type = MediaStorageUtil::USB_MASS_STORAGE_WITH_DCIM; |
| 20 |
| 21 std::string device_id = MediaStorageUtil::MakeDeviceId(type, unique_id); |
| 22 ASSERT_TRUE(MediaStorageUtil::IsMediaDevice(device_id)); |
| 23 ASSERT_TRUE(MediaStorageUtil::IsRemovableDevice(device_id)); |
| 24 |
| 25 ASSERT_TRUE(MediaStorageUtil::CrackDeviceId("mtp:fake", &type, &unique_id)); |
| 26 ASSERT_EQ(MediaStorageUtil::USB_MTP, type); |
| 27 ASSERT_EQ("fake", unique_id); |
| 28 } |
| 29 |
| 30 } // namespace chrome |
| OLD | NEW |