| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/strings/string_number_conversions.h" | 5 #include "base/strings/string_number_conversions.h" |
| 6 #include "content/browser/renderer_host/media/device_request_message_filter.h" | 6 #include "content/browser/renderer_host/media/device_request_message_filter.h" |
| 7 #include "content/browser/renderer_host/media/media_stream_manager.h" | 7 #include "content/browser/renderer_host/media/media_stream_manager.h" |
| 8 #include "content/common/media/media_stream_messages.h" | 8 #include "content/common/media/media_stream_messages.h" |
| 9 #include "content/public/test/mock_resource_context.h" | 9 #include "content/public/test/mock_resource_context.h" |
| 10 #include "content/public/test/test_browser_thread.h" | 10 #include "content/public/test/test_browser_thread.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 physical_video_devices_.push_back( | 173 physical_video_devices_.push_back( |
| 174 StreamDeviceInfo( | 174 StreamDeviceInfo( |
| 175 MEDIA_DEVICE_VIDEO_CAPTURE, | 175 MEDIA_DEVICE_VIDEO_CAPTURE, |
| 176 "/dev/video/" + base::IntToString(next_device_id_), | 176 "/dev/video/" + base::IntToString(next_device_id_), |
| 177 "Video Device" + base::IntToString(next_device_id_))); | 177 "Video Device" + base::IntToString(next_device_id_))); |
| 178 next_device_id_++; | 178 next_device_id_++; |
| 179 } | 179 } |
| 180 } | 180 } |
| 181 | 181 |
| 182 void SendGetSourcesMessage(int request_id, const GURL& origin) { | 182 void SendGetSourcesMessage(int request_id, const GURL& origin) { |
| 183 // Since we're not actually sending IPC messages, this is a throw-away | 183 host_->OnMessageReceived(MediaStreamHostMsg_GetSources(request_id, origin)); |
| 184 // value. | |
| 185 bool message_was_ok; | |
| 186 host_->OnMessageReceived(MediaStreamHostMsg_GetSources(request_id, origin), | |
| 187 &message_was_ok); | |
| 188 } | 184 } |
| 189 | 185 |
| 190 void FireAudioDeviceCallback() { | 186 void FireAudioDeviceCallback() { |
| 191 host_->DevicesEnumerated(-1, -1, kAudioLabel, physical_audio_devices_); | 187 host_->DevicesEnumerated(-1, -1, kAudioLabel, physical_audio_devices_); |
| 192 } | 188 } |
| 193 | 189 |
| 194 void FireVideoDeviceCallback() { | 190 void FireVideoDeviceCallback() { |
| 195 host_->DevicesEnumerated(-1, -1, kVideoLabel, physical_video_devices_); | 191 host_->DevicesEnumerated(-1, -1, kVideoLabel, physical_video_devices_); |
| 196 } | 192 } |
| 197 | 193 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 | 246 |
| 251 TEST_F(DeviceRequestMessageFilterTest, TestGetSources_AllowMicAllowCamera) { | 247 TEST_F(DeviceRequestMessageFilterTest, TestGetSources_AllowMicAllowCamera) { |
| 252 resource_context_->set_mic_access(true); | 248 resource_context_->set_mic_access(true); |
| 253 resource_context_->set_camera_access(true); | 249 resource_context_->set_camera_access(true); |
| 254 RunTest(3, 3); | 250 RunTest(3, 3); |
| 255 EXPECT_TRUE(AreLabelsPresent(MEDIA_DEVICE_AUDIO_CAPTURE)); | 251 EXPECT_TRUE(AreLabelsPresent(MEDIA_DEVICE_AUDIO_CAPTURE)); |
| 256 EXPECT_TRUE(AreLabelsPresent(MEDIA_DEVICE_VIDEO_CAPTURE)); | 252 EXPECT_TRUE(AreLabelsPresent(MEDIA_DEVICE_VIDEO_CAPTURE)); |
| 257 } | 253 } |
| 258 | 254 |
| 259 }; // namespace content | 255 }; // namespace content |
| OLD | NEW |