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

Side by Side Diff: media/capture/video/fake_video_capture_device_unittest.cc

Issue 2253943004: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « media/blink/webmediaplayer_impl_unittest.cc ('k') | media/cast/test/sender.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/capture/video/fake_video_capture_device.h" 5 #include "media/capture/video/fake_video_capture_device.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 std::unique_ptr<Buffer> ReserveOutputBuffer( 82 std::unique_ptr<Buffer> ReserveOutputBuffer(
83 const gfx::Size& dimensions, 83 const gfx::Size& dimensions,
84 media::VideoPixelFormat format, 84 media::VideoPixelFormat format,
85 media::VideoPixelStorage storage) { 85 media::VideoPixelStorage storage) {
86 EXPECT_TRUE((format == media::PIXEL_FORMAT_ARGB && 86 EXPECT_TRUE((format == media::PIXEL_FORMAT_ARGB &&
87 storage == media::PIXEL_STORAGE_CPU) || 87 storage == media::PIXEL_STORAGE_CPU) ||
88 (format == media::PIXEL_FORMAT_I420 && 88 (format == media::PIXEL_FORMAT_I420 &&
89 storage == media::PIXEL_STORAGE_GPUMEMORYBUFFER)); 89 storage == media::PIXEL_STORAGE_GPUMEMORYBUFFER));
90 EXPECT_GT(dimensions.GetArea(), 0); 90 EXPECT_GT(dimensions.GetArea(), 0);
91 const VideoCaptureFormat frame_format(dimensions, 0.0, format); 91 const VideoCaptureFormat frame_format(dimensions, 0.0, format);
92 return base::WrapUnique( 92 return base::MakeUnique<MockBuffer>(0, frame_format.ImageAllocationSize());
93 new MockBuffer(0, frame_format.ImageAllocationSize()));
94 } 93 }
95 void OnIncomingCapturedBuffer(std::unique_ptr<Buffer> buffer, 94 void OnIncomingCapturedBuffer(std::unique_ptr<Buffer> buffer,
96 const VideoCaptureFormat& frame_format, 95 const VideoCaptureFormat& frame_format,
97 base::TimeTicks reference_time, 96 base::TimeTicks reference_time,
98 base::TimeDelta timestamp) { 97 base::TimeDelta timestamp) {
99 frame_cb_.Run(frame_format); 98 frame_cb_.Run(frame_format);
100 } 99 }
101 void OnIncomingCapturedVideoFrame( 100 void OnIncomingCapturedVideoFrame(
102 std::unique_ptr<Buffer> buffer, 101 std::unique_ptr<Buffer> buffer,
103 const scoped_refptr<media::VideoFrame>& frame) { 102 const scoped_refptr<media::VideoFrame>& frame) {
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 } 420 }
422 } 421 }
423 422
424 INSTANTIATE_TEST_CASE_P(, 423 INSTANTIATE_TEST_CASE_P(,
425 FakeVideoCaptureDeviceCommandLineTest, 424 FakeVideoCaptureDeviceCommandLineTest,
426 Values(CommandLineTestData{"fps=-1", 5}, 425 Values(CommandLineTestData{"fps=-1", 5},
427 CommandLineTestData{"fps=29.97", 29.97f}, 426 CommandLineTestData{"fps=29.97", 29.97f},
428 CommandLineTestData{"fps=60", 60}, 427 CommandLineTestData{"fps=60", 60},
429 CommandLineTestData{"fps=1000", 60})); 428 CommandLineTestData{"fps=1000", 60}));
430 }; // namespace media 429 }; // namespace media
OLDNEW
« no previous file with comments | « media/blink/webmediaplayer_impl_unittest.cc ('k') | media/cast/test/sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698