| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2015 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 "content/common/media/media_devices.h" |
| 6 #include "media/audio/audio_device_description.h" |
| 7 #include "media/capture/video/video_capture_device_descriptor.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 |
| 10 namespace content { |
| 11 |
| 12 TEST(MediaDevicesTest, MediaDeviceInfoFromAudioDescription) { |
| 13 const std::string kFakeDeviceID = "fake_device_id"; |
| 14 const std::string kFakeLabel = "fake_label"; |
| 15 const std::string kFakeGroupID = "fake_group_id"; |
| 16 |
| 17 media::AudioDeviceDescription description(kFakeLabel, kFakeDeviceID, |
| 18 kFakeGroupID); |
| 19 MediaDeviceInfo device_info(description); |
| 20 EXPECT_EQ(kFakeDeviceID, device_info.device_id); |
| 21 EXPECT_EQ(kFakeLabel, device_info.label); |
| 22 EXPECT_EQ(kFakeGroupID, device_info.group_id); |
| 23 } |
| 24 |
| 25 TEST(MediaDevicesTest, MediaDeviceInfoFromVideoDescriptor) { |
| 26 media::VideoCaptureDeviceDescriptor descriptor( |
| 27 "display_name", "device_id", "model_id", media::VideoCaptureApi::UNKNOWN); |
| 28 |
| 29 // TODO(guidou): Add test for group ID when supported. See crbug.com/627793. |
| 30 MediaDeviceInfo device_info(descriptor); |
| 31 EXPECT_EQ(descriptor.device_id, device_info.device_id); |
| 32 EXPECT_EQ(descriptor.GetNameAndModel(), device_info.label); |
| 33 } |
| 34 |
| 35 } // namespace content |
| OLD | NEW |