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

Unified Diff: LayoutTests/http/tests/push_messaging/permission-state-exception-in-document.html

Issue 1136513002: Reject permissonState calls if userVisible is not present as parameter (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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: 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>

Powered by Google App Engine
This is Rietveld 408576698