summaryrefslogtreecommitdiffstats
path: root/dom/events/test/test_auxclick_autoscroll_off.html
blob: 5dd7b95920f0aec16e66aa9ad28062011741fef1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<!DOCTYPE html>
<meta charset="utf-8">
<title>Test auxclick works when general.autoScroll is off</title>
<script src="/tests/SimpleTest/EventUtils.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css" />

<body style="height: 110vh;">
  <button id="target">button</button>
</body>
<script>
  SimpleTest.waitForExplicitFinish();
  function test() {
    const target = document.getElementById("target");
    target.addEventListener('auxclick', (e) => {
      ok(true, "auxclick should work");
      SimpleTest.finish();
    });

    synthesizeMouseAtCenter(target, { type: "mousedown", button: 1 });
    synthesizeMouseAtCenter(target, { type: "mouseup", button: 1 });
  }

  SpecialPowers.pushPrefEnv({"set": [
    ["general.autoScroll", false],
  ]}, function() {
    SimpleTest.waitForFocus(function() {
      test();
    });
  });
</script>