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

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

Issue 11446042: Make sure that all OpenDevice requests are scrutinized against the audio and video policies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moved RequestType according to Shijing's proposal. Created 8 years 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_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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698