https://github.com/web-platform-tests/wpt
Raw File
Tip revision: a50b8dadb93e9a7a20d2e31a7e5d0449ce37cd2c authored by Harald Alvestrand on 22 March 2018, 18:59:43 UTC
Add memory of last SDP offer/answer created
Tip revision: a50b8da
getgamepads-polling-manual.html
<!doctype html>
<html>
<head>
<title>Manual Gamepad getGamepads polling tests</title>
<link rel="help" href="https://w3c.github.io/gamepad/#navigator-interface-extension">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
setup({explicit_timeout: true});
// Poll until we see a gamepad.
var id = setInterval(function() {
  var gamepads = navigator.getGamepads();
  var found = null;
  for (var i = 0; i < gamepads.length; i++) {
    if (gamepads[i]) {
      found = gamepads[i];
      break;
    }
  }
  if (found) {
    clearInterval(id);
    done();
  }
}, 15);
</script>
</head>
<body>
<p>This test requires a gamepad. Connect one and press any button to start the test.</p>
</body>
</html>
back to top