Source code

Revision control

Copy as Markdown

Other Tools

<!DOCTYPE HTML>
<html>
<!--
-->
<head>
<title>Bug 1114554 - Test ServiceWorkerGlobalScope.notificationclick event.</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script src="/tests/dom/notification/test/mochitest/MockAlertsService.js"></script>
<script src="/tests/dom/notification/test/mochitest/NotificationTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
<script src="/tests/dom/serviceworkers/test/utils.js"></script>
<script>
SimpleTest.requestFlakyTimeout("Mock alert service dispatches show and click events.");
add_task(() => setupServiceWorker("notificationclick.js", "notificationclick-otherwindow.html"));
add_task(async function runTest() {
await MockAlertsService.enableAutoClick();
const args = { data: { complex: ["jsval", 5] } };
const event = await testFrame('notificationclick-otherwindow.html', args);
isDeeply(event.notification.data, args.data, "Got notificationclick event with the correct data.")
});
</script>
</body>
</html>