blob: 58510f37ab5d97224ece8e1e3493c5366fa99c3d [file] [log] [blame]
<!DOCTYPE html>
<script src="/resources/js-test-pre.js"></script>
<script src="/resources/notifications-test-pre.js"></script>
<p id="description"></p>
<div id="console"></div>
<script>
if (window.testRunner) {
testRunner.grantWebNotificationPermission(testURL);
testRunner.setCanOpenWindows(true);
testRunner.waitUntilDone();
}
description("This test checks that a script can open windows when the user clicks on a native notification.");
shouldBeEqualToString("Notification.permission", "granted");
var n = new Notification("Test");
n.onshow = function() {
if (window.testRunner)
testRunner.simulateWebNotificationClick(this);
};
n.onclick = function() {
window.open('/notifications/resources/window-show-on-click.html');
};
function onWindowOpen() {
testPassed('clicking on notification successfully opened a window');
testCompleted();
}
</script>