| <!DOCTYPE HTML> |
| <html> |
| <head> |
| <script src="../resources/js-test-pre.js"></script> |
| </head> |
| <body> |
| <script> |
| description("Ensure PerformanceObserver callback fires even if the JS does not keep the PerformanceObserver object alive."); |
| window.jsTestIsAsync = true; |
| |
| let receivedEntries = []; |
| |
| let observer = new PerformanceObserver((list) => { |
| for (let mark of list.getEntries()) |
| receivedEntries.push(mark.name); |
| |
| if (receivedEntries.length == 3) { |
| for (let name of receivedEntries) |
| testPassed(name); |
| finishJSTest(); |
| } |
| }); |
| observer.observe({entryTypes: ["mark"]}); |
| observer = null; |
| gc(); |
| |
| // --- |
| |
| performance.mark("mark1"); |
| |
| setTimeout(() => { |
| gc(); |
| performance.mark("mark2"); |
| performance.mark("mark3"); |
| }, 50); |
| </script> |
| <script src="../resources/js-test-post.js"></script> |
| </body> |
| </html> |