Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1010)

Side by Side Diff: content/browser/renderer_host/media/media_stream_device_settings_unittest.cc

Issue 10912004: Begin adding support for tab mirroring via the MediaStream audio/video capturing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: REBASE Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 60
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 = content::MEDIA_DEVICE_AUDIO_CAPTURE;
71 content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE;
72 dummy_audio_device.session_id = 1; 71 dummy_audio_device.session_id = 1;
73 audio_device_array[0] = dummy_audio_device; 72 audio_device_array[0] = dummy_audio_device;
74 device_settings_->AvailableDevices(label, 73 device_settings_->AvailableDevices(label,
75 dummy_audio_device.stream_type, 74 dummy_audio_device.stream_type,
76 audio_device_array); 75 audio_device_array);
77 } 76 }
78 77
79 void CreateVideoDeviceForRequset(const std::string& label) { 78 void CreateVideoDeviceForRequset(const std::string& label) {
80 // Setup the dummy available device for the request. 79 // Setup the dummy available device for the request.
81 media_stream::StreamDeviceInfoArray video_device_array(1); 80 media_stream::StreamDeviceInfoArray video_device_array(1);
82 media_stream::StreamDeviceInfo dummy_video_device; 81 media_stream::StreamDeviceInfo dummy_video_device;
83 dummy_video_device.name = "camera"; 82 dummy_video_device.name = "camera";
84 dummy_video_device.stream_type = 83 dummy_video_device.stream_type = content::MEDIA_DEVICE_VIDEO_CAPTURE;
85 content::MEDIA_STREAM_DEVICE_TYPE_VIDEO_CAPTURE;
86 dummy_video_device.session_id = 1; 84 dummy_video_device.session_id = 1;
87 video_device_array[0] = dummy_video_device; 85 video_device_array[0] = dummy_video_device;
88 device_settings_->AvailableDevices(label, 86 device_settings_->AvailableDevices(label,
89 dummy_video_device.stream_type, 87 dummy_video_device.stream_type,
90 video_device_array); 88 video_device_array);
91 } 89 }
92 90
93 scoped_ptr<MessageLoop> message_loop_; 91 scoped_ptr<MessageLoop> message_loop_;
94 scoped_ptr<BrowserThreadImpl> ui_thread_; 92 scoped_ptr<BrowserThreadImpl> ui_thread_;
95 scoped_ptr<BrowserThreadImpl> io_thread_; 93 scoped_ptr<BrowserThreadImpl> io_thread_;
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 164
167 // Remove the last request which is pending in the queue. 165 // Remove the last request which is pending in the queue.
168 device_settings_->RemovePendingCaptureRequest(label_3); 166 device_settings_->RemovePendingCaptureRequest(label_3);
169 167
170 // We should get callbacks from the rest of the requests. 168 // We should get callbacks from the rest of the requests.
171 EXPECT_CALL(*this, DevicesAccepted(label_1, _)); 169 EXPECT_CALL(*this, DevicesAccepted(label_1, _));
172 EXPECT_CALL(*this, DevicesAccepted(label_2, _)); 170 EXPECT_CALL(*this, DevicesAccepted(label_2, _));
173 } 171 }
174 172
175 } // namespace media_stream 173 } // namespace media_stream
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698