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

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: Fix several lint errors Created 4 years, 4 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..49fcb8aafbe0a2da8a70d4a61f1f0e4ce59356eb 100644
--- a/webrtc/modules/desktop_capture/screen_capturer_unittest.cc
+++ b/webrtc/modules/desktop_capture/screen_capturer_unittest.cc
@@ -9,6 +9,7 @@
*/
#include <memory>
+#include <utility>
#include "webrtc/modules/desktop_capture/screen_capturer.h"
@@ -75,8 +76,8 @@ ACTION_P(SaveUniquePtrArg, dest) {
TEST_F(ScreenCapturerTest, GetScreenListAndSelectScreen) {
webrtc::ScreenCapturer::ScreenList screens;
EXPECT_TRUE(capturer_->GetScreenList(&screens));
- for(webrtc::ScreenCapturer::ScreenList::iterator it = screens.begin();
- it != screens.end(); ++it) {
+ for (webrtc::ScreenCapturer::ScreenList::iterator it = screens.begin();
+ it != screens.end(); ++it) {
EXPECT_TRUE(capturer_->SelectScreen(it->id));
}
}
@@ -144,6 +145,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
« no previous file with comments | « webrtc/modules/desktop_capture/desktop_capture.gypi ('k') | webrtc/modules/desktop_capture/screen_capturer_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698