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

Side by Side Diff: LayoutTests/http/tests/security/suborigins/suborigin-blocked-notifications.php

Issue 1100163002: Notifications: stop using notifications specific permission methods in LayoutTests. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@notifications_testrunner_setpermission
Patch Set: update 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
1 <?php 1 <?php
2 header("Content-Security-Policy: suborigin foobar"); 2 header("Content-Security-Policy: suborigin foobar");
3 ?> 3 ?>
4 <!DOCTYPE html> 4 <!DOCTYPE html>
5 <html> 5 <html>
6 <head> 6 <head>
7 <title>Notifications are denied in suborigins.</title> 7 <title>Notifications are denied in suborigins.</title>
8 <script src="/resources/testharness.js"></script> 8 <script src="/resources/testharness.js"></script>
9 <script src="/resources/testharnessreport.js"></script> 9 <script src="/resources/testharnessreport.js"></script>
10 </head> 10 </head>
11 <script> 11 <script>
12 testRunner.setPermission('notifications', 'granted', location.origin, location .origin); 12 testRunner.setPermission('notifications', 'granted', location.origin, location .origin);
13 testRunner.grantWebNotificationPermission(location.origin, true);
14 Notification.requestPermission(function (status) { 13 Notification.requestPermission(function (status) {
15 assert_equals(status, 'default', 'The notification permission request shou ld not be granted.'); 14 assert_equals(status, 'default', 'The notification permission request shou ld not be granted.');
16 15
17 var notification = new Notification('My Notification'); 16 var notification = new Notification('My Notification');
18 notification.addEventListener('show', function() { 17 notification.addEventListener('show', function() {
19 assert_unreached('The notification is not expected to be shown.'); 18 assert_unreached('The notification is not expected to be shown.');
20 }); 19 });
21 20
22 notification.addEventListener('error', function() { 21 notification.addEventListener('error', function() {
23 done(); 22 done();
24 }); 23 });
25 }); 24 });
26 </script> 25 </script>
27 </html> 26 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698