| Index: remoting/host/video_frame_capturer_unittest.cc
|
| diff --git a/remoting/host/video_frame_capturer_unittest.cc b/remoting/host/video_frame_capturer_unittest.cc
|
| index 4ad0a1b8ca5a937056883a01a6823f0cc49da4fa..0b10161b1048072dacaf33bacbc18b93681e2ff8 100644
|
| --- a/remoting/host/video_frame_capturer_unittest.cc
|
| +++ b/remoting/host/video_frame_capturer_unittest.cc
|
| @@ -14,14 +14,10 @@
|
| #include "testing/gmock/include/gmock/gmock.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| -namespace remoting {
|
| -
|
| -namespace {
|
| +using ::testing::_;
|
| +using ::testing::AnyNumber;
|
|
|
| -void IgnoreCursorShapeChanged(scoped_ptr<protocol::CursorShapeInfo> info) {
|
| -}
|
| -
|
| -} // namespace
|
| +namespace remoting {
|
|
|
| MATCHER(DirtyRegionIsNonEmptyRect, "") {
|
| const SkRegion& dirty_region = arg->dirty_region();
|
| @@ -39,23 +35,23 @@ class VideoFrameCapturerTest : public testing::Test {
|
| }
|
|
|
| scoped_ptr<VideoFrameCapturer> capturer_;
|
| - MockCaptureCompletedCallback capture_completed_callback_;
|
| + MockVideoFrameCapturerDelegate delegate_;
|
| };
|
|
|
| TEST_F(VideoFrameCapturerTest, StartCapturer) {
|
| - capturer_->Start(base::Bind(&IgnoreCursorShapeChanged));
|
| + capturer_->Start(&delegate_);
|
| capturer_->Stop();
|
| }
|
|
|
| TEST_F(VideoFrameCapturerTest, Capture) {
|
| // Assume that Start() treats the screen as invalid initially.
|
| - EXPECT_CALL(capture_completed_callback_,
|
| - CaptureCompletedPtr(DirtyRegionIsNonEmptyRect()));
|
| + EXPECT_CALL(delegate_,
|
| + OnCaptureCompleted(DirtyRegionIsNonEmptyRect()));
|
| + EXPECT_CALL(delegate_, OnCursorShapeChangedPtr(_))
|
| + .Times(AnyNumber());
|
|
|
| - capturer_->Start(base::Bind(&IgnoreCursorShapeChanged));
|
| - capturer_->CaptureInvalidRegion(base::Bind(
|
| - &MockCaptureCompletedCallback::CaptureCompleted,
|
| - base::Unretained(&capture_completed_callback_)));
|
| + capturer_->Start(&delegate_);
|
| + capturer_->CaptureInvalidRegion();
|
| capturer_->Stop();
|
| }
|
|
|
|
|