Commit 4e642edc authored by Chris Mumford's avatar Chris Mumford Committed by Commit Bot

media: Switch from testing::CreateFunctor to lambda.

This change switches from using testing::CreateFunctor
when calling testing::Invoke() to a C++ lambda. This
improves test readibility and makes easier an upcoming
changes to gmock_mutant.h (switch away from base::Bind()).

Bug: 1007833, 806952
Change-Id: I1473a6041e0aedbc0b6f8eb212ebb918742bc7c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1872815Reviewed-by: default avatarDan Sanders <sandersd@chromium.org>
Commit-Queue: Chris Mumford <cmumford@google.com>
Cr-Commit-Position: refs/heads/master@{#708387}
parent 78513ce5
......@@ -35,7 +35,6 @@
#include "media/base/wall_clock_time_source.h"
#include "media/renderers/video_renderer_impl.h"
#include "media/video/mock_gpu_memory_buffer_video_frame_pool.h"
#include "testing/gmock_mutant.h"
#include "testing/gtest/include/gtest/gtest.h"
using ::base::test::RunCallback;
......@@ -44,7 +43,6 @@ using ::base::test::RunOnceCallback;
using ::testing::_;
using ::testing::AnyNumber;
using ::testing::Combine;
using ::testing::CreateFunctor;
using ::testing::DoAll;
using ::testing::Invoke;
using ::testing::Mock;
......@@ -224,7 +222,9 @@ class VideoRendererImplTest : public testing::Test {
WaitableMessageLoopEvent event;
PipelineStatusCB error_cb = event.GetPipelineStatusCB();
EXPECT_CALL(mock_cb_, OnError(_)).WillOnce(Invoke(CreateFunctor(error_cb)));
EXPECT_CALL(mock_cb_, OnError(_))
.WillOnce(Invoke(
[error_cb](PipelineStatus status) { error_cb.Run(status); }));
event.RunAndWaitForStatus(expected);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment