Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(303)

Side by Side Diff: content/common/media/media_devices_unittest.cc

Issue 2650153003: Add constructors and operators to MediaDeviceInfo. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/common/media/media_devices.cc ('k') | content/test/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « content/common/media/media_devices.cc ('k') | content/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698