diff --git a/tests/generators/index.html b/tests/generators/index.html index 4a73a3bd6..e1e5a1720 100644 --- a/tests/generators/index.html +++ b/tests/generators/index.html @@ -91,7 +91,7 @@ function start() { } /* - * Run this test to load all of the test files in all_test_names. The contents + * Run this test to load all of the tests in the selected suites. The contents * will be loaded into the workspace in order. To test the generators: * - select your language from the buttons above the text area * - copy all of the generated code @@ -101,20 +101,26 @@ function start() { * If some tests are failing, load test suites individually to continue * debugging. */ -function loadAll() { +function loadSelected() { var output = document.getElementById('importExport'); output.style.background = 'gray'; var loadingElem = document.getElementById('loading'); loadingElem.textContent = 'loading...'; - var options = document.getElementById('testUrl').options; - for (var i = 0; i < options.length; i++) { - var testUrl = options[i].value; - if (testUrl) { - var xmlText = fetchFile(testUrl); - if (xmlText !== null) { - fromXml(testUrl, xmlText, /* opt_append */ true); + // Clear before adding all of the blocks. + demoWorkspace.clear(); + + var boxList = document.getElementById('checkboxes'); + var inputChildren = boxList.getElementsByTagName('input'); + for (var i = 0; i < inputChildren.length; i++) { + if (inputChildren[i].checked) { + var testUrl = inputChildren[i].value; + if (testUrl) { + var xmlText = fetchFile(testUrl); + if (xmlText !== null) { + fromXml(testUrl, xmlText, /* opt_append */ true); + } } } } @@ -122,14 +128,13 @@ function loadAll() { loadingElem.textContent = 'done'; } -function loadXml() { - var dropdown = document.getElementById('testUrl'); - var url = dropdown.options[dropdown.selectedIndex].value; +/** + * Ask the user for a file name, then load that file's contents. + */ +function loadOther() { + var url = window.prompt('Enter URL of test file.'); if (!url) { - url = window.prompt('Enter URL of test file.'); - if (!url) { - return; - } + return; } var xmlText = fetchFile(url); if (xmlText !== null) { @@ -189,6 +194,22 @@ function fromXml(filename, xmlText, opt_append) { } } +function checkAll() { + var boxList = document.getElementById('checkboxes'); + var inputChildren = boxList.getElementsByTagName('input'); + for (var i = 0; i < inputChildren.length; i++) { + inputChildren[i].checked = true; + } +} + +function uncheckAll() { + var boxList = document.getElementById('checkboxes'); + var inputChildren = boxList.getElementsByTagName('input'); + for (var i = 0; i < inputChildren.length; i++) { + inputChildren[i].checked = false; + } +} + function setOutput(text) { var output = document.getElementById('importExport'); output.value = text; @@ -369,26 +390,28 @@ h1 {
See the docs for details on running the tests. -
- - -
+ +- - + + +
++