index.js 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. BABYLONDEVTOOLS.Loader.require('../validation/validation.js')
  2. .load(function() {
  3. document.getElementById("run").addEventListener("click", function() {
  4. // Loading tests
  5. var xhr = new XMLHttpRequest();
  6. xhr.open("GET", "../validation/config.json", true);
  7. xhr.addEventListener("load", function () {
  8. if (xhr.status === 200) {
  9. config = JSON.parse(xhr.responseText);
  10. // Run tests
  11. var index = 0;
  12. var title = document.getElementById("sceneName").value.toLowerCase();
  13. for (var index = 0; index < config.tests.length; index++) {
  14. if (config.tests[index].title.toLowerCase() === title) {
  15. break;
  16. }
  17. }
  18. runTest(index, function() {
  19. BABYLON.Engine.LastCreatedEngine.dispose();
  20. });
  21. }
  22. }, false);
  23. xhr.send();
  24. });
  25. });