trisquel-icecat/icecat/dom/notification/test/mochitest/test_notificationclick_otherwindow.html
2025-10-06 02:35:48 -06:00

35 lines
1.3 KiB
HTML

<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=916893
-->
<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>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1114554">Bug 1114554</a>
<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>