Skip to content

Commit

Permalink
Add IDL test for partial InputEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
Chong Zhang authored and foolip committed Dec 16, 2016
1 parent d338f1a commit be5820e
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions input-events/idlharness.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<title>Input Event IDL tests</title>
<link rel="help" href="https://w3c.github.io/input-events/#h-interface-inputevent"/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/WebIDLParser.js"></script>
<script src="/resources/idlharness.js"></script>

<pre id="untested_idl">
interface InputEvent {
};
</pre>

<pre id='idl'>
partial interface InputEvent {
readonly attribute DOMString inputType;
readonly attribute DataTransfer? dataTransfer;
sequence<StaticRange> getTargetRanges();
};

partial dictionary InputEventInit {
DOMString inputType = "";
DataTransfer? dataTransfer = null;
sequence<StaticRange> targetRanges = [];
};
</pre>

<script>
(function(){
"use strict";
const idl_array = new IdlArray();
idl_array.add_untested_idls(document.getElementById("untested_idl").textContent);
idl_array.add_idls(document.getElementById("idl").textContent);
idl_array.add_objects({
InputEvent: ['new InputEvent("foo")'],
});
idl_array.test();
})();
</script>

0 comments on commit be5820e

Please sign in to comment.