tests/touch-events-v1/submissions/Nokia/idlharness.html
author Art Barstow <art.barstow@nokia.com>
Wed, 27 Feb 2013 14:24:39 -0500
changeset 185 c38015016e99
parent 184 6764e05979e1
child 186 a449f93b5275
permissions -rw-r--r--
Add Document: window.document to add_objects
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>idlharness test</title>
<link rel="author" title="W3C" href="http://www.w3.org/" />
<link rel="help" href="http://www.w3.org/TR/touch-events/#touch-interface"/>
<link rel="help" href="http://www.w3.org/TR/touch-events/#touchlist-interface"/>
<link rel="help" href="http://www.w3.org/TR/touch-events/#touchevent-interface"/>
<link rel="help" href="http://www.w3.org/TR/touch-events/#extensions-to-the-document-interface"/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/WebIDLParser.js"></script>
<script src="/resources/idlharness.js"></script>
</head>
<body>
<h1>idlharness test</h1>
<p>This test validates the WebIDL included in the Touch Events specification.</p>

<pre id='untested_idl' style='display:none'>

interface Window {
};

</pre>

<pre id='idl'>

interface Touch {
    readonly attribute long        identifier;
    readonly attribute EventTarget target;
    readonly attribute long        screenX;
    readonly attribute long        screenY;
    readonly attribute long        clientX;
    readonly attribute long        clientY;
    readonly attribute long        pageX;
    readonly attribute long        pageY;
};

interface TouchList {
    readonly attribute unsigned long length;
    getter Touch item (unsigned long index);
};

interface TouchEvent : UIEvent {
    readonly attribute TouchList touches;
    readonly attribute TouchList targetTouches;
    readonly attribute TouchList changedTouches;
    readonly attribute boolean   altKey;
    readonly attribute boolean   metaKey;
    readonly attribute boolean   ctrlKey;
    readonly attribute boolean   shiftKey;
};

partial interface Document {
    Touch     createTouch (AbstractView view, EventTarget target, long identifier, long pageX, long pageY, long screenX, long screenY);
    TouchList createTouchList (optional Touch... touches);
};

</pre>

<script>

(function() {
  var 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({Document: ["window.document"]});

  idl_array.test();
})();

</script>

<div id="log"></div>

</body>
</html>