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

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

Issue 2099123002: [Chromoting] Improve DirectX capturer to support multiple outputs (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Resolve review comments Created 4 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
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 4d7799cc686ba54966f32e8571c976f02257b56f..b65e52b093e27f3b7217348c976bc554985bf91d 100644
--- a/webrtc/modules/desktop_capture/screen_capturer_unittest.cc
+++ b/webrtc/modules/desktop_capture/screen_capturer_unittest.cc
@@ -144,6 +144,40 @@ TEST_F(ScreenCapturerTest, UseMagnifier) {
ASSERT_TRUE(frame);
}
+TEST_F(ScreenCapturerTest, UseDirectxCapturer) {
+ DesktopCaptureOptions options(DesktopCaptureOptions::CreateDefault());
+ options.set_allow_directx_capturer(true);
+ capturer_.reset(ScreenCapturer::Create(options));
+
+ std::unique_ptr<DesktopFrame> frame;
+ EXPECT_CALL(callback_,
+ OnCaptureResultPtr(DesktopCapturer::Result::SUCCESS, _))
+ .WillOnce(SaveUniquePtrArg(&frame));
+
+ capturer_->Start(&callback_);
+ capturer_->Capture(DesktopRegion());
+ ASSERT_TRUE(frame);
+}
+
+TEST_F(ScreenCapturerTest, UseDirectxCapturerWithSharedBuffers) {
+ DesktopCaptureOptions options(DesktopCaptureOptions::CreateDefault());
+ options.set_allow_directx_capturer(true);
+ capturer_.reset(ScreenCapturer::Create(options));
+
+ std::unique_ptr<DesktopFrame> frame;
+ EXPECT_CALL(callback_,
+ OnCaptureResultPtr(DesktopCapturer::Result::SUCCESS, _))
+ .WillOnce(SaveUniquePtrArg(&frame));
+
+ capturer_->Start(&callback_);
+ capturer_->SetSharedMemoryFactory(
+ std::unique_ptr<SharedMemoryFactory>(new FakeSharedMemoryFactory()));
+ capturer_->Capture(DesktopRegion());
+ ASSERT_TRUE(frame);
+ ASSERT_TRUE(frame->shared_memory());
+ EXPECT_EQ(frame->shared_memory()->id(), kTestSharedMemoryId);
+}
+
#endif // defined(WEBRTC_WIN)
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698