| 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 815c7f53afed130259803862731716836b99002a..9f09b072174a1b2ca626cf6874b6f11a2a47aef9 100644
|
| --- a/webrtc/modules/desktop_capture/screen_capturer_mac_unittest.cc
|
| +++ b/webrtc/modules/desktop_capture/screen_capturer_mac_unittest.cc
|
| @@ -32,11 +32,11 @@ namespace webrtc {
|
| class ScreenCapturerMacTest : public testing::Test {
|
| public:
|
| // Verifies that the whole screen is initially dirty.
|
| - void CaptureDoneCallback1(DesktopFrame* frame);
|
| + void CaptureDoneCallback1(std::unique_ptr<DesktopFrame>* frame);
|
|
|
| // Verifies that a rectangle explicitly marked as dirty is propagated
|
| // correctly.
|
| - void CaptureDoneCallback2(DesktopFrame* frame);
|
| + void CaptureDoneCallback2(std::unique_ptr<DesktopFrame>* frame);
|
|
|
| protected:
|
| void SetUp() override {
|
| @@ -49,37 +49,33 @@ class ScreenCapturerMacTest : public testing::Test {
|
| };
|
|
|
| void ScreenCapturerMacTest::CaptureDoneCallback1(
|
| - DesktopFrame* frame) {
|
| - std::unique_ptr<DesktopFrame> owned_frame(frame);
|
| -
|
| + std::unique_ptr<DesktopFrame>* 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(
|
| - DesktopFrame* frame) {
|
| - std::unique_ptr<DesktopFrame> owned_frame(frame);
|
| -
|
| + std::unique_ptr<DesktopFrame>* 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_, OnCaptureCompleted(_))
|
| + EXPECT_CALL(callback_, OnCaptureCompletedPtr(_))
|
| .Times(2)
|
| .WillOnce(Invoke(this, &ScreenCapturerMacTest::CaptureDoneCallback1))
|
| .WillOnce(Invoke(this, &ScreenCapturerMacTest::CaptureDoneCallback2));
|
|
|