helper_displayport_expiry.html (1305B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>Test for DisplayPort Expiry</title> 5 <meta charset="utf-8"> 6 <script src="apz_test_utils.js"></script> 7 <script src="/tests/SimpleTest/EventUtils.js"></script> 8 <script src="/tests/SimpleTest/paint_listener.js"></script> 9 <style> 10 #first { 11 height: 40vh; 12 width: 100%; 13 background: green; 14 overflow: scroll; 15 } 16 17 #second { 18 height: 40vh; 19 width: 100%; 20 background: yellow; 21 overflow: scroll; 22 } 23 24 #inner { 25 height: 20vh; 26 width: 50%; 27 background: red; 28 } 29 30 .big { 31 height: 100vh; 32 width: 100vw; 33 } 34 </style> 35 </head> 36 <body> 37 <div id="first"> 38 <div class="big"> 39 </div> 40 </div> 41 <br> 42 <div id="second"> 43 <div id="inner"> 44 <div class="big"> 45 </div> 46 </div> 47 <div class="big"> 48 </div> 49 </div> 50 </body> 51 <script> 52 async function test() { 53 await promiseFrame(); 54 55 let paintCount = 0; 56 function countPaints() { 57 paintCount += 1; 58 } 59 60 window.addEventListener("MozAfterPaint", countPaints); 61 62 await SpecialPowers.promiseTimeout(200); 63 64 window.removeEventListener("MozAfterPaint", countPaints); 65 66 info("paint count: " + paintCount); 67 68 ok(paintCount < 5, "Paint count is within the expect range"); 69 } 70 71 SimpleTest.waitForExplicitFinish(); 72 73 waitUntilApzStable() 74 .then(test) 75 .then(subtestDone, subtestFailed); 76 </script> 77 </html>