Chromium Code Reviews| Index: LayoutTests/http/tests/push_messaging/has_permission_denied.html |
| diff --git a/LayoutTests/http/tests/push_messaging/has_permission_denied.html b/LayoutTests/http/tests/push_messaging/has_permission_denied.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c6c02c65fb66d65e709003d940658877652b02c4 |
| --- /dev/null |
| +++ b/LayoutTests/http/tests/push_messaging/has_permission_denied.html |
| @@ -0,0 +1,29 @@ |
| +<!DOCTYPE html> |
| +<html> |
| +<head> |
| +<title>Push API: hasPermission fulfills with denied when permission is denied</title> |
|
Peter Beverloo
2014/12/10 00:18:17
nit: s/fulfills/resolves/ (In the test's descripti
Michael van Ouwerkerk
2014/12/10 15:13:06
Done.
|
| +<link rel="manifest" href="resources/push_manifest.json"> |
| +<script src="../resources/testharness.js"></script> |
| +<script src="../resources/testharnessreport.js"></script> |
| +<script src="../serviceworker/resources/test-helpers.js"></script> |
| +</head> |
| +<body> |
| +<script> |
| +async_test(function(test) { |
| + assert_true(!!window.testRunner, 'This test requires the TestRunner.'); |
|
Peter Beverloo
2014/12/10 00:18:17
It might be nicer to make the testRunner "optional
Michael van Ouwerkerk
2014/12/10 15:13:06
Done.
|
| + var workerUrl = 'resources/empty_worker.js'; |
| + var workerScope = 'resources/scope/' + location.pathname; |
| + service_worker_unregister_and_register(test, workerUrl, workerScope) |
| + .then(function(serviceWorkerRegistration) { |
| + testRunner.setPushMessagingPermission(location.origin, false); |
| + return serviceWorkerRegistration.pushManager.hasPermission(); |
| + }) |
| + .then(function(permissionStatus) { |
| + assert_equals(permissionStatus, 'denied'); |
| + return service_worker_unregister_and_done(test, workerScope); |
| + }) |
| + .catch(unreached_rejection(test)); |
| +}, 'Push API: hasPermission fulfills with denied when permission is denied'); |
| +</script> |
| +</body> |
| +</html> |