| 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/content_settings/host_content_settings_map_factory.h" |
| 9 #include "chrome/browser/media/media_stream_devices_controller.h" | 10 #include "chrome/browser/media/media_stream_devices_controller.h" |
| 10 #include "chrome/browser/media/webrtc_browsertest_base.h" | 11 #include "chrome/browser/media/webrtc_browsertest_base.h" |
| 11 #include "chrome/browser/media/webrtc_browsertest_common.h" | 12 #include "chrome/browser/media/webrtc_browsertest_common.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
| 14 #include "chrome/browser/ui/browser_tabstrip.h" | 15 #include "chrome/browser/ui/browser_tabstrip.h" |
| 15 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 16 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 16 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" | 17 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" |
| 17 #include "chrome/common/chrome_switches.h" | 18 #include "chrome/common/chrome_switches.h" |
| 18 #include "chrome/test/base/in_process_browser_test.h" | 19 #include "chrome/test/base/in_process_browser_test.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 } | 140 } |
| 140 | 141 |
| 141 IN_PROC_BROWSER_TEST_F(MediaStreamPermissionTest, | 142 IN_PROC_BROWSER_TEST_F(MediaStreamPermissionTest, |
| 142 TestDenyingThenClearingStickyException) { | 143 TestDenyingThenClearingStickyException) { |
| 143 content::WebContents* tab_contents = LoadTestPageInTab(); | 144 content::WebContents* tab_contents = LoadTestPageInTab(); |
| 144 | 145 |
| 145 GetUserMediaAndDeny(tab_contents); | 146 GetUserMediaAndDeny(tab_contents); |
| 146 GetUserMediaAndExpectAutoDenyWithoutPrompt(tab_contents); | 147 GetUserMediaAndExpectAutoDenyWithoutPrompt(tab_contents); |
| 147 | 148 |
| 148 HostContentSettingsMap* settings_map = | 149 HostContentSettingsMap* settings_map = |
| 149 browser()->profile()->GetHostContentSettingsMap(); | 150 HostContentSettingsMapFactory::GetForProfile(browser()->profile()); |
| 150 | 151 |
| 151 settings_map->ClearSettingsForOneType(CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC); | 152 settings_map->ClearSettingsForOneType(CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC); |
| 152 settings_map->ClearSettingsForOneType( | 153 settings_map->ClearSettingsForOneType( |
| 153 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA); | 154 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA); |
| 154 | 155 |
| 155 GetUserMediaAndDeny(tab_contents); | 156 GetUserMediaAndDeny(tab_contents); |
| 156 } | 157 } |
| 157 | 158 |
| 158 IN_PROC_BROWSER_TEST_F(MediaStreamPermissionTest, | 159 IN_PROC_BROWSER_TEST_F(MediaStreamPermissionTest, |
| 159 DenyingMicDoesNotCauseStickyDenyForCameras) { | 160 DenyingMicDoesNotCauseStickyDenyForCameras) { |
| 160 content::WebContents* tab_contents = LoadTestPageInTab(); | 161 content::WebContents* tab_contents = LoadTestPageInTab(); |
| 161 | 162 |
| 162 GetUserMediaWithSpecificConstraintsAndDeny(tab_contents, | 163 GetUserMediaWithSpecificConstraintsAndDeny(tab_contents, |
| 163 kAudioOnlyCallConstraints); | 164 kAudioOnlyCallConstraints); |
| 164 EXPECT_TRUE(GetUserMediaWithSpecificConstraintsAndAccept( | 165 EXPECT_TRUE(GetUserMediaWithSpecificConstraintsAndAccept( |
| 165 tab_contents, kVideoOnlyCallConstraints)); | 166 tab_contents, kVideoOnlyCallConstraints)); |
| 166 } | 167 } |
| 167 | 168 |
| 168 IN_PROC_BROWSER_TEST_F(MediaStreamPermissionTest, | 169 IN_PROC_BROWSER_TEST_F(MediaStreamPermissionTest, |
| 169 DenyingCameraDoesNotCauseStickyDenyForMics) { | 170 DenyingCameraDoesNotCauseStickyDenyForMics) { |
| 170 content::WebContents* tab_contents = LoadTestPageInTab(); | 171 content::WebContents* tab_contents = LoadTestPageInTab(); |
| 171 | 172 |
| 172 GetUserMediaWithSpecificConstraintsAndDeny(tab_contents, | 173 GetUserMediaWithSpecificConstraintsAndDeny(tab_contents, |
| 173 kVideoOnlyCallConstraints); | 174 kVideoOnlyCallConstraints); |
| 174 EXPECT_TRUE(GetUserMediaWithSpecificConstraintsAndAccept( | 175 EXPECT_TRUE(GetUserMediaWithSpecificConstraintsAndAccept( |
| 175 tab_contents, kAudioOnlyCallConstraints)); | 176 tab_contents, kAudioOnlyCallConstraints)); |
| 176 } | 177 } |
| OLD | NEW |