test_memory_gc_events.html (946B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 Bug 1137527 - Test receiving GC events from the memory actor. 5 --> 6 <head> 7 <meta charset="utf-8"> 8 <title>Memory monitoring actor test</title> 9 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 10 <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"> 11 </head> 12 <body> 13 <pre id="test"> 14 <script src="memory-helpers.js" type="application/javascript"></script> 15 <script> 16 "use strict"; 17 18 window.onload = function() { 19 SimpleTest.waitForExplicitFinish(); 20 21 (async function() { 22 const { memory, target } = await startServerAndGetSelectedTabMemory(); 23 await memory.attach(); 24 25 const onGcEvent = memory.once("garbage-collection"); 26 27 memory.forceGarbageCollection(); 28 const gcData = await onGcEvent; 29 ok(gcData, "Got GC data"); 30 31 await memory.detach(); 32 destroyServerAndFinish(target); 33 })(); 34 }; 35 </script> 36 </pre> 37 </body> 38 </html>