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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/files/file_util.h" | 6 #include "base/files/file_util.h" |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
9 #include "chrome/browser/infobars/infobar_service.h" | 9 #include "chrome/browser/infobars/infobar_service.h" |
10 #include "chrome/browser/media/media_stream_devices_controller.h" | 10 #include "chrome/browser/media/media_stream_devices_controller.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 "files/webrtc/webrtc_jsep01_test.html"; | 58 "files/webrtc/webrtc_jsep01_test.html"; |
59 return test_server()->GetURL(kMainWebrtcTestHtmlPage); | 59 return test_server()->GetURL(kMainWebrtcTestHtmlPage); |
60 } | 60 } |
61 | 61 |
62 // Denies getUserMedia requests (audio, video) for the test page. | 62 // Denies getUserMedia requests (audio, video) for the test page. |
63 // The deny setting is sticky. | 63 // The deny setting is sticky. |
64 void DenyRequest(content::WebContents* tab_contents, | 64 void DenyRequest(content::WebContents* tab_contents, |
65 content::MediaStreamRequestResult result) const { | 65 content::MediaStreamRequestResult result) const { |
66 const std::string no_id; | 66 const std::string no_id; |
67 content::MediaStreamRequest request( | 67 content::MediaStreamRequest request( |
68 0, 0, 0, test_page_url().GetOrigin(), false, | 68 0, 0, 0, std::string(), test_page_url().GetOrigin(), false, |
69 content::MEDIA_DEVICE_ACCESS, no_id, no_id, | 69 content::MEDIA_DEVICE_ACCESS, no_id, no_id, |
70 content::MEDIA_DEVICE_AUDIO_CAPTURE, | 70 content::MEDIA_DEVICE_AUDIO_CAPTURE, |
71 content::MEDIA_DEVICE_VIDEO_CAPTURE); | 71 content::MEDIA_DEVICE_VIDEO_CAPTURE); |
72 | 72 |
73 scoped_ptr<MediaStreamDevicesController> controller( | 73 scoped_ptr<MediaStreamDevicesController> controller( |
74 new MediaStreamDevicesController(tab_contents, request, | 74 new MediaStreamDevicesController(tab_contents, request, |
75 base::Bind(&OnMediaStreamResponse))); | 75 base::Bind(&OnMediaStreamResponse))); |
76 controller->Deny(true, result); | 76 controller->Deny(true, result); |
77 } | 77 } |
78 | 78 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 IN_PROC_BROWSER_TEST_F(MediaStreamInfoBarTest, | 205 IN_PROC_BROWSER_TEST_F(MediaStreamInfoBarTest, |
206 DenyingCameraDoesNotCauseStickyDenyForMics) { | 206 DenyingCameraDoesNotCauseStickyDenyForMics) { |
207 content::WebContents* tab_contents = LoadTestPageInTab(); | 207 content::WebContents* tab_contents = LoadTestPageInTab(); |
208 | 208 |
209 // If camera blocking also blocked mics, the second call here would hang. | 209 // If camera blocking also blocked mics, the second call here would hang. |
210 GetUserMediaWithSpecificConstraintsAndDeny(tab_contents, | 210 GetUserMediaWithSpecificConstraintsAndDeny(tab_contents, |
211 kVideoOnlyCallConstraints); | 211 kVideoOnlyCallConstraints); |
212 GetUserMediaWithSpecificConstraintsAndAccept(tab_contents, | 212 GetUserMediaWithSpecificConstraintsAndAccept(tab_contents, |
213 kAudioOnlyCallConstraints); | 213 kAudioOnlyCallConstraints); |
214 } | 214 } |
OLD | NEW |