| OLD | NEW |
| 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 "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 uint8* const data_; | 70 uint8* const data_; |
| 71 bool mapped_; | 71 bool mapped_; |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 #if !defined(OS_ANDROID) | 74 #if !defined(OS_ANDROID) |
| 75 // The next two classes are needed to replicate the GpuMemoryBuffer allocation | 75 // The next two classes are needed to replicate the GpuMemoryBuffer allocation |
| 76 // on Browser side. | 76 // on Browser side. |
| 77 class StubBrowserGpuMemoryBufferManager | 77 class StubBrowserGpuMemoryBufferManager |
| 78 : public BrowserGpuMemoryBufferManager { | 78 : public BrowserGpuMemoryBufferManager { |
| 79 public: | 79 public: |
| 80 StubBrowserGpuMemoryBufferManager() | 80 StubBrowserGpuMemoryBufferManager() : BrowserGpuMemoryBufferManager(1) {} |
| 81 : BrowserGpuMemoryBufferManager(nullptr, 1) {} | |
| 82 | 81 |
| 83 scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( | 82 scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( |
| 84 const gfx::Size& size, | 83 const gfx::Size& size, |
| 85 gfx::GpuMemoryBuffer::Format format, | 84 gfx::GpuMemoryBuffer::Format format, |
| 86 gfx::GpuMemoryBuffer::Usage usage) override { | 85 gfx::GpuMemoryBuffer::Usage usage) override { |
| 87 return make_scoped_ptr(new MockGpuMemoryBuffer(size)); | 86 return make_scoped_ptr(new MockGpuMemoryBuffer(size)); |
| 88 } | 87 } |
| 89 }; | 88 }; |
| 90 class MockBufferQueue : public BufferQueue { | 89 class MockBufferQueue : public BufferQueue { |
| 91 public: | 90 public: |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 if (buffer4->data() != nullptr) | 335 if (buffer4->data() != nullptr) |
| 337 memset(buffer4->data(), 0x77, buffer4->size()); | 336 memset(buffer4->data(), 0x77, buffer4->size()); |
| 338 buffer4.reset(); | 337 buffer4.reset(); |
| 339 } | 338 } |
| 340 | 339 |
| 341 INSTANTIATE_TEST_CASE_P(, | 340 INSTANTIATE_TEST_CASE_P(, |
| 342 VideoCaptureBufferPoolTest, | 341 VideoCaptureBufferPoolTest, |
| 343 testing::ValuesIn(kCaptureFormats)); | 342 testing::ValuesIn(kCaptureFormats)); |
| 344 | 343 |
| 345 } // namespace content | 344 } // namespace content |
| OLD | NEW |