| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 if (advanced_exact_value) { | 91 if (advanced_exact_value) { |
| 92 blink::WebString value = blink::WebString::FromUTF8(advanced_exact_value); | 92 blink::WebString value = blink::WebString::FromUTF8(advanced_exact_value); |
| 93 advanced.device_id.SetExact(value); | 93 advanced.device_id.SetExact(value); |
| 94 } | 94 } |
| 95 | 95 |
| 96 return factory.CreateWebMediaConstraints(); | 96 return factory.CreateWebMediaConstraints(); |
| 97 } | 97 } |
| 98 | 98 |
| 99 class MockMediaStreamVideoCapturerSource : public MockMediaStreamVideoSource { | 99 class MockMediaStreamVideoCapturerSource : public MockMediaStreamVideoSource { |
| 100 public: | 100 public: |
| 101 MockMediaStreamVideoCapturerSource( | 101 MockMediaStreamVideoCapturerSource(const StreamDeviceInfo& device, |
| 102 const StreamDeviceInfo& device, | 102 const SourceStoppedCallback& stop_callback, |
| 103 const SourceStoppedCallback& stop_callback, | 103 PeerConnectionDependencyFactory* factory) |
| 104 PeerConnectionDependencyFactory* factory) | 104 : MockMediaStreamVideoSource() { |
| 105 : MockMediaStreamVideoSource(false) { | |
| 106 SetDeviceInfo(device); | 105 SetDeviceInfo(device); |
| 107 SetStopCallback(stop_callback); | 106 SetStopCallback(stop_callback); |
| 108 } | 107 } |
| 109 }; | 108 }; |
| 110 | 109 |
| 111 const char kInvalidDeviceId[] = "invalid"; | 110 const char kInvalidDeviceId[] = "invalid"; |
| 112 const char kFakeAudioInputDeviceId1[] = "fake_audio_input 1"; | 111 const char kFakeAudioInputDeviceId1[] = "fake_audio_input 1"; |
| 113 const char kFakeAudioInputDeviceId2[] = "fake_audio_input 2"; | 112 const char kFakeAudioInputDeviceId2[] = "fake_audio_input 2"; |
| 114 const char kFakeVideoInputDeviceId1[] = "fake_video_input 1"; | 113 const char kFakeVideoInputDeviceId1[] = "fake_video_input 1"; |
| 115 const char kFakeVideoInputDeviceId2[] = "fake_video_input 2"; | 114 const char kFakeVideoInputDeviceId2[] = "fake_video_input 2"; |
| (...skipping 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1240 TestValidRequestWithConstraints(audio_constraints, video_constraints, | 1239 TestValidRequestWithConstraints(audio_constraints, video_constraints, |
| 1241 kFakeAudioInputDeviceId1, | 1240 kFakeAudioInputDeviceId1, |
| 1242 kFakeVideoInputDeviceId2); | 1241 kFakeVideoInputDeviceId2); |
| 1243 } | 1242 } |
| 1244 | 1243 |
| 1245 INSTANTIATE_TEST_CASE_P(, | 1244 INSTANTIATE_TEST_CASE_P(, |
| 1246 UserMediaClientImplTest, | 1245 UserMediaClientImplTest, |
| 1247 testing::Values(true, false)); | 1246 testing::Values(true, false)); |
| 1248 | 1247 |
| 1249 } // namespace content | 1248 } // namespace content |
| OLD | NEW |