test_memory.html (1332B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 Bug 923275 - Add a memory monitor widget to the developer toolbar 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 const measurement = await memory.measure(); 24 ok(measurement.total > 0, "total memory is valid"); 25 ok(measurement.domSize > 0, "domSize is valid"); 26 ok(measurement.styleSize > 0, "styleSize is valid"); 27 ok(measurement.jsObjectsSize > 0, "jsObjectsSize is valid"); 28 ok(measurement.jsStringsSize > 0, "jsStringsSize is valid"); 29 ok(measurement.jsOtherSize > 0, "jsOtherSize is valid"); 30 ok(measurement.otherSize > 0, "otherSize is valid"); 31 ok(measurement.jsMilliseconds, "jsMilliseconds is valid"); 32 ok(measurement.nonJSMilliseconds, "nonJSMilliseconds is valid"); 33 await destroyServerAndFinish(target); 34 })(); 35 }; 36 </script> 37 </pre> 38 </body> 39 </html>