From 569f4e7e58fca030a526142e138d97f977d77fd4 Mon Sep 17 00:00:00 2001 From: Taylor Brandstetter Date: Fri, 13 Oct 2017 12:53:51 -0700 Subject: [PATCH] Disable some flaky screen/desktop capture tests on Linux. Specifically: ScreenCapturerTest.StartCapture ScreenCapturerTest.Capture WindowCapturerTest.Capture Also adding a DCHECK for the capturer actually being created, since it seems like that's the problem. TBR=zijiehe@chromium.org Bug: webrtc:7830 Change-Id: I200dc0c15f5039b95f591597bc00d3f1084ae876 Reviewed-on: https://webrtc-review.googlesource.com/9562 Reviewed-by: Taylor Brandstetter Commit-Queue: Taylor Brandstetter Cr-Commit-Position: refs/heads/master@{#20297} --- .../desktop_capture/screen_capturer_unittest.cc | 16 ++++++++++++++-- .../desktop_capture/window_capturer_unittest.cc | 9 ++++++++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/modules/desktop_capture/screen_capturer_unittest.cc b/modules/desktop_capture/screen_capturer_unittest.cc index 6a28c537bb..d8123caa16 100644 --- a/modules/desktop_capture/screen_capturer_unittest.cc +++ b/modules/desktop_capture/screen_capturer_unittest.cc @@ -35,6 +35,7 @@ class ScreenCapturerTest : public testing::Test { void SetUp() override { capturer_ = DesktopCapturer::CreateScreenCapturer( DesktopCaptureOptions::CreateDefault()); + RTC_DCHECK(capturer_); } protected: @@ -109,11 +110,22 @@ TEST_F(ScreenCapturerTest, GetScreenListAndSelectScreen) { } } -TEST_F(ScreenCapturerTest, StartCapturer) { +// Flaky on Linux. See: crbug.com/webrtc/7830 +#if defined(WEBRTC_LINUX) +#define MAYBE_StartCapturer DISABLED_StartCaptuerer +#else +#define MAYBE_StartCapturer StartCapturer +#endif +TEST_F(ScreenCapturerTest, MAYBE_StartCapturer) { capturer_->Start(&callback_); } -TEST_F(ScreenCapturerTest, Capture) { +#if defined(WEBRTC_LINUX) +#define MAYBE_Capture DISABLED_Capture +#else +#define MAYBE_Capture Capture +#endif +TEST_F(ScreenCapturerTest, MAYBE_Capture) { // Assume that Start() treats the screen as invalid initially. std::unique_ptr frame; EXPECT_CALL(callback_, diff --git a/modules/desktop_capture/window_capturer_unittest.cc b/modules/desktop_capture/window_capturer_unittest.cc index f042df407e..0c31fb7823 100644 --- a/modules/desktop_capture/window_capturer_unittest.cc +++ b/modules/desktop_capture/window_capturer_unittest.cc @@ -24,6 +24,7 @@ class WindowCapturerTest : public testing::Test, void SetUp() override { capturer_ = DesktopCapturer::CreateWindowCapturer( DesktopCaptureOptions::CreateDefault()); + RTC_DCHECK(capturer_); } void TearDown() override {} @@ -50,6 +51,12 @@ TEST_F(WindowCapturerTest, Enumerate) { } } +// Flaky on Linux. See: crbug.com/webrtc/7830 +#if defined(WEBRTC_LINUX) +#define MAYBE_Capture DISABLED_Capture +#else +#define MAYBE_Capture Capture +#endif // Verify we can capture a window. // // TODO(sergeyu): Currently this test just looks at the windows that already @@ -57,7 +64,7 @@ TEST_F(WindowCapturerTest, Enumerate) { // is no easy cross-platform way to create new windows (potentially we could // have a python script showing Tk dialog, but launching code will differ // between platforms). -TEST_F(WindowCapturerTest, Capture) { +TEST_F(WindowCapturerTest, MAYBE_Capture) { DesktopCapturer::SourceList sources; capturer_->Start(this); EXPECT_TRUE(capturer_->GetSourceList(&sources));