/* Distributed under both the W3C Test Suite License [1] and the W3C 3-clause BSD License [2]. To contribute to a W3C Test Suite, see the policies and contribution forms [3]. [1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license [2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license [3] http://www.w3.org/2004/10/27-testcases */ /* * This file automatically generates browser tests for WebIDL interfaces, using * the testharness.js framework. To use, first include the following: * * * * * * * Then you'll need some type of IDLs. Here's some script that can be run on a * spec written in HTML, which will grab all the elements with class="idl", * concatenate them, and replace the body so you can copy-paste: * var s = ""; [].forEach.call(document.getElementsByClassName("idl"), function(idl) { //https://www.w3.org/Bugs/Public/show_bug.cgi?id=14914 if (!idl.classList.contains("extract")) { s += idl.textContent + "\n\n"; } }); document.body.innerHTML = '
'; document.body.firstChild.textContent = s; * * (TODO: write this in Python or something so that it can be done from the * command line instead.) * * Once you have that, put it in your script somehow. The easiest way is to * embed it literally in an HTML file with