| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "services/video_capture/fake_device_test.h" | 5 #include "services/video_capture/fake_device_test.h" |
| 6 | 6 |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 | 8 |
| 9 using testing::_; | 9 using testing::_; |
| 10 using testing::Invoke; | 10 using testing::Invoke; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 // Query factory for supported formats of fake device | 27 // Query factory for supported formats of fake device |
| 28 base::RunLoop wait_loop; | 28 base::RunLoop wait_loop; |
| 29 EXPECT_CALL(supported_formats_receiver_, OnGetSupportedFormatsCallback(_)) | 29 EXPECT_CALL(supported_formats_receiver_, OnGetSupportedFormatsCallback(_)) |
| 30 .WillOnce(Invoke( | 30 .WillOnce(Invoke( |
| 31 [this, &wait_loop](const std::vector<VideoCaptureFormat>& formats) { | 31 [this, &wait_loop](const std::vector<VideoCaptureFormat>& formats) { |
| 32 fake_device_first_supported_format_ = formats[0]; | 32 fake_device_first_supported_format_ = formats[0]; |
| 33 wait_loop.Quit(); | 33 wait_loop.Quit(); |
| 34 })); | 34 })); |
| 35 factory_->GetSupportedFormats( | 35 factory_->GetSupportedFormats( |
| 36 fake_device_descriptor_, | 36 fake_device_descriptor_.device_id, |
| 37 base::Bind(&MockSupportedFormatsReceiver::OnGetSupportedFormatsCallback, | 37 base::Bind(&MockSupportedFormatsReceiver::OnGetSupportedFormatsCallback, |
| 38 base::Unretained(&supported_formats_receiver_))); | 38 base::Unretained(&supported_formats_receiver_))); |
| 39 wait_loop.Run(); | 39 wait_loop.Run(); |
| 40 | 40 |
| 41 requestable_settings_.format = fake_device_first_supported_format_; | 41 requestable_settings_.format = fake_device_first_supported_format_; |
| 42 requestable_settings_.resolution_change_policy = | 42 requestable_settings_.resolution_change_policy = |
| 43 media::RESOLUTION_POLICY_FIXED_RESOLUTION; | 43 media::RESOLUTION_POLICY_FIXED_RESOLUTION; |
| 44 requestable_settings_.power_line_frequency = | 44 requestable_settings_.power_line_frequency = |
| 45 media::PowerLineFrequency::FREQUENCY_DEFAULT; | 45 media::PowerLineFrequency::FREQUENCY_DEFAULT; |
| 46 | 46 |
| 47 factory_->CreateDeviceProxy( | 47 factory_->CreateDeviceProxy( |
| 48 std::move(fake_device_descriptor_), mojo::GetProxy(&fake_device_proxy_), | 48 std::move(fake_device_descriptor_.device_id), |
| 49 mojo::GetProxy(&fake_device_proxy_), |
| 49 base::Bind([](mojom::DeviceAccessResultCode result_code) { | 50 base::Bind([](mojom::DeviceAccessResultCode result_code) { |
| 50 ASSERT_EQ(mojom::DeviceAccessResultCode::SUCCESS, result_code); | 51 ASSERT_EQ(mojom::DeviceAccessResultCode::SUCCESS, result_code); |
| 51 })); | 52 })); |
| 52 } | 53 } |
| 53 | 54 |
| 54 } // namespace video_capture | 55 } // namespace video_capture |
| OLD | NEW |