Bug 1915045 Ensure decode tasks are scheduled on BufferingState::Enter() r=media...
[gecko.git] / js / xpconnect / tests / mochitest / test_bug1681664.html
blob685d4aa66929a704c572229f86e6995daf6d79b7
1 <!DOCTYPE html>
2 <html lang="en" dir="ltr">
3 <head>
4 <title>Test page for bug 1681664</title>
5 <script src="/tests/SimpleTest/SimpleTest.js"></script>
6 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
7 <script>
8 SimpleTest.waitForExplicitFinish()
9 async function init() {
10 var Services = SpecialPowers.Services;
11 var observer = {
12 observe(subject, topic, data) {
13 if (topic === "process-hang-report") {
14 var report = subject.QueryInterface(Ci.nsIHangReport);
15 report.terminateScript();
16 Services.obs.removeObserver(observer, "process-hang-report");
21 Services.obs.addObserver(observer, "process-hang-report");
22 try {
23 await import("test_bug1681664_helper.js");
24 result.textContent = "FAIL";
25 } catch (ex) {
26 result.textContent = "PASS";
29 </script>
30 </head>
31 <body>
32 <p id="result"></p>
33 <script>
34 (async function() {
35 await init();
36 is(result.textContent, "PASS", "Infinite loop script should not cause browser crash");
37 SimpleTest.finish()
38 })();
39 </script>
40 </body>
41 </html>