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

Unified Diff: content/browser/renderer_host/media/video_capture_host_unittest.cc

Issue 16294003: Update content/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 7 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
Index: content/browser/renderer_host/media/video_capture_host_unittest.cc
diff --git a/content/browser/renderer_host/media/video_capture_host_unittest.cc b/content/browser/renderer_host/media/video_capture_host_unittest.cc
index 6da2b9fc3b2c77e6169a11871036f67b87a42594..3f35988f767b2fbaee00989392333b58c3c95a4d 100644
--- a/content/browser/renderer_host/media/video_capture_host_unittest.cc
+++ b/content/browser/renderer_host/media/video_capture_host_unittest.cc
@@ -223,10 +223,10 @@ class VideoCaptureHostTest : public testing::Test {
virtual void TearDown() OVERRIDE {
// Verifies and removes the expectations on host_ and
// returns true iff successful.
- Mock::VerifyAndClearExpectations(host_);
+ Mock::VerifyAndClearExpectations(host_.get());
- EXPECT_CALL(*host_, OnStateChanged(kDeviceId,
- VIDEO_CAPTURE_STATE_STOPPED))
+ EXPECT_CALL(*host_.get(),
+ OnStateChanged(kDeviceId, VIDEO_CAPTURE_STATE_STOPPED))
.Times(AnyNumber());
// Simulate closing the IPC channel.
@@ -247,21 +247,19 @@ class VideoCaptureHostTest : public testing::Test {
void StartCapture() {
InSequence s;
// 1. First - get info about the new resolution
- EXPECT_CALL(*host_, OnDeviceInfo(kDeviceId));
+ EXPECT_CALL(*host_.get(), OnDeviceInfo(kDeviceId));
// 2. Change state to started
- EXPECT_CALL(*host_, OnStateChanged(kDeviceId,
- VIDEO_CAPTURE_STATE_STARTED));
+ EXPECT_CALL(*host_.get(),
+ OnStateChanged(kDeviceId, VIDEO_CAPTURE_STATE_STARTED));
// 3. Newly created buffers will arrive.
- EXPECT_CALL(*host_, OnNewBufferCreated(kDeviceId, _, _, _))
- .Times(AnyNumber())
- .WillRepeatedly(Return());
+ EXPECT_CALL(*host_.get(), OnNewBufferCreated(kDeviceId, _, _, _))
+ .Times(AnyNumber()).WillRepeatedly(Return());
// 4. First filled buffer will arrive.
- EXPECT_CALL(*host_, OnBufferFilled(kDeviceId, _, _))
- .Times(AnyNumber())
- .WillOnce(ExitMessageLoop(message_loop_.get()));
+ EXPECT_CALL(*host_.get(), OnBufferFilled(kDeviceId, _, _))
+ .Times(AnyNumber()).WillOnce(ExitMessageLoop(message_loop_.get()));
media::VideoCaptureParams params;
params.width = 352;
@@ -298,8 +296,8 @@ class VideoCaptureHostTest : public testing::Test {
#endif
void StopCapture() {
- EXPECT_CALL(*host_, OnStateChanged(kDeviceId,
- VIDEO_CAPTURE_STATE_STOPPED))
+ EXPECT_CALL(*host_.get(),
+ OnStateChanged(kDeviceId, VIDEO_CAPTURE_STATE_STOPPED))
.WillOnce(ExitMessageLoop(message_loop_.get()));
host_->OnStopCapture(kDeviceId);
@@ -314,9 +312,8 @@ class VideoCaptureHostTest : public testing::Test {
}
void NotifyPacketReady() {
- EXPECT_CALL(*host_, OnBufferFilled(kDeviceId, _, _))
- .Times(AnyNumber())
- .WillOnce(ExitMessageLoop(message_loop_.get()))
+ EXPECT_CALL(*host_.get(), OnBufferFilled(kDeviceId, _, _))
+ .Times(AnyNumber()).WillOnce(ExitMessageLoop(message_loop_.get()))
.RetiresOnSaturation();
message_loop_->Run();
}
@@ -327,8 +324,8 @@ class VideoCaptureHostTest : public testing::Test {
void SimulateError() {
// Expect a change state to error state sent through IPC.
- EXPECT_CALL(*host_, OnStateChanged(kDeviceId, VIDEO_CAPTURE_STATE_ERROR))
- .Times(1);
+ EXPECT_CALL(*host_.get(),
+ OnStateChanged(kDeviceId, VIDEO_CAPTURE_STATE_ERROR)).Times(1);
VideoCaptureControllerID id(kDeviceId);
host_->OnError(id);
// Wait for the error callback.
@@ -365,9 +362,8 @@ TEST_F(VideoCaptureHostTest, StartCaptureErrorStop) {
}
TEST_F(VideoCaptureHostTest, StartCaptureError) {
- EXPECT_CALL(*host_, OnStateChanged(kDeviceId,
- VIDEO_CAPTURE_STATE_STOPPED))
- .Times(0);
+ EXPECT_CALL(*host_.get(),
+ OnStateChanged(kDeviceId, VIDEO_CAPTURE_STATE_STOPPED)).Times(0);
StartCapture();
NotifyPacketReady();
SimulateError();

Powered by Google App Engine
This is Rietveld 408576698