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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 void MockMediaStreamDispatcher::CancelGenerateStream( | 52 void MockMediaStreamDispatcher::CancelGenerateStream( |
53 int request_id, | 53 int request_id, |
54 const base::WeakPtr<MediaStreamDispatcherEventHandler>& event_handler) { | 54 const base::WeakPtr<MediaStreamDispatcherEventHandler>& event_handler) { |
55 EXPECT_EQ(request_id, audio_input_request_id_); | 55 EXPECT_EQ(request_id, audio_input_request_id_); |
56 } | 56 } |
57 | 57 |
58 void MockMediaStreamDispatcher::EnumerateDevices( | 58 void MockMediaStreamDispatcher::EnumerateDevices( |
59 int request_id, | 59 int request_id, |
60 const base::WeakPtr<MediaStreamDispatcherEventHandler>& event_handler, | 60 const base::WeakPtr<MediaStreamDispatcherEventHandler>& event_handler, |
61 MediaStreamType type, | 61 MediaStreamType type, |
62 const GURL& security_origin) { | 62 const GURL& security_origin, |
| 63 bool hide_labels_if_no_access) { |
63 if (type == MEDIA_DEVICE_AUDIO_CAPTURE) { | 64 if (type == MEDIA_DEVICE_AUDIO_CAPTURE) { |
64 audio_input_request_id_ = request_id; | 65 audio_input_request_id_ = request_id; |
65 audio_input_array_.clear(); | 66 audio_input_array_.clear(); |
66 AddAudioInputDeviceToArray(true); | 67 AddAudioInputDeviceToArray(true); |
67 AddAudioInputDeviceToArray(false); | 68 AddAudioInputDeviceToArray(false); |
68 } else if (type == MEDIA_DEVICE_AUDIO_OUTPUT) { | 69 } else if (type == MEDIA_DEVICE_AUDIO_OUTPUT) { |
69 audio_output_request_id_ = request_id; | 70 audio_output_request_id_ = request_id; |
70 audio_output_array_.clear(); | 71 audio_output_array_.clear(); |
71 AddAudioOutputDeviceToArray(); | 72 AddAudioOutputDeviceToArray(); |
72 } else if (type == MEDIA_DEVICE_VIDEO_CAPTURE) { | 73 } else if (type == MEDIA_DEVICE_VIDEO_CAPTURE) { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 void MockMediaStreamDispatcher::AddVideoDeviceToArray() { | 130 void MockMediaStreamDispatcher::AddVideoDeviceToArray() { |
130 StreamDeviceInfo video; | 131 StreamDeviceInfo video; |
131 video.device.id = "video_device_id" + base::IntToString(session_id_); | 132 video.device.id = "video_device_id" + base::IntToString(session_id_); |
132 video.device.name = "usb video camera"; | 133 video.device.name = "usb video camera"; |
133 video.device.type = MEDIA_DEVICE_VIDEO_CAPTURE; | 134 video.device.type = MEDIA_DEVICE_VIDEO_CAPTURE; |
134 video.session_id = session_id_; | 135 video.session_id = session_id_; |
135 video_array_.push_back(video); | 136 video_array_.push_back(video); |
136 } | 137 } |
137 | 138 |
138 } // namespace content | 139 } // namespace content |
OLD | NEW |