(function() { var files; var browserId; var socketEndpoint = window.location.protocol + '//' + window.location.host; var thisFile = 'ci-support.js'; var thisScript = document.querySelector('script[src$="' + thisFile + '"]'); var base = thisScript.src.substring(0, thisScript.src.lastIndexOf('/')+1); var tools = { 'mocha-tdd': [ base + 'mocha/mocha.css', base + 'mocha/mocha.js', base + 'mocha-htmltest.js', function() { var div = document.createElement('div'); div.id = 'mocha'; document.body.appendChild(div); mocha.setup({ui: 'tdd', slow: 1000, timeout: 10000, htmlbase: ''}); } ], 'chai': [ base + 'chai/chai.js' ] }; function addFile() { var file = files.shift(); if (Object.prototype.toString.call(file) == '[object Function]') { file(); nextFile(); } else if (file.slice(-3) == '.js') { var script = document.createElement('script'); script.src = file; script.onload = nextFile; script.onerror = function() { console.error('Could not load ' + script.src); }; document.head.appendChild(script); } else if (file.slice(-4) == '.css') { var sheet = document.createElement('link'); sheet.rel = 'stylesheet'; sheet.href = file; document.head.appendChild(sheet); nextFile(); } } function nextFile() { if (files.length) { addFile(); } else { startMocha(); } } function getQueryVariable(variable) { var query = window.location.search.substring(1); var vars = query.split("&"); for (var i=0;i