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

Unified Diff: media/video/capture/mac/video_capture_device_factory_mac_unittest.mm

Issue 265263004: Mac Video Capture Device: split VCD into VCD and Factory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: perkj@s suggestions and nits. Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: media/video/capture/mac/video_capture_device_factory_mac_unittest.mm
diff --git a/media/video/capture/mac/video_capture_device_factory_mac_unittest.mm b/media/video/capture/mac/video_capture_device_factory_mac_unittest.mm
new file mode 100644
index 0000000000000000000000000000000000000000..6aa23a940301c911379c45168b4b67391f2693e3
--- /dev/null
+++ b/media/video/capture/mac/video_capture_device_factory_mac_unittest.mm
@@ -0,0 +1,42 @@
+// Copyright 2014 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 "base/command_line.h"
+#include "media/base/media_switches.h"
+#import "media/video/capture/mac/avfoundation_glue.h"
+#include "media/video/capture/mac/video_capture_device_factory_mac.h"
+#include "media/video/capture/mac/video_capture_device_mac.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace media {
+
+class VideoCaptureDeviceFactoryMacTest : public testing::Test {
+ virtual void SetUp() {
+ CommandLine::ForCurrentProcess()->AppendSwitch(
+ switches::kEnableAVFoundation);
+ }
+};
+
+TEST_F(VideoCaptureDeviceFactoryMacTest, ListDevicesAVFoundation) {
+ if (!AVFoundationGlue::IsAVFoundationSupported()) {
+ DVLOG(1) << "AVFoundation not supported, skipping test.";
+ return;
+ }
+ VideoCaptureDeviceFactoryMac video_capture_device_factory;
+
+ VideoCaptureDevice::Names names;
+ video_capture_device_factory.GetDeviceNames(&names);
+ if (!names.size()) {
+ DVLOG(1) << "No camera available. Exiting test.";
+ return;
+ }
+ // There should be no blacklisted devices, i.e. QTKit.
+ std::string device_vid;
+ for (VideoCaptureDevice::Names::const_iterator it = names.begin();
+ it != names.end(); ++it) {
+ EXPECT_EQ(it->capture_api_type(), VideoCaptureDevice::Name::AVFOUNDATION);
+ }
+}
+
+}; // namespace media

Powered by Google App Engine
This is Rietveld 408576698