Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Unified Diff: remoting/host/video_frame_capturer_unittest.cc

Issue 11363128: Converted VideoFrameCapturer callbacks into a VideoFrameCapturer::Delegate interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More Mac compilation issues. Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/video_frame_capturer_mac_unittest.cc ('k') | remoting/host/video_frame_capturer_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « remoting/host/video_frame_capturer_mac_unittest.cc ('k') | remoting/host/video_frame_capturer_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698