Chromium Code Reviews| 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) { |
|
James Hawkins
2012/08/29 22:46:51
nit: Document what this is testing.
thorogood
2012/08/30 01:36:28
Thanks, although someone else went and wrote this
|
| + 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)); |
|
James Hawkins
2012/08/29 22:46:51
All of these should be EXPECT_TRUE.
thorogood
2012/08/30 01:36:28
I'm no longer touching this file.
|
| + 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 |