Index: webrtc/modules/desktop_capture/screen_capturer_mac_unittest.cc |
diff --git a/webrtc/modules/desktop_capture/screen_capturer_mac_unittest.cc b/webrtc/modules/desktop_capture/screen_capturer_mac_unittest.cc |
index 47e721999666f1d0bbf96c8ce059426c0f563409..815c7f53afed130259803862731716836b99002a 100644 |
--- a/webrtc/modules/desktop_capture/screen_capturer_mac_unittest.cc |
+++ b/webrtc/modules/desktop_capture/screen_capturer_mac_unittest.cc |
@@ -32,13 +32,11 @@ |
class ScreenCapturerMacTest : public testing::Test { |
public: |
// Verifies that the whole screen is initially dirty. |
- void CaptureDoneCallback1(DesktopCapturer::Result result, |
- std::unique_ptr<DesktopFrame>* frame); |
+ void CaptureDoneCallback1(DesktopFrame* frame); |
// Verifies that a rectangle explicitly marked as dirty is propagated |
// correctly. |
- void CaptureDoneCallback2(DesktopCapturer::Result result, |
- std::unique_ptr<DesktopFrame>* frame); |
+ void CaptureDoneCallback2(DesktopFrame* frame); |
protected: |
void SetUp() override { |
@@ -51,40 +49,37 @@ |
}; |
void ScreenCapturerMacTest::CaptureDoneCallback1( |
- DesktopCapturer::Result result, |
- std::unique_ptr<DesktopFrame>* frame) { |
- EXPECT_EQ(result, DesktopCapturer::Result::SUCCESS); |
+ DesktopFrame* frame) { |
+ std::unique_ptr<DesktopFrame> owned_frame(frame); |
MacDesktopConfiguration config = MacDesktopConfiguration::GetCurrent( |
MacDesktopConfiguration::BottomLeftOrigin); |
// Verify that the region contains full frame. |
- DesktopRegion::Iterator it((*frame)->updated_region()); |
+ DesktopRegion::Iterator it(frame->updated_region()); |
EXPECT_TRUE(!it.IsAtEnd() && it.rect().equals(config.pixel_bounds)); |
} |
void ScreenCapturerMacTest::CaptureDoneCallback2( |
- DesktopCapturer::Result result, |
- std::unique_ptr<DesktopFrame>* frame) { |
- EXPECT_EQ(result, DesktopCapturer::Result::SUCCESS); |
+ DesktopFrame* frame) { |
+ std::unique_ptr<DesktopFrame> owned_frame(frame); |
MacDesktopConfiguration config = MacDesktopConfiguration::GetCurrent( |
MacDesktopConfiguration::BottomLeftOrigin); |
int width = config.pixel_bounds.width(); |
int height = config.pixel_bounds.height(); |
- EXPECT_EQ(width, (*frame)->size().width()); |
- EXPECT_EQ(height, (*frame)->size().height()); |
- EXPECT_TRUE((*frame)->data() != NULL); |
+ EXPECT_EQ(width, frame->size().width()); |
+ EXPECT_EQ(height, frame->size().height()); |
+ EXPECT_TRUE(frame->data() != NULL); |
// Depending on the capture method, the screen may be flipped or not, so |
// the stride may be positive or negative. |
EXPECT_EQ(static_cast<int>(sizeof(uint32_t) * width), |
- abs((*frame)->stride())); |
+ abs(frame->stride())); |
} |
TEST_F(ScreenCapturerMacTest, Capture) { |
- EXPECT_CALL(callback_, |
- OnCaptureResultPtr(DesktopCapturer::Result::SUCCESS, _)) |
+ EXPECT_CALL(callback_, OnCaptureCompleted(_)) |
.Times(2) |
.WillOnce(Invoke(this, &ScreenCapturerMacTest::CaptureDoneCallback1)) |
.WillOnce(Invoke(this, &ScreenCapturerMacTest::CaptureDoneCallback2)); |