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

Unified Diff: webrtc/modules/desktop_capture/screen_capturer_unittest.cc

Issue 2314323002: Wrap ScreenCapturer with ScreenCapturerDifferWrapper (Closed)
Patch Set: Remove debug flag, now tests should pass Created 4 years, 3 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: webrtc/modules/desktop_capture/screen_capturer_unittest.cc
diff --git a/webrtc/modules/desktop_capture/screen_capturer_unittest.cc b/webrtc/modules/desktop_capture/screen_capturer_unittest.cc
index cb639b9e91e5c987190c58a2404fd1b8f5c6893a..39d9ee15be2c28790485081bb743d4ca0bfcdc0d 100644
--- a/webrtc/modules/desktop_capture/screen_capturer_unittest.cc
+++ b/webrtc/modules/desktop_capture/screen_capturer_unittest.cc
@@ -129,15 +129,21 @@ class ScreenCapturerTest : public testing::Test {
}
#if defined(WEBRTC_WIN)
+ // Enable allow_directx_capturer in DesktopCaptureOptions, but let
+ // ScreenCapturer::Create to decide whether a DirectX capturer should be used.
+ void MaybeCreateDirectxCapturer() {
+ DesktopCaptureOptions options(DesktopCaptureOptions::CreateDefault());
+ options.set_allow_directx_capturer(true);
+ capturer_.reset(ScreenCapturer::Create(options));
+ }
+
bool CreateDirectxCapturer() {
if (!ScreenCapturerWinDirectx::IsSupported()) {
LOG(LS_WARNING) << "Directx capturer is not supported";
return false;
}
- DesktopCaptureOptions options(DesktopCaptureOptions::CreateDefault());
- options.set_allow_directx_capturer(true);
- capturer_.reset(ScreenCapturer::Create(options));
+ MaybeCreateDirectxCapturer();
return true;
}
@@ -372,6 +378,13 @@ TEST_F(ScreenCapturerTest, TwoMagnifierCapturers) {
TestCaptureUpdatedRegion({capturer_.get(), capturer2.get()});
}
+TEST_F(ScreenCapturerTest, MaybeCaptureUpdatedRegionWithDirectxCapturer) {
+ // Even DirectX capturer is not supported in current system, we should be able
+ // to select a usable capturer.
+ MaybeCreateDirectxCapturer();
+ TestCaptureUpdatedRegion();
+}
+
#endif // defined(WEBRTC_WIN)
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698