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

Side by Side Diff: LayoutTests/http/tests/notifications/close-on-document-unload.html

Issue 1097383006: Notifications: use testRunner.setPermission() in addition of grantWebNotificationPermission. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@cleanup
Patch Set: fix expectations 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 <!doctype html> 1 <!doctype html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>Notifications: Closing a notification in the "unload" event does not crash.</title> 4 <title>Notifications: Closing a notification in the "unload" event does not crash.</title>
5 <script src="../resources/testharness.js"></script> 5 <script src="../resources/testharness.js"></script>
6 <script src="../resources/testharnessreport.js"></script> 6 <script src="../resources/testharnessreport.js"></script>
7 <script src="resources/test-helpers.js"></script> 7 <script src="resources/test-helpers.js"></script>
8 </head> 8 </head>
9 <body> 9 <body>
10 <script> 10 <script>
11 // Tests that closing a displayed Web Notification in the unload event doe s not 11 // Tests that closing a displayed Web Notification in the unload event doe s not
12 // cause the browser to crash. 12 // cause the browser to crash.
13 if (window.testRunner) { 13 if (window.testRunner) {
14 testRunner.setPermission('notifications', 'granted', location.origin, location.origin);
14 testRunner.grantWebNotificationPermission(location.origin, true); 15 testRunner.grantWebNotificationPermission(location.origin, true);
15 testRunner.setCanOpenWindows(); 16 testRunner.setCanOpenWindows();
16 } 17 }
17 18
18 async_test(function (test) { 19 async_test(function (test) {
19 var win = window.open('resources/window-close-in-unload-event.html'); 20 var win = window.open('resources/window-close-in-unload-event.html');
20 window.addEventListener('message', function (event) { 21 window.addEventListener('message', function (event) {
21 if (event.data == 'opened') { 22 if (event.data == 'opened') {
22 win.close(); 23 win.close();
23 } else if (event.data == 'closed') { 24 } else if (event.data == 'closed') {
24 test.done(); 25 test.done();
25 } 26 }
26 }); 27 });
27 28
28 }, 'Closing a notification in the "unload" event does not crash.'); 29 }, 'Closing a notification in the "unload" event does not crash.');
29 </script> 30 </script>
30 </body> 31 </body>
31 </html> 32 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698