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

Unified Diff: media/video/capture/video_capture_device_unittest.cc

Issue 17402002: Reconnect support for DirectShow video capture devices in parallel to MediaFoundation ones. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added check for Windows version in unittests, Capture Driver Api is DS if Windows version < 7 Created 7 years, 5 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
« no previous file with comments | « media/video/capture/video_capture_device.h ('k') | media/video/capture/win/video_capture_device_mf_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/video/capture/video_capture_device_unittest.cc
diff --git a/media/video/capture/video_capture_device_unittest.cc b/media/video/capture/video_capture_device_unittest.cc
index 696c51c4e79ecb6e2c4b95e9cf8efda259a4e8c5..f0692f24d75e1346be2519e208fe648601d731da 100644
--- a/media/video/capture/video_capture_device_unittest.cc
+++ b/media/video/capture/video_capture_device_unittest.cc
@@ -15,6 +15,7 @@
#if defined(OS_WIN)
#include "base/win/scoped_com_initializer.h"
+#include "base/win/windows_version.h"
#endif
#if defined(OS_ANDROID)
@@ -127,7 +128,15 @@ class VideoCaptureDeviceTest : public testing::Test {
};
TEST_F(VideoCaptureDeviceTest, OpenInvalidDevice) {
+#if defined(OS_WIN)
+ VideoCaptureDevice::Name::CaptureApiType api_type =
+ (base::win::GetVersion() < base::win::VERSION_WIN7)
+ ? VideoCaptureDevice::Name::DIRECT_SHOW
+ : VideoCaptureDevice::Name::MEDIA_FOUNDATION;
+ VideoCaptureDevice::Name device_name("jibberish", "jibberish", api_type);
+#else
VideoCaptureDevice::Name device_name("jibberish", "jibberish");
+#endif
VideoCaptureDevice* device = VideoCaptureDevice::Create(device_name);
EXPECT_TRUE(device == NULL);
}
@@ -144,7 +153,7 @@ TEST_F(VideoCaptureDeviceTest, CaptureVGA) {
ASSERT_FALSE(device.get() == NULL);
// Get info about the new resolution.
- EXPECT_CALL(*frame_observer_, OnFrameInfo(640, 480, 30, _))
+ EXPECT_CALL(*frame_observer_, OnFrameInfo(640, 480, _, _))
.Times(1);
EXPECT_CALL(*frame_observer_, OnErr())
@@ -254,7 +263,7 @@ TEST_F(VideoCaptureDeviceTest, DeAllocateCameraWhileRunning) {
EXPECT_CALL(*frame_observer_, OnErr())
.Times(0);
// Get info about the new resolution.
- EXPECT_CALL(*frame_observer_, OnFrameInfo(640, 480, 30, _));
+ EXPECT_CALL(*frame_observer_, OnFrameInfo(640, 480, 15, _));
device->Allocate(640, 480, 30, frame_observer_.get());
« no previous file with comments | « media/video/capture/video_capture_device.h ('k') | media/video/capture/win/video_capture_device_mf_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698