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

Unified Diff: remoting/host/screen_recorder_unittest.cc

Issue 6266023: Revert "Fix crashes in ChromotingHost" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 months 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/screen_recorder.cc ('k') | remoting/host/simple_host_process.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/screen_recorder_unittest.cc
diff --git a/remoting/host/screen_recorder_unittest.cc b/remoting/host/screen_recorder_unittest.cc
index 85ba54a7d9d66c84d0907d1a61b9cad3c6c48db9..c9f41230f2657a6178bd21c388ee794c35c31c3c 100644
--- a/remoting/host/screen_recorder_unittest.cc
+++ b/remoting/host/screen_recorder_unittest.cc
@@ -76,11 +76,12 @@ class ScreenRecorderTest : public testing::Test {
virtual void SetUp() {
// Capturer and Encoder are owned by ScreenRecorder.
+ capturer_ = new MockCapturer();
encoder_ = new MockEncoder();
connection_ = new MockConnectionToClient();
record_ = new ScreenRecorder(
&message_loop_, &message_loop_, &message_loop_,
- &capturer_, encoder_);
+ capturer_, encoder_);
}
protected:
@@ -88,7 +89,7 @@ class ScreenRecorderTest : public testing::Test {
scoped_refptr<MockConnectionToClient> connection_;
// The following mock objects are owned by ScreenRecorder.
- MockCapturer capturer_;
+ MockCapturer* capturer_;
MockEncoder* encoder_;
MessageLoop message_loop_;
private:
@@ -107,11 +108,11 @@ TEST_F(ScreenRecorderTest, OneRecordCycle) {
}
scoped_refptr<CaptureData> data(new CaptureData(planes, kWidth,
kHeight, kFormat));
- EXPECT_CALL(capturer_, width()).WillRepeatedly(Return(kWidth));
- EXPECT_CALL(capturer_, height()).WillRepeatedly(Return(kHeight));
+ EXPECT_CALL(*capturer_, width()).WillRepeatedly(Return(kWidth));
+ EXPECT_CALL(*capturer_, height()).WillRepeatedly(Return(kHeight));
// First the capturer is called.
- EXPECT_CALL(capturer_, CaptureInvalidRects(NotNull()))
+ EXPECT_CALL(*capturer_, CaptureInvalidRects(NotNull()))
.WillOnce(RunCallback(update_rects, data));
// Expect the encoder be called.
@@ -157,11 +158,11 @@ TEST_F(ScreenRecorderTest, StartAndStop) {
}
scoped_refptr<CaptureData> data(new CaptureData(planes, kWidth,
kHeight, kFormat));
- EXPECT_CALL(capturer_, width()).WillRepeatedly(Return(kWidth));
- EXPECT_CALL(capturer_, height()).WillRepeatedly(Return(kHeight));
+ EXPECT_CALL(*capturer_, width()).WillRepeatedly(Return(kWidth));
+ EXPECT_CALL(*capturer_, height()).WillRepeatedly(Return(kHeight));
// First the capturer is called.
- EXPECT_CALL(capturer_, CaptureInvalidRects(NotNull()))
+ EXPECT_CALL(*capturer_, CaptureInvalidRects(NotNull()))
.WillRepeatedly(RunCallback(update_rects, data));
// Expect the encoder be called.
« no previous file with comments | « remoting/host/screen_recorder.cc ('k') | remoting/host/simple_host_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698