blob: ca326a3ad024641d029d4ab4a1a9c4b7c683e718 [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.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>