| 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_ui_controller.h" | 10 #include "content/browser/renderer_host/media/media_stream_ui_controller.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 int dummy_render_process_id = 1; | 47 int dummy_render_process_id = 1; |
| 48 int dummy_render_view_id = 1; | 48 int dummy_render_view_id = 1; |
| 49 StreamOptions components( | 49 StreamOptions components( |
| 50 audio ? MEDIA_DEVICE_AUDIO_CAPTURE : MEDIA_NO_SERVICE, | 50 audio ? MEDIA_DEVICE_AUDIO_CAPTURE : MEDIA_NO_SERVICE, |
| 51 video ? MEDIA_DEVICE_VIDEO_CAPTURE : MEDIA_NO_SERVICE); | 51 video ? MEDIA_DEVICE_VIDEO_CAPTURE : MEDIA_NO_SERVICE); |
| 52 GURL security_origin; | 52 GURL security_origin; |
| 53 ui_controller_->MakeUIRequest(label, | 53 ui_controller_->MakeUIRequest(label, |
| 54 dummy_render_process_id, | 54 dummy_render_process_id, |
| 55 dummy_render_view_id, | 55 dummy_render_view_id, |
| 56 components, | 56 components, |
| 57 security_origin); | 57 security_origin, |
| 58 GENERATE_STREAM); |
| 58 if (audio) | 59 if (audio) |
| 59 CreateAudioDeviceForRequset(label); | 60 CreateAudioDeviceForRequset(label); |
| 60 | 61 |
| 61 if (video) | 62 if (video) |
| 62 CreateVideoDeviceForRequset(label); | 63 CreateVideoDeviceForRequset(label); |
| 63 } | 64 } |
| 64 | 65 |
| 65 void CreateAudioDeviceForRequset(const std::string& label) { | 66 void CreateAudioDeviceForRequset(const std::string& label) { |
| 66 // Setup the dummy available device for the request. | 67 // Setup the dummy available device for the request. |
| 67 StreamDeviceInfoArray audio_device_array(1); | 68 StreamDeviceInfoArray audio_device_array(1); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 | 167 |
| 167 // Remove the last request which is pending in the queue. | 168 // Remove the last request which is pending in the queue. |
| 168 ui_controller_->CancelUIRequest(label_3); | 169 ui_controller_->CancelUIRequest(label_3); |
| 169 | 170 |
| 170 // We should get callbacks from the rest of the requests. | 171 // We should get callbacks from the rest of the requests. |
| 171 EXPECT_CALL(*this, DevicesAccepted(label_1, _)); | 172 EXPECT_CALL(*this, DevicesAccepted(label_1, _)); |
| 172 EXPECT_CALL(*this, DevicesAccepted(label_2, _)); | 173 EXPECT_CALL(*this, DevicesAccepted(label_2, _)); |
| 173 } | 174 } |
| 174 | 175 |
| 175 } // namespace content | 176 } // namespace content |
| OLD | NEW |