Revision 40b50dd556d6df59d87f04c1c79bb90509345455 authored by Ryosuke Niwa on 20 October 2016, 01:17:03 UTC, committed by Domenic Denicola on 20 October 2016, 01:17:03 UTC
These tests have been reviewed and landed into WebKit: https://trac.webkit.org/browser/trunk/LayoutTests/fast/custom-elements

Almost all test cases pass on both WebKit and Blink.

Both test cases in parser-uses-constructed-element.html fails on Blink because Blink erroneously falls back to creating HTMLUnknownElement when a custom element constructor returns an element different from the one returned by the first call to HTMLElement constructor.

The last test case in parser-uses-registry-of-owner-document.html fails on Blink because Blink erroneously creates a non-HTMLElement Element inside a document created by document.implementation.createDocument with HTML namespace.

And the test case using the Document constructor fails in Blink since Blink does not implement the Document constructor yet.
1 parent 7154c15
Raw File
timestamp-manual.html
<!doctype html>
<html>
<head>
<title>Manual Gamepad timestamp tests</title>
<link rel="help" href="https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html#widl-Gamepad-timestamp">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
setup({explicit_timeout: true});

function set_instructions(text) {
  document.getElementById("instructions").textContent = text;
}

var index = -1;
var lastTimestamp = performance.now();
var id = -1;
addEventListener("gamepadconnected", function (e) {
  assert_equals(index, -1, "Too many connected events?");
  index = e.gamepad.index;
  assert_greater_than(e.gamepad.timestamp, lastTimestamp, "timestamp should be increasing");
  lastTimestamp = e.gamepad.timestamp;
  set_instructions("Found a gamepad. Now release the button you pressed and press it again.");
  // There may not be a button pressed here, so handle it cleanly either way.
  if (e.gamepad.buttons.some(function (b) { return b.pressed; })) {
    id = setInterval(waitForButtonRelease, 15);
  } else {
    id = setInterval(waitForButtonPress, 15);
  }
});

function waitForButtonRelease() {
  var gamepad = navigator.getGamepads()[index];
  assert_true(!!gamepad);
  if (gamepad.buttons.every(function (b) { return !b.pressed; })) {
    assert_greater_than(gamepad.timestamp, lastTimestamp, "timestamp should be increasing");
    lastTimestamp = gamepad.timestamp;
    clearInterval(id);
    id = setInterval(waitForButtonPress, 15);
  }
}

function waitForButtonPress() {
  var gamepad = navigator.getGamepads()[index];
  assert_true(!!gamepad);
  if (gamepad.buttons.some(function (b) { return b.pressed; })) {
    assert_greater_than(gamepad.timestamp, lastTimestamp, "timestamp should be increasing");
    clearInterval(id);
    done();
  }
}

</script>
</head>
<body>
<p id="instructions">This test requires a gamepad. Connect one and press any button to start the test.</p>
</body>
</html>
back to top