| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "content/browser/browser_thread_impl.h" | 9 #include "content/browser/browser_thread_impl.h" |
| 10 #include "content/browser/renderer_host/media/media_stream_device_settings.h" | 10 #include "content/browser/renderer_host/media/media_stream_device_settings.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 if (video) | 61 if (video) |
| 62 CreateVideoDeviceForRequset(label); | 62 CreateVideoDeviceForRequset(label); |
| 63 } | 63 } |
| 64 | 64 |
| 65 void CreateAudioDeviceForRequset(const std::string& label) { | 65 void CreateAudioDeviceForRequset(const std::string& label) { |
| 66 // Setup the dummy available device for the request. | 66 // Setup the dummy available device for the request. |
| 67 media_stream::StreamDeviceInfoArray audio_device_array(1); | 67 media_stream::StreamDeviceInfoArray audio_device_array(1); |
| 68 media_stream::StreamDeviceInfo dummy_audio_device; | 68 media_stream::StreamDeviceInfo dummy_audio_device; |
| 69 dummy_audio_device.name = "Microphone"; | 69 dummy_audio_device.name = "Microphone"; |
| 70 dummy_audio_device.stream_type = | 70 dummy_audio_device.stream_type = |
| 71 content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE; | 71 content::MEDIA_STREAM_DEVICE_TYPE_USER_AUDIO_CAPTURE; |
| 72 dummy_audio_device.session_id = 1; | 72 dummy_audio_device.session_id = 1; |
| 73 audio_device_array[0] = dummy_audio_device; | 73 audio_device_array[0] = dummy_audio_device; |
| 74 device_settings_->AvailableDevices(label, | 74 device_settings_->AvailableDevices(label, |
| 75 dummy_audio_device.stream_type, | 75 dummy_audio_device.stream_type, |
| 76 audio_device_array); | 76 audio_device_array); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void CreateVideoDeviceForRequset(const std::string& label) { | 79 void CreateVideoDeviceForRequset(const std::string& label) { |
| 80 // Setup the dummy available device for the request. | 80 // Setup the dummy available device for the request. |
| 81 media_stream::StreamDeviceInfoArray video_device_array(1); | 81 media_stream::StreamDeviceInfoArray video_device_array(1); |
| 82 media_stream::StreamDeviceInfo dummy_video_device; | 82 media_stream::StreamDeviceInfo dummy_video_device; |
| 83 dummy_video_device.name = "camera"; | 83 dummy_video_device.name = "camera"; |
| 84 dummy_video_device.stream_type = | 84 dummy_video_device.stream_type = |
| 85 content::MEDIA_STREAM_DEVICE_TYPE_VIDEO_CAPTURE; | 85 content::MEDIA_STREAM_DEVICE_TYPE_USER_VIDEO_CAPTURE; |
| 86 dummy_video_device.session_id = 1; | 86 dummy_video_device.session_id = 1; |
| 87 video_device_array[0] = dummy_video_device; | 87 video_device_array[0] = dummy_video_device; |
| 88 device_settings_->AvailableDevices(label, | 88 device_settings_->AvailableDevices(label, |
| 89 dummy_video_device.stream_type, | 89 dummy_video_device.stream_type, |
| 90 video_device_array); | 90 video_device_array); |
| 91 } | 91 } |
| 92 | 92 |
| 93 scoped_ptr<MessageLoop> message_loop_; | 93 scoped_ptr<MessageLoop> message_loop_; |
| 94 scoped_ptr<BrowserThreadImpl> ui_thread_; | 94 scoped_ptr<BrowserThreadImpl> ui_thread_; |
| 95 scoped_ptr<BrowserThreadImpl> io_thread_; | 95 scoped_ptr<BrowserThreadImpl> io_thread_; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 | 166 |
| 167 // Remove the last request which is pending in the queue. | 167 // Remove the last request which is pending in the queue. |
| 168 device_settings_->RemovePendingCaptureRequest(label_3); | 168 device_settings_->RemovePendingCaptureRequest(label_3); |
| 169 | 169 |
| 170 // We should get callbacks from the rest of the requests. | 170 // We should get callbacks from the rest of the requests. |
| 171 EXPECT_CALL(*this, DevicesAccepted(label_1, _)); | 171 EXPECT_CALL(*this, DevicesAccepted(label_1, _)); |
| 172 EXPECT_CALL(*this, DevicesAccepted(label_2, _)); | 172 EXPECT_CALL(*this, DevicesAccepted(label_2, _)); |
| 173 } | 173 } |
| 174 | 174 |
| 175 } // namespace media_stream | 175 } // namespace media_stream |
| OLD | NEW |