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

Unified Diff: chrome/browser/content_settings/permission_context_base_unittest.cc

Issue 1146403004: MidiPermissionContext::GetPermission() returns BLOCK for insecure origins. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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/content_settings/permission_context_base_unittest.cc
diff --git a/chrome/browser/content_settings/permission_context_base_unittest.cc b/chrome/browser/content_settings/permission_context_base_unittest.cc
index 8b4bb9ced9c917c642ba43767d2b5a5cd52dd984..92808c15cf9cb4853742cf4ca985be785db544be 100644
--- a/chrome/browser/content_settings/permission_context_base_unittest.cc
+++ b/chrome/browser/content_settings/permission_context_base_unittest.cc
@@ -178,31 +178,6 @@ class PermissionContextBaseTests : public ChromeRenderViewHostTestHarness {
EXPECT_EQ(CONTENT_SETTING_ASK, setting);
}
- void TestRequestPermissionNonSecureUrl(ContentSettingsType type) {
- TestPermissionContext permission_context(profile(), type);
- GURL url("http://www.google.com");
- content::WebContentsTester::For(web_contents())->NavigateAndCommit(url);
-
- const PermissionRequestID id(
- web_contents()->GetRenderProcessHost()->GetID(),
- web_contents()->GetRenderViewHost()->GetRoutingID(),
- -1, GURL());
- permission_context.RequestPermission(
- web_contents(),
- id, url, true,
- base::Bind(&TestPermissionContext::TrackPermissionDecision,
- base::Unretained(&permission_context)));
-
- EXPECT_TRUE(permission_context.permission_set());
- EXPECT_FALSE(permission_context.permission_granted());
- EXPECT_TRUE(permission_context.tab_context_updated());
-
- ContentSetting setting =
- profile()->GetHostContentSettingsMap()->GetContentSetting(
- url.GetOrigin(), url.GetOrigin(), type, std::string());
- EXPECT_EQ(CONTENT_SETTING_ASK, setting);
- }
-
void TestGrantAndRevoke_TestContent(ContentSettingsType type,
ContentSetting expected_default) {
TestPermissionContext permission_context(profile(), type);
@@ -282,13 +257,6 @@ TEST_F(PermissionContextBaseTests, TestNonValidRequestingUrl) {
#endif
}
-// Simulates non-secure requesting URL.
-// Web MIDI permission should be denied for non-secure origin.
-// Simulates granting and revoking of permissions.
-TEST_F(PermissionContextBaseTests, TestNonSecureRequestingUrl) {
- TestRequestPermissionNonSecureUrl(CONTENT_SETTINGS_TYPE_MIDI_SYSEX);
-}
-
TEST_F(PermissionContextBaseTests, TestGrantAndRevoke) {
TestGrantAndRevoke_TestContent(CONTENT_SETTINGS_TYPE_GEOLOCATION,
CONTENT_SETTING_ASK);

Powered by Google App Engine
This is Rietveld 408576698