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 "media/capture/video/video_capture_buffer_pool.h" | 7 #include "media/capture/video/video_capture_buffer_pool.h" |
8 | 8 |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 #include <stdint.h> | 10 #include <stdint.h> |
(...skipping 22 matching lines...) Expand all Loading... |
33 namespace content { | 33 namespace content { |
34 | 34 |
35 struct PixelFormatAndStorage { | 35 struct PixelFormatAndStorage { |
36 media::VideoPixelFormat pixel_format; | 36 media::VideoPixelFormat pixel_format; |
37 media::VideoPixelStorage pixel_storage; | 37 media::VideoPixelStorage pixel_storage; |
38 }; | 38 }; |
39 | 39 |
40 static const PixelFormatAndStorage kCapturePixelFormatAndStorages[] = { | 40 static const PixelFormatAndStorage kCapturePixelFormatAndStorages[] = { |
41 {media::PIXEL_FORMAT_I420, media::PIXEL_STORAGE_CPU}, | 41 {media::PIXEL_FORMAT_I420, media::PIXEL_STORAGE_CPU}, |
42 {media::PIXEL_FORMAT_ARGB, media::PIXEL_STORAGE_CPU}, | 42 {media::PIXEL_FORMAT_ARGB, media::PIXEL_STORAGE_CPU}, |
| 43 {media::PIXEL_FORMAT_Y16, media::PIXEL_STORAGE_CPU}, |
43 }; | 44 }; |
44 | 45 |
45 static const int kTestBufferPoolSize = 3; | 46 static const int kTestBufferPoolSize = 3; |
46 | 47 |
47 // Note that this test does not exercise the class VideoCaptureBufferPool | 48 // Note that this test does not exercise the class VideoCaptureBufferPool |
48 // in isolation. The "unit under test" is an instance of VideoCaptureBufferPool | 49 // in isolation. The "unit under test" is an instance of VideoCaptureBufferPool |
49 // with some context that is specific to renderer_host/media, and therefore | 50 // with some context that is specific to renderer_host/media, and therefore |
50 // this test must live here and not in media/capture/video. | 51 // this test must live here and not in media/capture/video. |
51 class VideoCaptureBufferPoolTest | 52 class VideoCaptureBufferPoolTest |
52 : public testing::TestWithParam<PixelFormatAndStorage> { | 53 : public testing::TestWithParam<PixelFormatAndStorage> { |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 ASSERT_NE(nullptr, held_buffers.back().get()); | 408 ASSERT_NE(nullptr, held_buffers.back().get()); |
408 resurrected = ResurrectLastBuffer(gfx::Size(10, 10), GetParam()); | 409 resurrected = ResurrectLastBuffer(gfx::Size(10, 10), GetParam()); |
409 ASSERT_EQ(nullptr, resurrected.get()); | 410 ASSERT_EQ(nullptr, resurrected.get()); |
410 } | 411 } |
411 | 412 |
412 INSTANTIATE_TEST_CASE_P(, | 413 INSTANTIATE_TEST_CASE_P(, |
413 VideoCaptureBufferPoolTest, | 414 VideoCaptureBufferPoolTest, |
414 testing::ValuesIn(kCapturePixelFormatAndStorages)); | 415 testing::ValuesIn(kCapturePixelFormatAndStorages)); |
415 | 416 |
416 } // namespace content | 417 } // namespace content |
OLD | NEW |