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

Unified Diff: chrome/browser/media/webrtc/media_stream_device_permission_context_unittest.cc

Issue 2675483002: Replace PermissionType in chrome/ with ContentSettingsType (Closed)
Patch Set: rebase + include content_settings_types.h more Created 3 years, 10 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media/webrtc/media_stream_device_permission_context_unittest.cc
diff --git a/chrome/browser/media/webrtc/media_stream_device_permission_context_unittest.cc b/chrome/browser/media/webrtc/media_stream_device_permission_context_unittest.cc
index a373ba0d2d38336bfe3c6478a8c7a47688cb9107..97a2d10e8d66f7948a4cf922696e9ab4297962ad 100644
--- a/chrome/browser/media/webrtc/media_stream_device_permission_context_unittest.cc
+++ b/chrome/browser/media/webrtc/media_stream_device_permission_context_unittest.cc
@@ -15,7 +15,6 @@
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/content_settings/core/common/content_settings.h"
#include "components/content_settings/core/common/content_settings_types.h"
-#include "content/public/browser/permission_type.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/mock_render_process_host.h"
#include "content/public/test/web_contents_tester.h"
@@ -29,13 +28,8 @@ namespace {
class TestPermissionContext : public MediaStreamDevicePermissionContext {
public:
TestPermissionContext(Profile* profile,
- const ContentSettingsType permission_type)
- : MediaStreamDevicePermissionContext(
- profile,
- permission_type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA
- ? content::PermissionType::VIDEO_CAPTURE
- : content::PermissionType::AUDIO_CAPTURE,
- permission_type) {}
+ const ContentSettingsType content_settings_type)
+ : MediaStreamDevicePermissionContext(profile, content_settings_type) {}
~TestPermissionContext() override {}
};
@@ -49,8 +43,8 @@ class MediaStreamDevicePermissionContextTests
protected:
MediaStreamDevicePermissionContextTests() = default;
- void TestInsecureQueryingUrl(ContentSettingsType permission_type) {
- TestPermissionContext permission_context(profile(), permission_type);
+ void TestInsecureQueryingUrl(ContentSettingsType content_settings_type) {
+ TestPermissionContext permission_context(profile(), content_settings_type);
GURL insecure_url("http://www.example.com");
GURL secure_url("https://www.example.com");
@@ -59,20 +53,17 @@ class MediaStreamDevicePermissionContextTests
HostContentSettingsMapFactory::GetForProfile(profile())
->GetContentSetting(insecure_url.GetOrigin(),
insecure_url.GetOrigin(),
- permission_type,
- std::string()));
+ content_settings_type, std::string()));
EXPECT_EQ(CONTENT_SETTING_ASK,
HostContentSettingsMapFactory::GetForProfile(profile())
->GetContentSetting(secure_url.GetOrigin(),
insecure_url.GetOrigin(),
- permission_type,
- std::string()));
+ content_settings_type, std::string()));
EXPECT_EQ(CONTENT_SETTING_ASK,
HostContentSettingsMapFactory::GetForProfile(profile())
->GetContentSetting(insecure_url.GetOrigin(),
secure_url.GetOrigin(),
- permission_type,
- std::string()));
+ content_settings_type, std::string()));
EXPECT_EQ(CONTENT_SETTING_ASK,
permission_context.GetPermissionStatus(insecure_url, insecure_url)
@@ -83,8 +74,8 @@ class MediaStreamDevicePermissionContextTests
.content_setting);
}
- void TestSecureQueryingUrl(ContentSettingsType permission_type) {
- TestPermissionContext permission_context(profile(), permission_type);
+ void TestSecureQueryingUrl(ContentSettingsType content_settings_type) {
+ TestPermissionContext permission_context(profile(), content_settings_type);
GURL secure_url("https://www.example.com");
// Check that there is no saved content settings.
@@ -92,7 +83,7 @@ class MediaStreamDevicePermissionContextTests
HostContentSettingsMapFactory::GetForProfile(profile())
->GetContentSetting(secure_url.GetOrigin(),
secure_url.GetOrigin(),
- permission_type,
+ content_settings_type,
std::string()));
EXPECT_EQ(CONTENT_SETTING_ASK,

Powered by Google App Engine
This is Rietveld 408576698