| Index: chrome/browser/media_gallery/media_storage_util_unittest.cc
|
| diff --git a/chrome/browser/media_gallery/media_storage_util_unittest.cc b/chrome/browser/media_gallery/media_storage_util_unittest.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..dd81e4f21130983568748d63b7db7297ac4d3e81
|
| --- /dev/null
|
| +++ b/chrome/browser/media_gallery/media_storage_util_unittest.cc
|
| @@ -0,0 +1,30 @@
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include <string>
|
| +
|
| +#include "chrome/browser/media_gallery/media_storage_util.h"
|
| +#include "testing/gtest/include/gtest/gtest.h"
|
| +
|
| +namespace chrome {
|
| +
|
| +class MediaStorageUtilTest : public testing::Test {
|
| + public:
|
| + MediaStorageUtilTest() {}
|
| +};
|
| +
|
| +TEST_F(MediaStorageUtilTest, DeviceId) {
|
| + std::string unique_id = "uniqueId_abcdef";
|
| + MediaStorageUtil::Type type = MediaStorageUtil::USB_MASS_STORAGE_WITH_DCIM;
|
| +
|
| + std::string device_id = MediaStorageUtil::MakeDeviceId(type, unique_id);
|
| + ASSERT_TRUE(MediaStorageUtil::IsMediaDevice(device_id));
|
| + ASSERT_TRUE(MediaStorageUtil::IsRemovableDevice(device_id));
|
| +
|
| + ASSERT_TRUE(MediaStorageUtil::CrackDeviceId("mtp:fake", &type, &unique_id));
|
| + ASSERT_EQ(MediaStorageUtil::USB_MTP, type);
|
| + ASSERT_EQ("fake", unique_id);
|
| +}
|
| +
|
| +} // namespace chrome
|
|
|