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

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

Issue 186713002: Add new layout tests for the Web Notification API. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update existing tests Created 6 years, 9 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 testRunner.grantWebNotificationPermission("file://"); 13 testRunner.grantWebNotificationPermission("file://", true);
abarth-chromium 2014/03/04 19:07:35 What does |true| mean here? Can we use a string o
Peter Beverloo 2014/03/04 19:49:51 Do you think grantWebNotificationPermission(boolea
14 testRunner.dumpAsText(); 14 testRunner.dumpAsText();
15 testRunner.waitUntilDone(); 15 testRunner.waitUntilDone();
16 } 16 }
17 17
18 if (!window.Notification) { 18 if (!window.Notification) {
19 log("FAIL: No Notification constructor!"); 19 log("FAIL: No Notification constructor!");
20 } 20 }
21 21
22 var N = new Notification("Hello world"); 22 var N = new Notification("Hello world");
23 N.onshow = function() { log("PASS: show event fired."); } 23 N.onshow = function() { log("PASS: show event fired."); }
24 N.onerror = function() { log("FAIL: error event fired."); } 24 N.onerror = function() { log("FAIL: error event fired."); }
25 setTimeout(function() { testRunner.notifyDone(); }, 100); 25 setTimeout(function() { testRunner.notifyDone(); }, 100);
26 } 26 }
27 </script> 27 </script>
28 </head> 28 </head>
29 <body> 29 <body>
30 <p>Sending notifications with permission...</p> 30 <p>Sending notifications with permission...</p>
31 <div id="result"></div> 31 <div id="result"></div>
32 32
33 <script type="text/javascript"> 33 <script type="text/javascript">
34 runTests(); 34 runTests();
35 </script> 35 </script>
36 </body> 36 </body>
37 </html> 37 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698