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

Side by Side Diff: chrome/browser/permissions/permission_manager_unittest.cc

Issue 2171503003: Remove remaining occurences of CONTENT_SETTINGS_TYPE_PUSH_MESSAGING (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-push-content-setting-2
Patch Set: Remove remaining occurences of CONTENT_SETTINGS_TYPE_PUSH_MESSAGING Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/browser/permissions/permission_manager.h" 5 #include "chrome/browser/permissions/permission_manager.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" 9 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
10 #include "chrome/browser/permissions/permission_manager_factory.h" 10 #include "chrome/browser/permissions/permission_manager_factory.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 #endif 105 #endif
106 } 106 }
107 107
108 TEST_F(PermissionManagerTest, GetPermissionStatusAfterSet) { 108 TEST_F(PermissionManagerTest, GetPermissionStatusAfterSet) {
109 SetPermission(CONTENT_SETTINGS_TYPE_GEOLOCATION, CONTENT_SETTING_ALLOW); 109 SetPermission(CONTENT_SETTINGS_TYPE_GEOLOCATION, CONTENT_SETTING_ALLOW);
110 CheckPermissionStatus(PermissionType::GEOLOCATION, PermissionStatus::GRANTED); 110 CheckPermissionStatus(PermissionType::GEOLOCATION, PermissionStatus::GRANTED);
111 111
112 SetPermission(CONTENT_SETTINGS_TYPE_NOTIFICATIONS, CONTENT_SETTING_ALLOW); 112 SetPermission(CONTENT_SETTINGS_TYPE_NOTIFICATIONS, CONTENT_SETTING_ALLOW);
113 CheckPermissionStatus(PermissionType::NOTIFICATIONS, 113 CheckPermissionStatus(PermissionType::NOTIFICATIONS,
114 PermissionStatus::GRANTED); 114 PermissionStatus::GRANTED);
115 CheckPermissionStatus(PermissionType::PUSH_MESSAGING,
116 PermissionStatus::GRANTED);
115 117
116 SetPermission(CONTENT_SETTINGS_TYPE_MIDI_SYSEX, CONTENT_SETTING_ALLOW); 118 SetPermission(CONTENT_SETTINGS_TYPE_MIDI_SYSEX, CONTENT_SETTING_ALLOW);
117 CheckPermissionStatus(PermissionType::MIDI_SYSEX, PermissionStatus::GRANTED); 119 CheckPermissionStatus(PermissionType::MIDI_SYSEX, PermissionStatus::GRANTED);
118 120
119 SetPermission(CONTENT_SETTINGS_TYPE_PUSH_MESSAGING, CONTENT_SETTING_ALLOW);
120 CheckPermissionStatus(PermissionType::PUSH_MESSAGING,
121 PermissionStatus::GRANTED);
122
123 #if defined(OS_ANDROID) 121 #if defined(OS_ANDROID)
124 SetPermission(CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER, 122 SetPermission(CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER,
125 CONTENT_SETTING_ALLOW); 123 CONTENT_SETTING_ALLOW);
126 CheckPermissionStatus(PermissionType::PROTECTED_MEDIA_IDENTIFIER, 124 CheckPermissionStatus(PermissionType::PROTECTED_MEDIA_IDENTIFIER,
127 PermissionStatus::GRANTED); 125 PermissionStatus::GRANTED);
128 #endif 126 #endif
129 } 127 }
130 128
131 TEST_F(PermissionManagerTest, SameTypeChangeNotifies) { 129 TEST_F(PermissionManagerTest, SameTypeChangeNotifies) {
132 int subscription_id = GetPermissionManager()->SubscribePermissionStatusChange( 130 int subscription_id = GetPermissionManager()->SubscribePermissionStatusChange(
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 CheckPermissionStatus(PermissionType::GEOLOCATION, PermissionStatus::ASK); 309 CheckPermissionStatus(PermissionType::GEOLOCATION, PermissionStatus::ASK);
312 GetHostContentSettingsMap()->SetContentSettingDefaultScope( 310 GetHostContentSettingsMap()->SetContentSettingDefaultScope(
313 url(), url(), CONTENT_SETTINGS_TYPE_GEOLOCATION, std::string(), 311 url(), url(), CONTENT_SETTINGS_TYPE_GEOLOCATION, std::string(),
314 CONTENT_SETTING_ALLOW); 312 CONTENT_SETTING_ALLOW);
315 CheckPermissionStatus(PermissionType::GEOLOCATION, PermissionStatus::GRANTED); 313 CheckPermissionStatus(PermissionType::GEOLOCATION, PermissionStatus::GRANTED);
316 314
317 EXPECT_FALSE(callback_called()); 315 EXPECT_FALSE(callback_called());
318 316
319 GetPermissionManager()->UnsubscribePermissionStatusChange(subscription_id); 317 GetPermissionManager()->UnsubscribePermissionStatusChange(subscription_id);
320 } 318 }
OLDNEW
« no previous file with comments | « chrome/browser/permissions/permission_manager.cc ('k') | chrome/browser/permissions/permission_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698