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

Side by Side Diff: LayoutTests/fast/notifications/notifications-without-permission.html

Issue 23135009: Improve IDB module's SecurityError messages. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: test Created 7 years, 4 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script type="text/javascript"> 4 <script type="text/javascript">
5 function log(message) 5 function log(message)
6 { 6 {
7 document.getElementById("result").innerHTML += message + "<br>"; 7 document.getElementById("result").innerHTML += message + "<br>";
8 } 8 }
9 9
10 function runTests() 10 function runTests()
11 { 11 {
12 if (window.testRunner) { 12 if (window.testRunner) {
13 // NO PERMISSION testRunner.grantWebNotificationPermission("file ://"); 13 testRunner.removeAllWebNotificationPermissions();
14 testRunner.dumpAsText(); 14 testRunner.dumpAsText();
15 } 15 }
16 16
17 if (!window.webkitNotifications) { 17 if (!window.webkitNotifications) {
18 log("FAIL: No webkitNotifications interface!"); 18 log("FAIL: No webkitNotifications interface!");
19 } 19 }
20 20
21 try { 21 try {
22 var N = window.webkitNotifications.createNotification("http://0. 0.0.0/my_icon.png", "New E-mail", "Meet me tonight at 8!"); 22 var N = window.webkitNotifications.createNotification("http://0. 0.0.0/my_icon.png", "New E-mail", "Meet me tonight at 8!");
23 N.show(); 23 N.show();
24 log("FAIL: Should have thrown security exception."); 24 log("FAIL: Should have thrown security exception.");
25 } catch (e) { 25 } catch (e) {
26 log("PASS: Exception thrown."); 26 log("PASS: Exception thrown: " + e);
27 } 27 }
28 } 28 }
29 </script> 29 </script>
30 </head> 30 </head>
31 <body> 31 <body>
32 <p>Sending notifications without permission...</p> 32 <p>Sending notifications without permission...</p>
33 <div id="result"></div> 33 <div id="result"></div>
34 34
35 <script type="text/javascript"> 35 <script type="text/javascript">
36 runTests(); 36 runTests();
37 </script> 37 </script>
38 </body> 38 </body>
39 </html> 39 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698