| 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/mock_media_stream_dispatcher.h" | 5 #include "content/renderer/media/mock_media_stream_dispatcher.h" |
| 6 | 6 |
| 7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
| 8 #include "content/public/common/media_stream_request.h" | 8 #include "content/public/common/media_stream_request.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 AddAudioDeviceToArray(); | 60 AddAudioDeviceToArray(); |
| 61 } else if (type == MEDIA_DEVICE_VIDEO_CAPTURE) { | 61 } else if (type == MEDIA_DEVICE_VIDEO_CAPTURE) { |
| 62 video_request_id_ = request_id; | 62 video_request_id_ = request_id; |
| 63 video_array_.clear(); | 63 video_array_.clear(); |
| 64 AddVideoDeviceToArray(); | 64 AddVideoDeviceToArray(); |
| 65 } | 65 } |
| 66 } | 66 } |
| 67 | 67 |
| 68 void MockMediaStreamDispatcher::StopStreamDevice( | 68 void MockMediaStreamDispatcher::StopStreamDevice( |
| 69 const StreamDeviceInfo& device_info) { | 69 const StreamDeviceInfo& device_info) { |
| 70 if (IsAudioMediaType(device_info.device.type)) { | 70 if (IsAudioInputMediaType(device_info.device.type)) { |
| 71 ++stop_audio_device_counter_; | 71 ++stop_audio_device_counter_; |
| 72 return; | 72 return; |
| 73 } | 73 } |
| 74 if (IsVideoMediaType(device_info.device.type)) { | 74 if (IsVideoMediaType(device_info.device.type)) { |
| 75 ++stop_video_device_counter_; | 75 ++stop_video_device_counter_; |
| 76 return; | 76 return; |
| 77 } | 77 } |
| 78 NOTREACHED(); | 78 NOTREACHED(); |
| 79 } | 79 } |
| 80 | 80 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 104 void MockMediaStreamDispatcher::AddVideoDeviceToArray() { | 104 void MockMediaStreamDispatcher::AddVideoDeviceToArray() { |
| 105 StreamDeviceInfo video; | 105 StreamDeviceInfo video; |
| 106 video.device.id = "video_device_id" + base::IntToString(session_id_); | 106 video.device.id = "video_device_id" + base::IntToString(session_id_); |
| 107 video.device.name = "usb video camera"; | 107 video.device.name = "usb video camera"; |
| 108 video.device.type = MEDIA_DEVICE_VIDEO_CAPTURE; | 108 video.device.type = MEDIA_DEVICE_VIDEO_CAPTURE; |
| 109 video.session_id = session_id_; | 109 video.session_id = session_id_; |
| 110 video_array_.push_back(video); | 110 video_array_.push_back(video); |
| 111 } | 111 } |
| 112 | 112 |
| 113 } // namespace content | 113 } // namespace content |
| OLD | NEW |