test_auxclick_autoscroll_off.html (916B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>Test auxclick works when general.autoScroll is off</title> 4 <script src="/tests/SimpleTest/EventUtils.js"></script> 5 <script src="/tests/SimpleTest/SimpleTest.js"></script> 6 <link rel="stylesheet" href="/tests/SimpleTest/test.css" /> 7 8 <body style="height: 110vh;"> 9 <button id="target">button</button> 10 </body> 11 <script> 12 SimpleTest.waitForExplicitFinish(); 13 function test() { 14 const target = document.getElementById("target"); 15 target.addEventListener('auxclick', (e) => { 16 ok(true, "auxclick should work"); 17 SimpleTest.finish(); 18 }); 19 20 synthesizeMouseAtCenter(target, { type: "mousedown", button: 1 }); 21 synthesizeMouseAtCenter(target, { type: "mouseup", button: 1 }); 22 } 23 24 SpecialPowers.pushPrefEnv({"set": [ 25 ["general.autoScroll", false], 26 ]}, function() { 27 SimpleTest.waitForFocus(function() { 28 test(); 29 }); 30 }); 31 </script>