Commit 81bfea37 authored by Christian Fremerey's avatar Christian Fremerey Committed by Commit Bot

[Video Capture] Remove test AllCaptureApiTypesHaveProperStringRepresentation

Besides the test being a redundant implementation of what is tested, we can rely
on compile-time checks that all cases of the enum class are handled,
so this test is not needed.

Bug: 630694
Change-Id: I618a50692b1fc7a643a7863b477a54c6fee9e93f
Reviewed-on: https://chromium-review.googlesource.com/1038743Reviewed-by: default avatarEmircan Uysaler <emircan@chromium.org>
Reviewed-by: default avatarMax Morin <maxmorin@chromium.org>
Commit-Queue: Christian Fremerey <chfremer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#555388}
parent bf2a4897
......@@ -115,38 +115,6 @@ class MediaInternalsVideoCaptureDeviceTest : public testing::Test,
MediaInternals::UpdateCallback update_cb_;
};
// TODO(chfremer): Consider removing this. This test seem be
// a duplicate implementation of the functionality under test.
// https://crbug.com/630694
#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || \
defined(OS_ANDROID)
TEST_F(MediaInternalsVideoCaptureDeviceTest,
AllCaptureApiTypesHaveProperStringRepresentation) {
using VideoCaptureApi = media::VideoCaptureApi;
std::map<VideoCaptureApi, std::string> api_to_string_map;
api_to_string_map[VideoCaptureApi::LINUX_V4L2_SINGLE_PLANE] = "V4L2 SPLANE";
api_to_string_map[VideoCaptureApi::WIN_MEDIA_FOUNDATION] = "Media Foundation";
api_to_string_map[VideoCaptureApi::WIN_MEDIA_FOUNDATION_SENSOR] =
"Media Foundation Sensor Camera";
api_to_string_map[VideoCaptureApi::WIN_DIRECT_SHOW] = "Direct Show";
api_to_string_map[VideoCaptureApi::MACOSX_AVFOUNDATION] = "AV Foundation";
api_to_string_map[VideoCaptureApi::MACOSX_DECKLINK] = "DeckLink";
api_to_string_map[VideoCaptureApi::ANDROID_API1] = "Camera API1";
api_to_string_map[VideoCaptureApi::ANDROID_API2_LEGACY] =
"Camera API2 Legacy";
api_to_string_map[VideoCaptureApi::ANDROID_API2_FULL] = "Camera API2 Full";
api_to_string_map[VideoCaptureApi::ANDROID_API2_LIMITED] =
"Camera API2 Limited";
EXPECT_EQ(static_cast<size_t>(VideoCaptureApi::UNKNOWN),
api_to_string_map.size());
for (const auto& map_entry : api_to_string_map) {
media::VideoCaptureDeviceDescriptor descriptor;
descriptor.capture_api = map_entry.first;
EXPECT_EQ(map_entry.second, descriptor.GetCaptureApiTypeString());
}
}
#endif
TEST_F(MediaInternalsVideoCaptureDeviceTest,
VideoCaptureFormatStringIsInExpectedFormat) {
// Since media internals will send video capture capabilities to JavaScript in
......
......@@ -90,10 +90,8 @@ const char* VideoCaptureDeviceDescriptor::GetCaptureApiTypeString() const {
return "Camera API2 Full";
case VideoCaptureApi::ANDROID_API2_LIMITED:
return "Camera API2 Limited";
default:
NOTREACHED() << "Unknown Video Capture API type: "
<< static_cast<int>(capture_api);
return "Unknown API";
case VideoCaptureApi::UNKNOWN:
return "Unknown";
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment