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

Unified Diff: chrome/browser/extensions/service_worker_apitest.cc

Issue 2020063003: Use GetPermissionStatus instead of DesktopNotificationProfileUtil::GetContentSetting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove embber param for notifications Created 4 years, 6 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/extensions/service_worker_apitest.cc
diff --git a/chrome/browser/extensions/service_worker_apitest.cc b/chrome/browser/extensions/service_worker_apitest.cc
index 68c6e0a9789a47525be737054d08d074f4a80182..e43459379906a8e0ebc2660dc7aba86da1b74f6a 100644
--- a/chrome/browser/extensions/service_worker_apitest.cc
+++ b/chrome/browser/extensions/service_worker_apitest.cc
@@ -11,6 +11,7 @@
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/notifications/desktop_notification_profile_util.h"
+#include "chrome/browser/permissions/permission_manager.h"
#include "chrome/browser/push_messaging/push_messaging_app_identifier.h"
#include "chrome/browser/push_messaging/push_messaging_service_factory.h"
#include "chrome/browser/push_messaging/push_messaging_service_impl.h"
@@ -21,6 +22,7 @@
#include "components/version_info/version_info.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_entry.h"
+#include "content/public/browser/permission_type.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/page_type.h"
@@ -198,9 +200,9 @@ class ServiceWorkerPushMessagingTest : public ServiceWorkerTest {
void GrantNotificationPermissionForTest(const GURL& url) {
GURL origin = url.GetOrigin();
DesktopNotificationProfileUtil::GrantPermission(profile(), origin);
- ASSERT_EQ(
- CONTENT_SETTING_ALLOW,
- DesktopNotificationProfileUtil::GetContentSetting(profile(), origin));
+ ASSERT_EQ(blink::mojom::PermissionStatus::GRANTED,
+ PermissionManager::Get(profile())->GetPermissionStatus(
+ content::PermissionType::NOTIFICATIONS, origin, origin));
}
PushMessagingAppIdentifier GetAppIdentifierForServiceWorkerRegistration(

Powered by Google App Engine
This is Rietveld 408576698