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

Unified Diff: services/video_capture/test/fake_device_unittest.cc

Issue 2639883006: Fix unused lambda captures in //device and //services/media_capture. (Closed)
Patch Set: constexpr -> static const Created 3 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 | « device/generic_sensor/platform_sensor_and_provider_unittest_linux.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/video_capture/test/fake_device_unittest.cc
diff --git a/services/video_capture/test/fake_device_unittest.cc b/services/video_capture/test/fake_device_unittest.cc
index edfcc97cc7e17c725908584b0295116910fc9741..b8751c8559c57468141ae98565a6ecd1f2e90067 100644
--- a/services/video_capture/test/fake_device_unittest.cc
+++ b/services/video_capture/test/fake_device_unittest.cc
@@ -32,13 +32,16 @@ namespace video_capture {
TEST_F(FakeDeviceTest, DISABLED_FrameCallbacksArrive) {
base::RunLoop wait_loop;
- const int kNumFramesToWaitFor = 3;
+ // These two constants must be static as a workaround
+ // for a MSVC++ bug about lambda captures, see the discussion at
+ // https://social.msdn.microsoft.com/Forums/SqlServer/4abf18bd-4ae4-4c72-ba3e-3b13e7909d5f
+ static const int kNumFramesToWaitFor = 3;
int num_frames_arrived = 0;
mojom::ReceiverPtr receiver_proxy;
MockReceiver receiver(mojo::MakeRequest(&receiver_proxy));
EXPECT_CALL(receiver, OnIncomingCapturedVideoFramePtr(_))
.WillRepeatedly(InvokeWithoutArgs(
- [&wait_loop, &kNumFramesToWaitFor, &num_frames_arrived]() {
+ [&wait_loop, &num_frames_arrived]() {
num_frames_arrived += 1;
if (num_frames_arrived >= kNumFramesToWaitFor) {
wait_loop.Quit();
@@ -54,14 +57,17 @@ TEST_F(FakeDeviceTest, DISABLED_FrameCallbacksArrive) {
TEST_F(FakeDeviceTest, DISABLED_ReceiveFramesFromFakeCaptureDevice) {
base::RunLoop wait_loop;
mojom::ReceiverPtr receiver_proxy;
- constexpr int num_frames_to_receive = 2;
+ // These two constants must be static as a workaround
+ // for a MSVC++ bug about lambda captures, see the discussion at
+ // https://social.msdn.microsoft.com/Forums/SqlServer/4abf18bd-4ae4-4c72-ba3e-3b13e7909d5f
+ static const int num_frames_to_receive = 2;
FrameInfo received_frame_infos[num_frames_to_receive];
int received_frame_count = 0;
MockReceiver receiver(mojo::MakeRequest(&receiver_proxy));
EXPECT_CALL(receiver, OnIncomingCapturedVideoFramePtr(_))
.WillRepeatedly(Invoke(
- [&received_frame_infos, &received_frame_count, &num_frames_to_receive,
- &wait_loop](const media::mojom::VideoFramePtr* frame) {
+ [&received_frame_infos, &received_frame_count, &wait_loop]
+ (const media::mojom::VideoFramePtr* frame) {
if (received_frame_count >= num_frames_to_receive)
return;
auto video_frame = frame->To<scoped_refptr<media::VideoFrame>>();
« no previous file with comments | « device/generic_sensor/platform_sensor_and_provider_unittest_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698