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

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

Issue 2559583002: Enable screen capturer tests for Linux / DirectX capturer / magnifier capturer (Closed)
Patch Set: Created 4 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/desktop_capture/screen_capturer_integration_test.cc
diff --git a/webrtc/modules/desktop_capture/screen_capturer_integration_test.cc b/webrtc/modules/desktop_capture/screen_capturer_integration_test.cc
index 48c0c173b91b6e0e910cab31c339c7e0bc69c641..eae9530db5d72364ab589effd5b84e432a59e36e 100644
--- a/webrtc/modules/desktop_capture/screen_capturer_integration_test.cc
+++ b/webrtc/modules/desktop_capture/screen_capturer_integration_test.cc
@@ -42,7 +42,8 @@ namespace webrtc {
namespace {
-ACTION_P(SaveUniquePtrArg, dest) {
+ACTION_P2(SaveCaptureResult, result, dest) {
+ *result = arg0;
*dest = std::move(*arg1);
}
@@ -266,40 +267,46 @@ class ScreenCapturerIntegrationTest : public testing::Test {
// Expects |capturer| to successfully capture a frame, and returns it.
std::unique_ptr<DesktopFrame> CaptureFrame(DesktopCapturer* capturer) {
- std::unique_ptr<DesktopFrame> frame;
- EXPECT_CALL(callback_,
- OnCaptureResultPtr(DesktopCapturer::Result::SUCCESS, _))
- .WillOnce(SaveUniquePtrArg(&frame));
- capturer->CaptureFrame();
- EXPECT_TRUE(frame);
- return frame;
+ for (int i = 0; i < 10; i++) {
+ std::unique_ptr<DesktopFrame> frame;
+ DesktopCapturer::Result result;
+ EXPECT_CALL(callback_, OnCaptureResultPtr(_, _))
+ .WillOnce(SaveCaptureResult(&result, &frame));
+ capturer->CaptureFrame();
+ if (result == DesktopCapturer::Result::SUCCESS) {
Sergey Ulanov 2016/12/07 19:45:05 Verify that the callback was called, e.g. by calli
Hzj_jie 2016/12/07 20:09:30 Done.
+ EXPECT_TRUE(frame);
+ return frame;
+ } else {
+ EXPECT_FALSE(frame);
+ }
+ }
+
+ EXPECT_TRUE(false);
+ return nullptr;
}
};
-#if defined(WEBRTC_WIN)
-#define MAYBE_CaptureUpdatedRegion DISABLED_CaptureUpdatedRegion
-#else
-#define MAYBE_CaptureUpdatedRegion CaptureUpdatedRegion
-#endif
-TEST_F(ScreenCapturerIntegrationTest, MAYBE_CaptureUpdatedRegion) {
+TEST_F(ScreenCapturerIntegrationTest, CaptureUpdatedRegion) {
+#if !defined(WEBRTC_WIN)
+ // ScreenCapturerWinGdi randomly returns blank screen, the root cause is still
+ // unknown. Bug, https://bugs.chromium.org/p/webrtc/issues/detail?id=6843.
TestCaptureUpdatedRegion();
+#endif
}
-#if defined(WEBRTC_WIN)
-#define MAYBE_TwoCapturers DISABLED_TwoCapturers
-#else
-#define MAYBE_TwoCapturers TwoCapturers
-#endif
-TEST_F(ScreenCapturerIntegrationTest, MAYBE_TwoCapturers) {
+TEST_F(ScreenCapturerIntegrationTest, TwoCapturers) {
+#if !defined(WEBRTC_WIN)
+ // ScreenCapturerWinGdi randomly returns blank screen, the root cause is still
+ // unknown. Bug, https://bugs.chromium.org/p/webrtc/issues/detail?id=6843.
std::unique_ptr<DesktopCapturer> capturer2 = std::move(capturer_);
SetUp();
TestCaptureUpdatedRegion({capturer_.get(), capturer2.get()});
+#endif
}
#if defined(WEBRTC_WIN)
-TEST_F(ScreenCapturerIntegrationTest,
- DISABLED_CaptureUpdatedRegionWithDirectxCapturer) {
+TEST_F(ScreenCapturerIntegrationTest, CaptureUpdatedRegionWithDirectxCapturer) {
if (!CreateDirectxCapturer()) {
return;
}
@@ -307,7 +314,7 @@ TEST_F(ScreenCapturerIntegrationTest,
TestCaptureUpdatedRegion();
}
-TEST_F(ScreenCapturerIntegrationTest, DISABLED_TwoDirectxCapturers) {
+TEST_F(ScreenCapturerIntegrationTest, TwoDirectxCapturers) {
if (!CreateDirectxCapturer()) {
return;
}
@@ -318,10 +325,10 @@ TEST_F(ScreenCapturerIntegrationTest, DISABLED_TwoDirectxCapturers) {
}
TEST_F(ScreenCapturerIntegrationTest,
- DISABLED_CaptureUpdatedRegionWithMagnifierCapturer) {
+ CaptureUpdatedRegionWithMagnifierCapturer) {
// On Windows 8 or later, magnifier APIs return a frame with a border on test
// environment, so disable these tests.
- // Bug https://bugs.chromium.org/p/webrtc/issues/detail?id=6666
+ // Bug https://bugs.chromium.org/p/webrtc/issues/detail?id=6844
// TODO(zijiehe): Find the root cause of the border and failure, which cannot
// reproduce on my dev machine.
if (rtc::IsWindows8OrLater()) {
@@ -331,10 +338,10 @@ TEST_F(ScreenCapturerIntegrationTest,
TestCaptureUpdatedRegion();
}
-TEST_F(ScreenCapturerIntegrationTest, DISABLED_TwoMagnifierCapturers) {
+TEST_F(ScreenCapturerIntegrationTest, TwoMagnifierCapturers) {
// On Windows 8 or later, magnifier APIs return a frame with a border on test
// environment, so disable these tests.
- // Bug https://bugs.chromium.org/p/webrtc/issues/detail?id=6666
+ // Bug https://bugs.chromium.org/p/webrtc/issues/detail?id=6844
// TODO(zijiehe): Find the root cause of the border and failure, which cannot
// reproduce on my dev machine.
if (rtc::IsWindows8OrLater()) {
@@ -347,7 +354,15 @@ TEST_F(ScreenCapturerIntegrationTest, DISABLED_TwoMagnifierCapturers) {
}
TEST_F(ScreenCapturerIntegrationTest,
- DISABLED_MaybeCaptureUpdatedRegionWithDirectxCapturer) {
+ MaybeCaptureUpdatedRegionWithDirectxCapturer) {
+ if (!rtc::IsWindows8OrLater()) {
+ // ScreenCapturerWinGdi randomly returns blank screen, the root cause is
+ // still unknown. Bug,
+ // https://bugs.chromium.org/p/webrtc/issues/detail?id=6843.
+ // On Windows 7 or early version, MaybeCreateDirectxCapturer() always
+ // creates GDI capturer.
+ return;
+ }
// Even DirectX capturer is not supported in current system, we should be able
// to select a usable capturer.
MaybeCreateDirectxCapturer();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698