| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 uint8* const data_; | 80 uint8* const data_; |
| 81 bool mapped_; | 81 bool mapped_; |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 #if !defined(OS_ANDROID) | 84 #if !defined(OS_ANDROID) |
| 85 // The next two classes are needed to replicate the GpuMemoryBuffer allocation | 85 // The next two classes are needed to replicate the GpuMemoryBuffer allocation |
| 86 // on Browser side. | 86 // on Browser side. |
| 87 class StubBrowserGpuMemoryBufferManager | 87 class StubBrowserGpuMemoryBufferManager |
| 88 : public BrowserGpuMemoryBufferManager { | 88 : public BrowserGpuMemoryBufferManager { |
| 89 public: | 89 public: |
| 90 StubBrowserGpuMemoryBufferManager() : BrowserGpuMemoryBufferManager(1) {} | 90 StubBrowserGpuMemoryBufferManager() : BrowserGpuMemoryBufferManager(1, 1) {} |
| 91 | 91 |
| 92 scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( | 92 scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( |
| 93 const gfx::Size& size, | 93 const gfx::Size& size, |
| 94 gfx::GpuMemoryBuffer::Format format, | 94 gfx::GpuMemoryBuffer::Format format, |
| 95 gfx::GpuMemoryBuffer::Usage usage) override { | 95 gfx::GpuMemoryBuffer::Usage usage) override { |
| 96 return make_scoped_ptr(new MockGpuMemoryBuffer(size)); | 96 return make_scoped_ptr(new MockGpuMemoryBuffer(size)); |
| 97 } | 97 } |
| 98 }; | 98 }; |
| 99 class MockBufferQueue : public BufferQueue { | 99 class MockBufferQueue : public BufferQueue { |
| 100 public: | 100 public: |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 if (buffer4->data() != nullptr) | 354 if (buffer4->data() != nullptr) |
| 355 memset(buffer4->data(), 0x77, buffer4->size()); | 355 memset(buffer4->data(), 0x77, buffer4->size()); |
| 356 buffer4.reset(); | 356 buffer4.reset(); |
| 357 } | 357 } |
| 358 | 358 |
| 359 INSTANTIATE_TEST_CASE_P(, | 359 INSTANTIATE_TEST_CASE_P(, |
| 360 VideoCaptureBufferPoolTest, | 360 VideoCaptureBufferPoolTest, |
| 361 testing::ValuesIn(kCapturePixelFormatAndStorages)); | 361 testing::ValuesIn(kCapturePixelFormatAndStorages)); |
| 362 | 362 |
| 363 } // namespace content | 363 } // namespace content |
| OLD | NEW |