Convert browser_tests to Swarming.
[chromium-blink-merge.git] / chrome / browser / media / media_stream_devices_controller_browsertest.cc
blob57fc46e553966587b9ec7d04bb84e447c40f04d3
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include <string>
7 #include "base/bind.h"
8 #include "base/prefs/pref_service.h"
9 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
10 #include "chrome/browser/media/media_capture_devices_dispatcher.h"
11 #include "chrome/browser/media/media_stream_capture_indicator.h"
12 #include "chrome/browser/media/media_stream_device_permissions.h"
13 #include "chrome/browser/media/media_stream_devices_controller.h"
14 #include "chrome/browser/media/webrtc_browsertest_base.h"
15 #include "chrome/browser/profiles/profile.h"
16 #include "chrome/browser/ui/browser.h"
17 #include "chrome/browser/ui/tabs/tab_strip_model.h"
18 #include "chrome/common/pref_names.h"
19 #include "chrome/test/base/ui_test_utils.h"
20 #include "content/public/common/media_stream_request.h"
21 #include "testing/gtest/include/gtest/gtest.h"
23 namespace {
25 // Causes the controller to update the TabSpecificContentSettings associated
26 // with the same WebContents with the current permissions. This should be the
27 // last change made to the controller in the test.
28 void NotifyTabSpecificContentSettings(
29 MediaStreamDevicesController* controller) {
30 // Note that calling Deny() would have the same effect of passing the current
31 // permissions state to the TabSpecificContentSettings. Deny() and Accept()
32 // differ in their effect on the controller itself, but that is not important
33 // in the tests calling this.
34 controller->Accept(false);
37 } // namespace
39 class MediaStreamDevicesControllerTest : public WebRtcTestBase {
40 public:
41 MediaStreamDevicesControllerTest()
42 : example_url_("about:blank"),
43 example_audio_id_("example audio ID"),
44 example_video_id_("example video ID") {}
46 protected:
47 enum DeviceType { DEVICE_TYPE_AUDIO, DEVICE_TYPE_VIDEO };
48 enum Access { ACCESS_ALLOWED, ACCESS_DENIED };
50 const GURL& example_url() const { return example_url_; }
52 TabSpecificContentSettings* GetContentSettings() {
53 return TabSpecificContentSettings::FromWebContents(GetWebContents());
56 const std::string& example_audio_id() const { return example_audio_id_; }
57 const std::string& example_video_id() const { return example_video_id_; }
59 // Sets the device policy-controlled |access| for |example_url_| to be for the
60 // selected |device_type|.
61 void SetDevicePolicy(DeviceType device_type, Access access) {
62 PrefService* prefs = Profile::FromBrowserContext(
63 GetWebContents()->GetBrowserContext())->GetPrefs();
64 const char* policy_name = NULL;
65 switch (device_type) {
66 case DEVICE_TYPE_AUDIO:
67 policy_name = prefs::kAudioCaptureAllowed;
68 break;
69 case DEVICE_TYPE_VIDEO:
70 policy_name = prefs::kVideoCaptureAllowed;
71 break;
73 prefs->SetBoolean(policy_name, access == ACCESS_ALLOWED);
76 content::WebContents* GetWebContents() {
77 return browser()->tab_strip_model()->GetActiveWebContents();
80 // Creates a MediaStreamRequest, asking for those media types, which have a
81 // non-empty id string.
82 content::MediaStreamRequest CreateRequest(const std::string& audio_id,
83 const std::string& video_id) {
84 content::MediaStreamType audio_type =
85 audio_id.empty() ? content::MEDIA_NO_SERVICE
86 : content::MEDIA_DEVICE_AUDIO_CAPTURE;
87 content::MediaStreamType video_type =
88 video_id.empty() ? content::MEDIA_NO_SERVICE
89 : content::MEDIA_DEVICE_VIDEO_CAPTURE;
90 return content::MediaStreamRequest(0,
93 example_url(),
94 false,
95 content::MEDIA_DEVICE_ACCESS,
96 audio_id,
97 video_id,
98 audio_type,
99 video_type);
102 // Dummy callback for when we deny the current request directly.
103 static void OnMediaStreamResponse(const content::MediaStreamDevices& devices,
104 content::MediaStreamRequestResult result,
105 scoped_ptr<content::MediaStreamUI> ui) {}
107 private:
108 void SetUpOnMainThread() override {
109 WebRtcTestBase::SetUpOnMainThread();
110 ui_test_utils::NavigateToURL(browser(), example_url_);
112 EXPECT_EQ(TabSpecificContentSettings::MICROPHONE_CAMERA_NOT_ACCESSED,
113 GetContentSettings()->GetMicrophoneCameraState());
116 const GURL example_url_;
117 const std::string example_audio_id_;
118 const std::string example_video_id_;
121 // Request and allow microphone access.
122 IN_PROC_BROWSER_TEST_F(MediaStreamDevicesControllerTest, RequestAndAllowMic) {
123 SetDevicePolicy(DEVICE_TYPE_AUDIO, ACCESS_ALLOWED);
124 MediaStreamDevicesController controller(
125 GetWebContents(),
126 CreateRequest(example_audio_id(), std::string()),
127 base::Bind(&OnMediaStreamResponse));
128 NotifyTabSpecificContentSettings(&controller);
130 EXPECT_TRUE(GetContentSettings()->IsContentAllowed(
131 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC));
132 EXPECT_FALSE(GetContentSettings()->IsContentBlocked(
133 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC));
134 EXPECT_EQ(TabSpecificContentSettings::MICROPHONE_ACCESSED,
135 GetContentSettings()->GetMicrophoneCameraState());
136 EXPECT_EQ(example_audio_id(),
137 GetContentSettings()->media_stream_requested_audio_device());
138 EXPECT_EQ(example_audio_id(),
139 GetContentSettings()->media_stream_selected_audio_device());
140 EXPECT_EQ(std::string(),
141 GetContentSettings()->media_stream_requested_video_device());
142 EXPECT_EQ(std::string(),
143 GetContentSettings()->media_stream_selected_video_device());
146 // Request and allow camera access.
147 IN_PROC_BROWSER_TEST_F(MediaStreamDevicesControllerTest, RequestAndAllowCam) {
148 SetDevicePolicy(DEVICE_TYPE_VIDEO, ACCESS_ALLOWED);
149 MediaStreamDevicesController controller(
150 GetWebContents(),
151 CreateRequest(std::string(), example_video_id()),
152 base::Bind(&OnMediaStreamResponse));
153 NotifyTabSpecificContentSettings(&controller);
155 EXPECT_TRUE(GetContentSettings()->IsContentAllowed(
156 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA));
157 EXPECT_FALSE(GetContentSettings()->IsContentBlocked(
158 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA));
159 EXPECT_EQ(TabSpecificContentSettings::CAMERA_ACCESSED,
160 GetContentSettings()->GetMicrophoneCameraState());
161 EXPECT_EQ(std::string(),
162 GetContentSettings()->media_stream_requested_audio_device());
163 EXPECT_EQ(std::string(),
164 GetContentSettings()->media_stream_selected_audio_device());
165 EXPECT_EQ(example_video_id(),
166 GetContentSettings()->media_stream_requested_video_device());
167 EXPECT_EQ(example_video_id(),
168 GetContentSettings()->media_stream_selected_video_device());
171 // Request and block microphone access.
172 IN_PROC_BROWSER_TEST_F(MediaStreamDevicesControllerTest, RequestAndBlockMic) {
173 SetDevicePolicy(DEVICE_TYPE_AUDIO, ACCESS_DENIED);
174 MediaStreamDevicesController controller(
175 GetWebContents(),
176 CreateRequest(example_audio_id(), std::string()),
177 base::Bind(&OnMediaStreamResponse));
178 NotifyTabSpecificContentSettings(&controller);
180 EXPECT_FALSE(GetContentSettings()->IsContentAllowed(
181 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC));
182 EXPECT_TRUE(GetContentSettings()->IsContentBlocked(
183 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC));
184 EXPECT_EQ(TabSpecificContentSettings::MICROPHONE_ACCESSED |
185 TabSpecificContentSettings::MICROPHONE_BLOCKED,
186 GetContentSettings()->GetMicrophoneCameraState());
187 EXPECT_EQ(example_audio_id(),
188 GetContentSettings()->media_stream_requested_audio_device());
189 EXPECT_EQ(example_audio_id(),
190 GetContentSettings()->media_stream_selected_audio_device());
191 EXPECT_EQ(std::string(),
192 GetContentSettings()->media_stream_requested_video_device());
193 EXPECT_EQ(std::string(),
194 GetContentSettings()->media_stream_selected_video_device());
197 // Request and block camera access.
198 IN_PROC_BROWSER_TEST_F(MediaStreamDevicesControllerTest, RequestAndBlockCam) {
199 SetDevicePolicy(DEVICE_TYPE_VIDEO, ACCESS_DENIED);
200 MediaStreamDevicesController controller(
201 GetWebContents(),
202 CreateRequest(std::string(), example_video_id()),
203 base::Bind(&OnMediaStreamResponse));
204 NotifyTabSpecificContentSettings(&controller);
206 EXPECT_FALSE(GetContentSettings()->IsContentAllowed(
207 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA));
208 EXPECT_TRUE(GetContentSettings()->IsContentBlocked(
209 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA));
210 EXPECT_EQ(TabSpecificContentSettings::CAMERA_ACCESSED |
211 TabSpecificContentSettings::CAMERA_BLOCKED,
212 GetContentSettings()->GetMicrophoneCameraState());
213 EXPECT_EQ(std::string(),
214 GetContentSettings()->media_stream_requested_audio_device());
215 EXPECT_EQ(std::string(),
216 GetContentSettings()->media_stream_selected_audio_device());
217 EXPECT_EQ(example_video_id(),
218 GetContentSettings()->media_stream_requested_video_device());
219 EXPECT_EQ(example_video_id(),
220 GetContentSettings()->media_stream_selected_video_device());
223 // Request and allow microphone and camera access.
224 IN_PROC_BROWSER_TEST_F(MediaStreamDevicesControllerTest,
225 RequestAndAllowMicCam) {
226 SetDevicePolicy(DEVICE_TYPE_AUDIO, ACCESS_ALLOWED);
227 SetDevicePolicy(DEVICE_TYPE_VIDEO, ACCESS_ALLOWED);
228 MediaStreamDevicesController controller(
229 GetWebContents(),
230 CreateRequest(example_audio_id(), example_video_id()),
231 base::Bind(&OnMediaStreamResponse));
232 NotifyTabSpecificContentSettings(&controller);
234 EXPECT_TRUE(GetContentSettings()->IsContentAllowed(
235 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC));
236 EXPECT_FALSE(GetContentSettings()->IsContentBlocked(
237 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC));
238 EXPECT_TRUE(GetContentSettings()->IsContentAllowed(
239 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA));
240 EXPECT_FALSE(GetContentSettings()->IsContentBlocked(
241 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA));
242 EXPECT_EQ(TabSpecificContentSettings::MICROPHONE_ACCESSED |
243 TabSpecificContentSettings::CAMERA_ACCESSED,
244 GetContentSettings()->GetMicrophoneCameraState());
245 EXPECT_EQ(example_audio_id(),
246 GetContentSettings()->media_stream_requested_audio_device());
247 EXPECT_EQ(example_audio_id(),
248 GetContentSettings()->media_stream_selected_audio_device());
249 EXPECT_EQ(example_video_id(),
250 GetContentSettings()->media_stream_requested_video_device());
251 EXPECT_EQ(example_video_id(),
252 GetContentSettings()->media_stream_selected_video_device());
255 // Request and block microphone and camera access.
256 IN_PROC_BROWSER_TEST_F(MediaStreamDevicesControllerTest,
257 RequestAndBlockMicCam) {
258 SetDevicePolicy(DEVICE_TYPE_AUDIO, ACCESS_DENIED);
259 SetDevicePolicy(DEVICE_TYPE_VIDEO, ACCESS_DENIED);
260 MediaStreamDevicesController controller(
261 GetWebContents(),
262 CreateRequest(example_audio_id(), example_video_id()),
263 base::Bind(&OnMediaStreamResponse));
264 NotifyTabSpecificContentSettings(&controller);
266 EXPECT_FALSE(GetContentSettings()->IsContentAllowed(
267 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC));
268 EXPECT_TRUE(GetContentSettings()->IsContentBlocked(
269 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC));
270 EXPECT_FALSE(GetContentSettings()->IsContentAllowed(
271 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA));
272 EXPECT_TRUE(GetContentSettings()->IsContentBlocked(
273 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA));
274 EXPECT_EQ(TabSpecificContentSettings::MICROPHONE_ACCESSED |
275 TabSpecificContentSettings::MICROPHONE_BLOCKED |
276 TabSpecificContentSettings::CAMERA_ACCESSED |
277 TabSpecificContentSettings::CAMERA_BLOCKED,
278 GetContentSettings()->GetMicrophoneCameraState());
279 EXPECT_EQ(example_audio_id(),
280 GetContentSettings()->media_stream_requested_audio_device());
281 EXPECT_EQ(example_audio_id(),
282 GetContentSettings()->media_stream_selected_audio_device());
283 EXPECT_EQ(example_video_id(),
284 GetContentSettings()->media_stream_requested_video_device());
285 EXPECT_EQ(example_video_id(),
286 GetContentSettings()->media_stream_selected_video_device());
289 // Request microphone and camera access. Allow microphone, block camera.
290 IN_PROC_BROWSER_TEST_F(MediaStreamDevicesControllerTest,
291 RequestMicCamBlockCam) {
292 SetDevicePolicy(DEVICE_TYPE_AUDIO, ACCESS_ALLOWED);
293 SetDevicePolicy(DEVICE_TYPE_VIDEO, ACCESS_DENIED);
294 MediaStreamDevicesController controller(
295 GetWebContents(),
296 CreateRequest(example_audio_id(), example_video_id()),
297 base::Bind(&OnMediaStreamResponse));
298 NotifyTabSpecificContentSettings(&controller);
300 EXPECT_TRUE(GetContentSettings()->IsContentAllowed(
301 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC));
302 EXPECT_FALSE(GetContentSettings()->IsContentBlocked(
303 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC));
304 EXPECT_FALSE(GetContentSettings()->IsContentAllowed(
305 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA));
306 EXPECT_TRUE(GetContentSettings()->IsContentBlocked(
307 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA));
308 EXPECT_EQ(TabSpecificContentSettings::MICROPHONE_ACCESSED |
309 TabSpecificContentSettings::CAMERA_ACCESSED |
310 TabSpecificContentSettings::CAMERA_BLOCKED,
311 GetContentSettings()->GetMicrophoneCameraState());
312 EXPECT_EQ(example_audio_id(),
313 GetContentSettings()->media_stream_requested_audio_device());
314 EXPECT_EQ(example_audio_id(),
315 GetContentSettings()->media_stream_selected_audio_device());
316 EXPECT_EQ(example_video_id(),
317 GetContentSettings()->media_stream_requested_video_device());
318 EXPECT_EQ(example_video_id(),
319 GetContentSettings()->media_stream_selected_video_device());
322 // Request microphone and camera access. Block microphone, allow camera.
323 IN_PROC_BROWSER_TEST_F(MediaStreamDevicesControllerTest,
324 RequestMicCamBlockMic) {
325 SetDevicePolicy(DEVICE_TYPE_AUDIO, ACCESS_DENIED);
326 SetDevicePolicy(DEVICE_TYPE_VIDEO, ACCESS_ALLOWED);
327 MediaStreamDevicesController controller(
328 GetWebContents(),
329 CreateRequest(example_audio_id(), example_video_id()),
330 base::Bind(&OnMediaStreamResponse));
331 NotifyTabSpecificContentSettings(&controller);
333 EXPECT_FALSE(GetContentSettings()->IsContentAllowed(
334 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC));
335 EXPECT_TRUE(GetContentSettings()->IsContentBlocked(
336 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC));
337 EXPECT_TRUE(GetContentSettings()->IsContentAllowed(
338 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA));
339 EXPECT_FALSE(GetContentSettings()->IsContentBlocked(
340 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA));
341 EXPECT_EQ(TabSpecificContentSettings::MICROPHONE_ACCESSED |
342 TabSpecificContentSettings::MICROPHONE_BLOCKED |
343 TabSpecificContentSettings::CAMERA_ACCESSED,
344 GetContentSettings()->GetMicrophoneCameraState());
345 EXPECT_EQ(example_audio_id(),
346 GetContentSettings()->media_stream_requested_audio_device());
347 EXPECT_EQ(example_audio_id(),
348 GetContentSettings()->media_stream_selected_audio_device());
349 EXPECT_EQ(example_video_id(),
350 GetContentSettings()->media_stream_requested_video_device());
351 EXPECT_EQ(example_video_id(),
352 GetContentSettings()->media_stream_selected_video_device());
355 // Request microphone access. Requesting camera should not change microphone
356 // state.
357 IN_PROC_BROWSER_TEST_F(MediaStreamDevicesControllerTest,
358 RequestCamDoesNotChangeMic) {
359 // Request mic and deny.
360 SetDevicePolicy(DEVICE_TYPE_AUDIO, ACCESS_DENIED);
361 MediaStreamDevicesController mic_controller(
362 GetWebContents(),
363 CreateRequest(example_audio_id(), std::string()),
364 base::Bind(&OnMediaStreamResponse));
365 NotifyTabSpecificContentSettings(&mic_controller);
366 EXPECT_FALSE(GetContentSettings()->IsContentAllowed(
367 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC));
368 EXPECT_TRUE(GetContentSettings()->IsContentBlocked(
369 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC));
370 EXPECT_EQ(example_audio_id(),
371 GetContentSettings()->media_stream_requested_audio_device());
372 EXPECT_EQ(example_audio_id(),
373 GetContentSettings()->media_stream_selected_audio_device());
375 // Request cam and allow
376 SetDevicePolicy(DEVICE_TYPE_VIDEO, ACCESS_ALLOWED);
377 MediaStreamDevicesController cam_controller(
378 GetWebContents(),
379 CreateRequest(std::string(), example_video_id()),
380 base::Bind(&OnMediaStreamResponse));
381 NotifyTabSpecificContentSettings(&cam_controller);
382 EXPECT_TRUE(GetContentSettings()->IsContentAllowed(
383 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA));
384 EXPECT_FALSE(GetContentSettings()->IsContentBlocked(
385 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA));
386 EXPECT_EQ(example_video_id(),
387 GetContentSettings()->media_stream_requested_video_device());
388 EXPECT_EQ(example_video_id(),
389 GetContentSettings()->media_stream_selected_video_device());
391 // Mic state should not have changed.
392 EXPECT_FALSE(GetContentSettings()->IsContentAllowed(
393 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC));
394 EXPECT_TRUE(GetContentSettings()->IsContentBlocked(
395 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC));
396 EXPECT_EQ(example_audio_id(),
397 GetContentSettings()->media_stream_requested_audio_device());
398 EXPECT_EQ(example_audio_id(),
399 GetContentSettings()->media_stream_selected_audio_device());
402 // Denying mic access after camera access should still show the camera as state.
403 IN_PROC_BROWSER_TEST_F(MediaStreamDevicesControllerTest,
404 DenyMicDoesNotChangeCam) {
405 // Request cam and allow
406 SetDevicePolicy(DEVICE_TYPE_VIDEO, ACCESS_ALLOWED);
407 MediaStreamDevicesController cam_controller(
408 GetWebContents(),
409 CreateRequest(std::string(), example_video_id()),
410 base::Bind(&OnMediaStreamResponse));
411 NotifyTabSpecificContentSettings(&cam_controller);
412 EXPECT_TRUE(GetContentSettings()->IsContentAllowed(
413 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA));
414 EXPECT_FALSE(GetContentSettings()->IsContentBlocked(
415 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA));
416 EXPECT_EQ(example_video_id(),
417 GetContentSettings()->media_stream_requested_video_device());
418 EXPECT_EQ(example_video_id(),
419 GetContentSettings()->media_stream_selected_video_device());
420 EXPECT_EQ(TabSpecificContentSettings::CAMERA_ACCESSED,
421 GetContentSettings()->GetMicrophoneCameraState());
423 // Simulate that an a video stream is now being captured.
424 content::MediaStreamDevice fake_video_device(
425 content::MEDIA_DEVICE_VIDEO_CAPTURE, example_video_id(),
426 example_video_id());
427 content::MediaStreamDevices video_devices(1, fake_video_device);
428 MediaCaptureDevicesDispatcher* dispatcher =
429 MediaCaptureDevicesDispatcher::GetInstance();
430 dispatcher->SetTestVideoCaptureDevices(video_devices);
431 scoped_ptr<content::MediaStreamUI> video_stream_ui =
432 dispatcher->GetMediaStreamCaptureIndicator()->
433 RegisterMediaStream(GetWebContents(), video_devices);
434 video_stream_ui->OnStarted(base::Closure());
436 // Request mic and deny.
437 SetDevicePolicy(DEVICE_TYPE_AUDIO, ACCESS_DENIED);
438 MediaStreamDevicesController mic_controller(
439 GetWebContents(),
440 CreateRequest(example_audio_id(), std::string()),
441 base::Bind(&OnMediaStreamResponse));
442 NotifyTabSpecificContentSettings(&mic_controller);
443 EXPECT_FALSE(GetContentSettings()->IsContentAllowed(
444 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC));
445 EXPECT_TRUE(GetContentSettings()->IsContentBlocked(
446 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC));
447 EXPECT_EQ(example_audio_id(),
448 GetContentSettings()->media_stream_requested_audio_device());
449 EXPECT_EQ(example_audio_id(),
450 GetContentSettings()->media_stream_selected_audio_device());
452 // Cam should still be included in the state.
453 EXPECT_TRUE(GetContentSettings()->IsContentAllowed(
454 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA));
455 EXPECT_FALSE(GetContentSettings()->IsContentBlocked(
456 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA));
457 EXPECT_EQ(example_video_id(),
458 GetContentSettings()->media_stream_requested_video_device());
459 EXPECT_EQ(example_video_id(),
460 GetContentSettings()->media_stream_selected_video_device());
461 EXPECT_EQ(TabSpecificContentSettings::MICROPHONE_ACCESSED |
462 TabSpecificContentSettings::MICROPHONE_BLOCKED |
463 TabSpecificContentSettings::CAMERA_ACCESSED,
464 GetContentSettings()->GetMicrophoneCameraState());
466 // After ending the camera capture, the camera permission is no longer
467 // relevant, so it should no be included in the mic/cam state.
468 video_stream_ui.reset();
469 EXPECT_EQ(TabSpecificContentSettings::MICROPHONE_ACCESSED |
470 TabSpecificContentSettings::MICROPHONE_BLOCKED,
471 GetContentSettings()->GetMicrophoneCameraState());