chromium/third_party/blink/web_tests/http/tests/push_messaging/permission-state-denied-in-document.html

<!DOCTYPE html>
<html>
<head>
<title>Push API: permissionState resolves with denied when permission is denied</title>
<link rel="manifest" href="resources/push_manifest.json">
<script src="../resources/permissions-helper.js"></script>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src="../serviceworker/resources/test-helpers.js"></script>
</head>
<body>
<script>
promise_test(function(test) {
    const workerUrl = 'resources/empty_worker.js';
    const workerScope = 'resources/scope/' + location.pathname;

    // If running manually, deny permission when prompted.
    return PermissionsHelper.setPermission('push-messaging', 'denied')
        .then(() => service_worker_unregister_and_register(test, workerUrl, workerScope))
        .then(serviceWorkerRegistration => {
            return serviceWorkerRegistration.pushManager.permissionState({ userVisibleOnly: true });
        })
        .then(permissionStatus => {
            assert_equals(permissionStatus, 'denied');
            return service_worker_unregister_and_done(test, workerScope);
        });
}, 'Push API: permissionState resolves with denied when permission is denied');
</script>
</body>
</html>