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

Side by Side Diff: content/browser/renderer_host/media/video_capture_buffer_pool_unittest.cc

Issue 2256173002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace a WrapUnique() nested inside a MakeUnique() Created 4 years, 3 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 // Unit test for VideoCaptureBufferPool. 5 // Unit test for VideoCaptureBufferPool.
6 6
7 #include "content/browser/renderer_host/media/video_capture_buffer_pool.h" 7 #include "content/browser/renderer_host/media/video_capture_buffer_pool.h"
8 8
9 #include <stddef.h> 9 #include <stddef.h>
10 #include <stdint.h> 10 #include <stdint.h>
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 class StubBrowserGpuMemoryBufferManager 103 class StubBrowserGpuMemoryBufferManager
104 : public BrowserGpuMemoryBufferManager { 104 : public BrowserGpuMemoryBufferManager {
105 public: 105 public:
106 StubBrowserGpuMemoryBufferManager() : BrowserGpuMemoryBufferManager(1, 1) {} 106 StubBrowserGpuMemoryBufferManager() : BrowserGpuMemoryBufferManager(1, 1) {}
107 107
108 std::unique_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( 108 std::unique_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer(
109 const gfx::Size& size, 109 const gfx::Size& size,
110 gfx::BufferFormat format, 110 gfx::BufferFormat format,
111 gfx::BufferUsage usage, 111 gfx::BufferUsage usage,
112 gpu::SurfaceHandle surface_handle) override { 112 gpu::SurfaceHandle surface_handle) override {
113 return base::WrapUnique(new MockGpuMemoryBuffer(size)); 113 return base::MakeUnique<MockGpuMemoryBuffer>(size);
114 } 114 }
115 }; 115 };
116 #endif 116 #endif
117 117
118 // This is a generic Buffer tracker 118 // This is a generic Buffer tracker
119 class Buffer { 119 class Buffer {
120 public: 120 public:
121 Buffer(const scoped_refptr<VideoCaptureBufferPool> pool, 121 Buffer(const scoped_refptr<VideoCaptureBufferPool> pool,
122 std::unique_ptr<VideoCaptureBufferPool::BufferHandle> buffer_handle, 122 std::unique_ptr<VideoCaptureBufferPool::BufferHandle> buffer_handle,
123 int id) 123 int id)
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 ASSERT_NE(nullptr, held_buffers.back().get()); 495 ASSERT_NE(nullptr, held_buffers.back().get());
496 resurrected = ResurrectLastBuffer(gfx::Size(10, 10), GetParam()); 496 resurrected = ResurrectLastBuffer(gfx::Size(10, 10), GetParam());
497 ASSERT_EQ(nullptr, resurrected.get()); 497 ASSERT_EQ(nullptr, resurrected.get());
498 } 498 }
499 499
500 INSTANTIATE_TEST_CASE_P(, 500 INSTANTIATE_TEST_CASE_P(,
501 VideoCaptureBufferPoolTest, 501 VideoCaptureBufferPoolTest,
502 testing::ValuesIn(kCapturePixelFormatAndStorages)); 502 testing::ValuesIn(kCapturePixelFormatAndStorages));
503 503
504 } // namespace content 504 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698