Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / fast / notifications / notifications-permission-values.html
1 <!DOCTYPE html>
2 <html>
3     <head>
4         <script src="../../resources/js-test.js"></script>
5     </head>
6     <body>
7         <p>
8             Tests that the return values of Notification.permission match
9             the permission request status.
10         </p>
11         <div id="console"></div>
12         <script>
13             if (!window.testRunner) {
14                 testFailed("This test depends on window.testRunner to toggle permissions.");
15             } else {
16                 testRunner.clearWebNotificationPermissions();
17
18                 // The "default" state indicates that no permission request has
19                 // been answered yet.
20                 shouldBeEqualToString("Notification.permission", "default");
21
22                 testRunner.grantWebNotificationPermission("file://", false);
23                 shouldBeEqualToString("Notification.permission", "denied");
24
25                 testRunner.grantWebNotificationPermission("file://", true);
26                 shouldBeEqualToString("Notification.permission", "granted");
27             }
28         </script>
29     </body>
30 </html>