test_notificationclick_otherwindow.html (1319B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=916893 5 --> 6 <head> 7 <title>Bug 1114554 - Test ServiceWorkerGlobalScope.notificationclick event.</title> 8 <script src="/tests/SimpleTest/SimpleTest.js"></script> 9 <script src="/tests/dom/notification/test/mochitest/MockAlertsService.js"></script> 10 <script src="/tests/dom/notification/test/mochitest/NotificationTest.js"></script> 11 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 12 </head> 13 <body> 14 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1114554">Bug 1114554</a> 15 <p id="display"></p> 16 <div id="content" style="display: none"> 17 </div> 18 <pre id="test"> 19 </pre> 20 <script src="/tests/dom/serviceworkers/test/utils.js"></script> 21 <script> 22 SimpleTest.requestFlakyTimeout("Mock alert service dispatches show and click events."); 23 24 add_task(() => setupServiceWorker("notificationclick.serviceworker.js", "notificationclick-otherwindow.html")); 25 26 add_task(async function runTest() { 27 await MockAlertsService.enableAutoClick(); 28 29 const args = { data: { complex: ["jsval", 5] } }; 30 const event = await testFrame('notificationclick-otherwindow.html', args); 31 isDeeply(event.notification.data, args.data, "Got notificationclick event with the correct data.") 32 }); 33 </script> 34 </body> 35 </html>