Chromium Code Reviews| Index: chrome/browser/chromeos/login/saml/saml_browsertest.cc |
| diff --git a/chrome/browser/chromeos/login/saml/saml_browsertest.cc b/chrome/browser/chromeos/login/saml/saml_browsertest.cc |
| index 35216ecf761abf4a8babd00d8555f9e9215da6a8..9114af8897951e7be97f22223ec48d5af020a5c9 100644 |
| --- a/chrome/browser/chromeos/login/saml/saml_browsertest.cc |
| +++ b/chrome/browser/chromeos/login/saml/saml_browsertest.cc |
| @@ -42,7 +42,7 @@ |
| #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| #include "chrome/browser/chromeos/settings/cros_settings.h" |
| #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
| -#include "chrome/browser/media/webrtc/media_permission.h" |
| +#include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" |
| #include "chrome/browser/policy/test/local_policy_test_server.h" |
| #include "chrome/browser/profiles/profile.h" |
| #include "chrome/browser/ui/webui/signin/signin_utils.h" |
| @@ -1442,48 +1442,40 @@ IN_PROC_BROWSER_TEST_F(SAMLPolicyTest, TestLoginMediaPermission) { |
| WaitForSigninScreen(); |
| content::WebContents* web_contents = GetLoginUI()->GetWebContents(); |
| - Profile* profile = |
| - Profile::FromBrowserContext(web_contents->GetBrowserContext()); |
| - content::MediaStreamRequestResult reason; |
| // Mic should always be blocked. |
| { |
|
emaxx
2017/04/06 02:41:47
nit: The brackets are no more required.
raymes
2017/04/10 00:16:48
Done.
|
| - MediaPermission permission(CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, url1, |
| - url1, profile, web_contents); |
| - EXPECT_EQ(CONTENT_SETTING_BLOCK, permission.GetPermissionStatus(&reason)); |
| + EXPECT_FALSE( |
| + MediaCaptureDevicesDispatcher::GetInstance() |
| + ->CheckMediaAccessPermission(web_contents, url1, |
| + content::MEDIA_DEVICE_AUDIO_CAPTURE)); |
| } |
| // Camera should be allowed if allowed by the whitelist, otherwise blocked. |
| - { |
| - MediaPermission permission(CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, url1, |
| - url1, profile, web_contents); |
| - EXPECT_EQ(CONTENT_SETTING_ALLOW, permission.GetPermissionStatus(&reason)); |
| - } |
| + EXPECT_TRUE( |
| + MediaCaptureDevicesDispatcher::GetInstance()->CheckMediaAccessPermission( |
| + web_contents, url1, content::MEDIA_DEVICE_VIDEO_CAPTURE)); |
| - { |
| - MediaPermission permission(CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, url2, |
| - url2, profile, web_contents); |
| - EXPECT_EQ(CONTENT_SETTING_ALLOW, permission.GetPermissionStatus(&reason)); |
| - } |
| + EXPECT_TRUE( |
| + MediaCaptureDevicesDispatcher::GetInstance()->CheckMediaAccessPermission( |
| + web_contents, url2, content::MEDIA_DEVICE_VIDEO_CAPTURE)); |
| - { |
| - MediaPermission permission(CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, url3, |
| - url3, profile, web_contents); |
| - EXPECT_EQ(CONTENT_SETTING_BLOCK, permission.GetPermissionStatus(&reason)); |
| - } |
| + EXPECT_FALSE( |
| + MediaCaptureDevicesDispatcher::GetInstance()->CheckMediaAccessPermission( |
| + web_contents, url3, content::MEDIA_DEVICE_VIDEO_CAPTURE)); |
| // Camera should be blocked in the login screen, even if it's allowed via |
| // content setting. |
| - { |
| - HostContentSettingsMapFactory::GetForProfile(profile) |
| - ->SetContentSettingDefaultScope( |
| - url3, url3, CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, std::string(), |
| - CONTENT_SETTING_ALLOW); |
| - |
| - MediaPermission permission(CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, url3, |
| - url3, profile, web_contents); |
| - EXPECT_EQ(CONTENT_SETTING_BLOCK, permission.GetPermissionStatus(&reason)); |
| - } |
| + Profile* profile = |
| + Profile::FromBrowserContext(web_contents->GetBrowserContext()); |
| + HostContentSettingsMapFactory::GetForProfile(profile) |
| + ->SetContentSettingDefaultScope(url3, url3, |
| + CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, |
| + std::string(), CONTENT_SETTING_ALLOW); |
| + |
| + EXPECT_FALSE( |
| + MediaCaptureDevicesDispatcher::GetInstance()->CheckMediaAccessPermission( |
| + web_contents, url3, content::MEDIA_DEVICE_VIDEO_CAPTURE)); |
| } |
| } // namespace chromeos |