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

Unified Diff: LayoutTests/http/tests/push_messaging/permission-state-exception-in-service-worker.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-service-worker.html
diff --git a/LayoutTests/http/tests/push_messaging/permission-state-prompt-in-service-worker.html b/LayoutTests/http/tests/push_messaging/permission-state-exception-in-service-worker.html
similarity index 56%
copy from LayoutTests/http/tests/push_messaging/permission-state-prompt-in-service-worker.html
copy to LayoutTests/http/tests/push_messaging/permission-state-exception-in-service-worker.html
index 47273688b39ea9ce7f644feec72344315c713fdc..c1d79328afad0ff547db38fb2d660bce8f87242e 100644
--- a/LayoutTests/http/tests/push_messaging/permission-state-prompt-in-service-worker.html
+++ b/LayoutTests/http/tests/push_messaging/permission-state-exception-in-service-worker.html
@@ -1,9 +1,7 @@
<!DOCTYPE html>
<html>
<head>
-<title>
- Push API: permissionState when called in service worker resolves with prompt when no permission is set
-</title>
+<title>Push API: permissionState when called in service worker fails with NotSupportedError if userVisibleOnly is not used</title>
<link rel="manifest" href="resources/push_manifest.json">
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
@@ -12,7 +10,6 @@
</head>
<body>
<script>
-// This test uses the test runner. If running manually, clear permissions before running this test.
async_test(function(test) {
if (window.testRunner)
testRunner.setPermission('push-messaging', 'prompt', location.origin, location.origin);
@@ -22,20 +19,14 @@ async_test(function(test) {
getActiveServiceWorkerWithMessagePort(test, script, scope).then(function(workerInfo) {
workerInfo.port.postMessage({command: 'permissionState'});
-
workerInfo.port.addEventListener('message', function(event) {
- if (typeof event.data != 'object' || !event.data.command)
- assert_unreached('Invalid message from the service worker');
-
- assert_equals(event.data.command, 'permissionState');
- assert_true(event.data.success,
- 'permissionState should succeed. Error message: ' + event.data.errorMessage);
- assert_equals(event.data.permission, 'prompt');
-
+ assert_equals(event.data.errorMessage,
+ 'Chrome does not support push subscriptions that do not enable the userVisibleOnly option.');
test.done();
});
+
}).catch(unreached_rejection(test));
-}, 'permissionState when called in service worker resolves with prompt when no permission is set');
+}, 'Push API: permissionState when called in service worker fails with NotSupportedError if userVisibleOnly is not used');
</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698