https://github.com/web-platform-tests/wpt
Raw File
Tip revision: da25c99886fb1a85fcf5a138bb8f337761c5aa7f authored by Anne van Kesteren on 06 June 2018, 09:55:14 UTC
move service worker into resources too
Tip revision: da25c99
inputevent-constructor.html
<!DOCTYPE html>
<title>InputEvent Constructor Tests</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(function() {
  var e = new InputEvent('type');
  assert_equals(e.data, null, '.data');
  assert_false(e.isComposing, '.isComposing');
}, 'InputEvent constructor without InputEventInit.');

test(function() {
  var e = new InputEvent('type', { data: null, isComposing: true });
  assert_equals(e.data, null, '.data');
  assert_true(e.isComposing, '.isComposing');
}, 'InputEvent construtor with InputEventInit where data is null');

test(function() {
  assert_equals(new InputEvent('type', { data: ''}).data, '', '.data');
}, 'InputEvent construtor with InputEventInit where data is empty string');

test(function() {
  assert_equals(new InputEvent('type', { data: 'data' }).data, 'data', '.data');
}, 'InputEvent construtor with InputEventInit where data is non empty string');
</script>
back to top