Index: content/shell/browser/layout_test/layout_test_push_messaging_service.cc |
diff --git a/content/shell/browser/layout_test/layout_test_push_messaging_service.cc b/content/shell/browser/layout_test/layout_test_push_messaging_service.cc |
index 493193597cbc7dfacf529d940daaa46ff46ffcad..721bd7a2cc5c3016cf731c9c85b04f7aa90c5449 100644 |
--- a/content/shell/browser/layout_test/layout_test_push_messaging_service.cc |
+++ b/content/shell/browser/layout_test/layout_test_push_messaging_service.cc |
@@ -119,10 +119,15 @@ void LayoutTestPushMessagingService::GetSubscriptionInfo( |
blink::WebPushPermissionStatus |
LayoutTestPushMessagingService::GetPermissionStatus(const GURL& origin, |
bool user_visible) { |
- return ToWebPushPermissionStatus(LayoutTestContentBrowserClient::Get() |
- ->browser_context() |
- ->GetPermissionManager() |
- ->GetPermissionStatus(PermissionType::PUSH_MESSAGING, origin, origin)); |
+ // This may be called for checking the permission for both a frame or a worker |
+ // however, since notifications can be used equally from frames/workers it's |
+ // sufficient just to check that whether it's available in the worker. |
+ return ToWebPushPermissionStatus( |
+ LayoutTestContentBrowserClient::Get() |
+ ->browser_context() |
+ ->GetPermissionManager() |
+ ->GetPermissionStatusForWorker(PermissionType::PUSH_MESSAGING, |
+ origin)); |
} |
bool LayoutTestPushMessagingService::SupportNonVisibleMessages() { |