| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/renderer/media/user_media_client_impl.h" | 5 #include "content/renderer/media/user_media_client_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 device = ::mojom::VideoInputDeviceCapabilities::New(); | 152 device = ::mojom::VideoInputDeviceCapabilities::New(); |
| 153 device->device_id = kFakeVideoInputDeviceId2; | 153 device->device_id = kFakeVideoInputDeviceId2; |
| 154 device->facing_mode = ::mojom::FacingMode::ENVIRONMENT; | 154 device->facing_mode = ::mojom::FacingMode::ENVIRONMENT; |
| 155 device->formats.push_back(media::VideoCaptureFormat( | 155 device->formats.push_back(media::VideoCaptureFormat( |
| 156 gfx::Size(640, 480), 30.0f, media::PIXEL_FORMAT_I420)); | 156 gfx::Size(640, 480), 30.0f, media::PIXEL_FORMAT_I420)); |
| 157 result.push_back(std::move(device)); | 157 result.push_back(std::move(device)); |
| 158 | 158 |
| 159 std::move(client_callback).Run(std::move(result)); | 159 std::move(client_callback).Run(std::move(result)); |
| 160 } | 160 } |
| 161 | 161 |
| 162 void GetAudioInputCapabilities( |
| 163 GetAudioInputCapabilitiesCallback client_callback) override { |
| 164 NOTREACHED(); |
| 165 } |
| 166 |
| 162 MOCK_METHOD2(SubscribeDeviceChangeNotifications, | 167 MOCK_METHOD2(SubscribeDeviceChangeNotifications, |
| 163 void(MediaDeviceType type, uint32_t subscription_id)); | 168 void(MediaDeviceType type, uint32_t subscription_id)); |
| 164 MOCK_METHOD2(UnsubscribeDeviceChangeNotifications, | 169 MOCK_METHOD2(UnsubscribeDeviceChangeNotifications, |
| 165 void(MediaDeviceType type, uint32_t subscription_id)); | 170 void(MediaDeviceType type, uint32_t subscription_id)); |
| 166 }; | 171 }; |
| 167 | 172 |
| 168 class UserMediaClientImplUnderTest : public UserMediaClientImpl { | 173 class UserMediaClientImplUnderTest : public UserMediaClientImpl { |
| 169 public: | 174 public: |
| 170 enum RequestState { | 175 enum RequestState { |
| 171 REQUEST_NOT_STARTED, | 176 REQUEST_NOT_STARTED, |
| (...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 917 CreateDeviceConstraints(kFakeAudioInputDeviceId1); | 922 CreateDeviceConstraints(kFakeAudioInputDeviceId1); |
| 918 blink::WebMediaConstraints video_constraints = | 923 blink::WebMediaConstraints video_constraints = |
| 919 CreateFacingModeConstraints("environment"); | 924 CreateFacingModeConstraints("environment"); |
| 920 // kFakeVideoInputDeviceId2 has environment facing mode. | 925 // kFakeVideoInputDeviceId2 has environment facing mode. |
| 921 TestValidRequestWithConstraints(audio_constraints, video_constraints, | 926 TestValidRequestWithConstraints(audio_constraints, video_constraints, |
| 922 kFakeAudioInputDeviceId1, | 927 kFakeAudioInputDeviceId1, |
| 923 kFakeVideoInputDeviceId2); | 928 kFakeVideoInputDeviceId2); |
| 924 } | 929 } |
| 925 | 930 |
| 926 } // namespace content | 931 } // namespace content |
| OLD | NEW |