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

Side by Side Diff: LayoutTests/http/tests/push_messaging/has-permission-default-in-service-worker.html

Issue 1083193006: Rename hasPermission to permissionState. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: re-add hasPermission to the expectations file Created 5 years, 8 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>
5 hasPermission when called in service worker resolves with default when no perm ission is set
6 </title>
7 <link rel="manifest" href="resources/push_manifest.json">
8 <script src="../resources/testharness.js"></script>
9 <script src="../resources/testharnessreport.js"></script>
10 <script src="../serviceworker/resources/test-helpers.js"></script>
11 <script src="../notifications/resources/test-helpers.js"></script>
12 </head>
13 <body>
14 <script>
15 // This test uses the test runner. If running manually, clear permissions before running this test.
16 async_test(function(test) {
17 if (window.testRunner)
18 testRunner.setPermission('push-messaging', 'prompt', location.origin, lo cation.origin);
19
20 var script = 'resources/instrumentation-service-worker.js';
21 var scope = 'resources/scope/' + location.pathname;
22
23 getActiveServiceWorkerWithMessagePort(test, script, scope).then(function(wor kerInfo) {
24 workerInfo.port.postMessage({command: 'hasPermission'});
25
26 workerInfo.port.addEventListener('message', function(event) {
27 if (typeof event.data != 'object' || !event.data.command)
28 assert_unreached('Invalid message from the service worker');
29
30 assert_equals(event.data.command, 'hasPermission');
31 assert_true(event.data.success,
32 'hasPermission should succeed. Error message: ' + event. data.errorMessage);
33 assert_equals(event.data.permission, 'default');
34
35 test.done();
36 });
37 }).catch(unreached_rejection(test));
38 }, 'hasPermission when called in service worker resolves with default when no pe rmission is set');
39 </script>
40 </body>
41 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698