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));