test_memoryPressure.html (852B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <title>Test for ReportingObserver + memory-pressure</title> 5 <script src="/tests/SimpleTest/SimpleTest.js"></script> 6 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 7 </head> 8 <body> 9 10 <script type="application/javascript"> 11 12 info("Testing TakeRecords() without memory-pressure"); 13 let o = new ReportingObserver(() => {}); 14 o.observe(); 15 16 new TestingDeprecatedInterface(); 17 let r = o.takeRecords(); 18 is(r.length, 1, "We have 1 report"); 19 20 r = o.takeRecords(); 21 is(r.length, 0, "We have 0 reports after a takeRecords()"); 22 23 info("Testing DeprecatedTestingMethod report"); 24 25 new TestingDeprecatedInterface(); 26 SpecialPowers.Services.obs.notifyObservers(null, "memory-pressure", "heap-minimize"); 27 28 r = o.takeRecords(); 29 is(r.length, 0, "We have 0 reports after a memory-pressure"); 30 31 </script> 32 </body> 33 </html>