| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/chromeos/camera_hal_delegate.h" | 5 #include "media/capture/video/chromeos/camera_hal_delegate.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 15 matching lines...) Expand all Loading... |
| 26 class CameraHalDelegateTest : public ::testing::Test { | 26 class CameraHalDelegateTest : public ::testing::Test { |
| 27 public: | 27 public: |
| 28 CameraHalDelegateTest() | 28 CameraHalDelegateTest() |
| 29 : message_loop_(new base::MessageLoop), | 29 : message_loop_(new base::MessageLoop), |
| 30 hal_delegate_thread_("HalDelegateThread") {} | 30 hal_delegate_thread_("HalDelegateThread") {} |
| 31 | 31 |
| 32 void SetUp() override { | 32 void SetUp() override { |
| 33 hal_delegate_thread_.Start(); | 33 hal_delegate_thread_.Start(); |
| 34 camera_hal_delegate_ = | 34 camera_hal_delegate_ = |
| 35 new CameraHalDelegate(hal_delegate_thread_.task_runner()); | 35 new CameraHalDelegate(hal_delegate_thread_.task_runner()); |
| 36 camera_hal_delegate_->StartForTesting( | 36 camera_hal_delegate_->SetCameraModule( |
| 37 mock_camera_module_.GetInterfacePtrInfo()); | 37 mock_camera_module_.GetInterfacePtrInfo()); |
| 38 } | 38 } |
| 39 | 39 |
| 40 void TearDown() override { | 40 void TearDown() override { |
| 41 camera_hal_delegate_->Reset(); | 41 camera_hal_delegate_->Reset(); |
| 42 hal_delegate_thread_.Stop(); | 42 hal_delegate_thread_.Stop(); |
| 43 } | 43 } |
| 44 | 44 |
| 45 void Wait() { | 45 void Wait() { |
| 46 run_loop_.reset(new base::RunLoop()); | 46 run_loop_.reset(new base::RunLoop()); |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 149 |
| 150 // IMPLEMENTATION_DEFINED format should be filtered; currently YCbCr_420_888 | 150 // IMPLEMENTATION_DEFINED format should be filtered; currently YCbCr_420_888 |
| 151 // format corresponds to NV12 in Chrome. | 151 // format corresponds to NV12 in Chrome. |
| 152 ASSERT_EQ(1U, supported_formats.size()); | 152 ASSERT_EQ(1U, supported_formats.size()); |
| 153 ASSERT_EQ(gfx::Size(1280, 720), supported_formats[0].frame_size); | 153 ASSERT_EQ(gfx::Size(1280, 720), supported_formats[0].frame_size); |
| 154 ASSERT_FLOAT_EQ(60.0, supported_formats[0].frame_rate); | 154 ASSERT_FLOAT_EQ(60.0, supported_formats[0].frame_rate); |
| 155 ASSERT_EQ(PIXEL_FORMAT_NV12, supported_formats[0].pixel_format); | 155 ASSERT_EQ(PIXEL_FORMAT_NV12, supported_formats[0].pixel_format); |
| 156 } | 156 } |
| 157 | 157 |
| 158 } // namespace media | 158 } // namespace media |
| OLD | NEW |