[M120 Migration][VD] Enable direct rendering for TVPlus
[platform/framework/web/chromium-efl.git] / components / storage_monitor / storage_info_unittest.cc
1 // Copyright 2014 The Chromium Authors
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 "components/storage_monitor/storage_info.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9
10 namespace storage_monitor {
11
12 const char kMtpDeviceId[] = "mtp:VendorModelSerial:ABC:1233:1237912873";
13 const char kUniqueId[] = "VendorModelSerial:ABC:1233:1237912873";
14 const char kImageCaptureDeviceId[] = "ic:xyz";
15
16 // Test to verify |MakeDeviceId| functionality using a sample
17 // mtp device unique id.
18 TEST(StorageInfoTest, MakeMtpDeviceId) {
19   std::string device_id =
20       StorageInfo::MakeDeviceId(StorageInfo::MTP_OR_PTP, kUniqueId);
21   ASSERT_EQ(kMtpDeviceId, device_id);
22 }
23
24 // Test to verify |CrackDeviceId| functionality using a sample
25 // mtp device id.
26 TEST(StorageInfoTest, CrackMtpDeviceId) {
27   StorageInfo::Type type;
28   std::string id;
29   ASSERT_TRUE(StorageInfo::CrackDeviceId(kMtpDeviceId, &type, &id));
30   EXPECT_EQ(kUniqueId, id);
31   EXPECT_EQ(StorageInfo::MTP_OR_PTP, type);
32 }
33
34 TEST(StorageInfoTest, TestImageCaptureDeviceId) {
35   StorageInfo::Type type;
36   std::string id;
37   ASSERT_TRUE(StorageInfo::CrackDeviceId(kImageCaptureDeviceId, &type, &id));
38   EXPECT_EQ(StorageInfo::MAC_IMAGE_CAPTURE, type);
39   EXPECT_EQ("xyz", id);
40 }
41
42 }  // namespace storage_monitor