Index: LayoutTests/http/tests/push_messaging/permission-state-exception-in-document.html |
diff --git a/LayoutTests/http/tests/push_messaging/permission-state-prompt-in-document.html b/LayoutTests/http/tests/push_messaging/permission-state-exception-in-document.html |
similarity index 53% |
copy from LayoutTests/http/tests/push_messaging/permission-state-prompt-in-document.html |
copy to LayoutTests/http/tests/push_messaging/permission-state-exception-in-document.html |
index 77dd09b03b8cd85634fa05ea3dc009d9aeacc02e..e73ae5141fdd88576ef3f77ab411ca0886aa5a94 100644 |
--- a/LayoutTests/http/tests/push_messaging/permission-state-prompt-in-document.html |
+++ b/LayoutTests/http/tests/push_messaging/permission-state-exception-in-document.html |
@@ -1,7 +1,7 @@ |
<!DOCTYPE html> |
<html> |
<head> |
-<title>Push API: permissionState resolves with prompt when no permission is set</title> |
+<title>Push API: permissionState fails with NotSupported if userVisible is not used</title> |
Peter Beverloo
2015/05/07 15:28:21
NotSupported -> NotSupportedError; userVisible ->
Miguel Garcia
2015/05/07 19:40:45
Done.
|
<link rel="manifest" href="resources/push_manifest.json"> |
<script src="../resources/testharness.js"></script> |
<script src="../resources/testharnessreport.js"></script> |
@@ -17,15 +17,17 @@ async_test(function(test) { |
var workerScope = 'resources/scope/' + location.pathname; |
service_worker_unregister_and_register(test, workerUrl, workerScope) |
.then(function(serviceWorkerRegistration) { |
- // If running manually, clear permissions before running this test. |
- return serviceWorkerRegistration.pushManager.permissionState(); |
+ // If running manually, clear permissions before running this test. |
Peter Beverloo
2015/05/07 15:28:21
Blink indents with four spaces.
Miguel Garcia
2015/05/07 19:40:46
Done.
|
+ return serviceWorkerRegistration.pushManager.permissionState(); |
}) |
.then(function(permissionStatus) { |
- assert_equals(permissionStatus, 'prompt'); |
- return service_worker_unregister_and_done(test, workerScope); |
- }) |
- .catch(unreached_rejection(test)); |
-}, 'Push API: permissionState() resolves with prompt when permission is not set'); |
+ assert_unreached('permissionStatus should have failed with a NotSupported exception'); |
+ }, function(error) { |
+ assert_equals(error.name, "NotSupportedError"); |
Peter Beverloo
2015/05/07 15:28:21
nit: Please be consistent with ' vs. "
Miguel Garcia
2015/05/07 19:40:45
Done.
|
+ assert_equals(error.message, "non-visible push messages are not supported."); |
+ test.done(); |
+ }).catch(unreached_rejection(test)); |
+}, 'Push API: permissionState fails with NotSupported if userVisible is not used'); |
</script> |
</body> |
</html> |