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

Side by Side Diff: LayoutTests/http/tests/push_messaging/subscribe-failure-permission-denied-in-document.html

Issue 1313493003: Re-enable a push subscription-without-permission layout test. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>subscribe() is rejected when permission has been denied</title> 4 <title>subscribe() is rejected when permission has been denied</title>
5 <link rel="manifest" href="resources/push_manifest.json"> 5 <link rel="manifest" href="resources/push_manifest.json">
6 <script src="../resources/testharness.js"></script> 6 <script src="../resources/testharness.js"></script>
7 <script src="../resources/testharnessreport.js"></script> 7 <script src="../resources/testharnessreport.js"></script>
8 <script src="../serviceworker/resources/test-helpers.js"></script> 8 <script src="../serviceworker/resources/test-helpers.js"></script>
9 </head> 9 </head>
10 <body> 10 <body>
11 <script> 11 <script>
12 async_test(function(test) { 12 async_test(function(test) {
13 var workerUrl = 'resources/empty_worker.js'; 13 var workerUrl = 'resources/empty_worker.js';
14 var workerScope = 'resources/scope/' + location.pathname; 14 var workerScope = 'resources/scope/' + location.pathname;
15 var swRegistration; 15 var swRegistration;
16 service_worker_unregister_and_register(test, workerUrl, workerScope) 16 service_worker_unregister_and_register(test, workerUrl, workerScope)
17 .then(function(serviceWorkerRegistration) { 17 .then(function(serviceWorkerRegistration) {
18 swRegistration = serviceWorkerRegistration; 18 swRegistration = serviceWorkerRegistration;
19 return wait_for_state(test, swRegistration.installing, 'activated'); 19 return wait_for_state(test, swRegistration.installing, 'activated');
20 }) 20 })
21 .then(function() { 21 .then(function() {
22 // If running manually, deny permission when prompted. 22 // If running manually, deny permission when prompted.
23 if (window.testRunner) 23 if (window.testRunner)
24 testRunner.setPermission('push-messaging', 'denied', location.or igin, location.origin); 24 testRunner.setPermission('push-messaging', 'denied', location.or igin, location.origin);
25 return swRegistration.pushManager.subscribe(); 25 return swRegistration.pushManager.subscribe();
26 }) 26 })
27 .then(function(pushSubscription) { 27 .then(function(pushSubscription) {
28 assert_unreached('Subscription must not succeed after permission is denied.'); 28 assert_unreached('Subscription must not succeed after permission is denied.');
29 }, function(e) { 29 }, function(e) {
30 // TODO(peter): Re-enable this assert when the appropriate error is being thrown. 30 assert_equals(e.name, 'PermissionDeniedError');
31 //assert_equals(e.name, 'AbortError');
32 assert_regexp_match(e.message, /permission denied/); 31 assert_regexp_match(e.message, /permission denied/);
33 return service_worker_unregister_and_done(test, workerScope); 32 return service_worker_unregister_and_done(test, workerScope);
34 }) 33 })
35 .catch(unreached_rejection(test)); 34 .catch(unreached_rejection(test));
36 }, 'subscribe() is rejected when permission has been denied'); 35 }, 'subscribe() is rejected when permission has been denied');
37 </script> 36 </script>
38 </body> 37 </body>
39 </html> 38 </html>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698