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

Unified Diff: media/filters/video_renderer_base_unittest.cc

Issue 11359100: Add RunCallback to invoke a callback parameter in unittests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rename 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 | « media/filters/ffmpeg_video_decoder_unittest.cc ('k') | media/media.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/video_renderer_base_unittest.cc
diff --git a/media/filters/video_renderer_base_unittest.cc b/media/filters/video_renderer_base_unittest.cc
index b81c40de2ad7cb1a651f6827cdcdbe40d9d4fd00..70d496ab5674079e086d9fee9db694d439540d69 100644
--- a/media/filters/video_renderer_base_unittest.cc
+++ b/media/filters/video_renderer_base_unittest.cc
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
+
#include "base/bind.h"
#include "base/callback.h"
#include "base/stl_util.h"
@@ -11,6 +13,7 @@
#include "base/synchronization/waitable_event.h"
#include "base/test/test_timeouts.h"
#include "media/base/data_buffer.h"
+#include "media/base/gmock_callback_support.h"
#include "media/base/limits.h"
#include "media/base/mock_callback.h"
#include "media/base/mock_filters.h"
@@ -34,10 +37,6 @@ static const int kVideoDuration = kFrameDuration * 100;
static const int kEndOfStream = -1;
static const gfx::Size kNaturalSize(16u, 16u);
-ACTION_P(RunPipelineStatusCB1, status) {
- arg1.Run(status);
-}
-
class VideoRendererBaseTest : public ::testing::Test {
public:
VideoRendererBaseTest()
@@ -61,7 +60,7 @@ class VideoRendererBaseTest : public ::testing::Test {
// We expect these to be called but we don't care how/when.
EXPECT_CALL(*decoder_, Stop(_))
- .WillRepeatedly(RunClosure());
+ .WillRepeatedly(RunClosure<0>());
EXPECT_CALL(statistics_cb_object_, OnStatistics(_))
.Times(AnyNumber());
EXPECT_CALL(*this, OnTimeUpdate(_))
@@ -107,7 +106,7 @@ class VideoRendererBaseTest : public ::testing::Test {
InSequence s;
EXPECT_CALL(*decoder_, Initialize(_, _, _))
- .WillOnce(RunPipelineStatusCB1(PIPELINE_OK));
+ .WillOnce(RunCallback<1>(PIPELINE_OK));
// Set playback rate before anything else happens.
renderer_->SetPlaybackRate(1.0f);
@@ -694,7 +693,7 @@ TEST_F(VideoRendererBaseTest, VideoDecoder_InitFailure) {
InSequence s;
EXPECT_CALL(*decoder_, Initialize(_, _, _))
- .WillOnce(RunPipelineStatusCB1(PIPELINE_ERROR_DECODE));
+ .WillOnce(RunCallback<1>(PIPELINE_ERROR_DECODE));
InitializeRenderer(PIPELINE_ERROR_DECODE);
}
« no previous file with comments | « media/filters/ffmpeg_video_decoder_unittest.cc ('k') | media/media.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698