summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/notifications/notifications-with-permission.html
blob: 737ec58a147efae316db46b950b4841e58ccc64c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!DOCTYPE html>
<html>
<head>
    <script type="text/javascript">
        function log(message)
        {
            document.getElementById("result").innerHTML += message + "<br>";
        }
        
        function runTests()
        {
            if (window.testRunner) {
                testRunner.grantWebNotificationPermission("file://");
                testRunner.dumpAsText();
                if (testRunner.dumpNotifications)
                    testRunner.dumpNotifications();
                testRunner.waitUntilDone();
            }

            if (!window.webkitNotifications) {
                log("FAIL: No webkitNotifications interface!");
            }
            
            var M = window.webkitNotifications.createNotification("http://0.0.0.0/my_icon.png", "New E-mail", "Meet me tonight at 8!");
            M.ondisplay = function() { testRunner.notifyDone(); }
            M.show();
        }
    </script>
</head>
<body>
<p>Sending notifications with permission...</p>
    
    
<script type="text/javascript">
runTests();
</script>

<div id="result"></div>
</body>
</html>