index.html revision 9eacd4f0aa36d89d83ef25c2ea6e6bf265ab08ab
<!doctype html>
<html>
<head>
<title>Generated test runner</title>
<style>
#info {
position: absolute;
right: 50px;
top: 50px;
border: 1px solid black;
background-color: #ccc;
}
iframe {
width: 575px;
height: 85px;
border: 1px dashed black;
}
</style>
</head>
<body>
<h1 id="results">Calculating</h1>
<div id="info">
<p>This test will take around 6 minutes when fully run.</p>
</div>
<pre id="note"></pre>
<script src="/build/yui/yui.js"></script>
<script src="generated.js"></script>
<script>
//gen_tests = ['node', 'yql', 'dd', 'combo_node', 'combo_yql', 'combo_dd'];
//gen_tests = ['node', 'yql', 'dd', 'rls_node', 'rls_yql', 'rls_dd'];
//gen_tests.reverse();
var h1 = document.getElementById('results');
var note = document.getElementById('note');
var frame;
var title = 'Prepping (#) tests';
document.title = h1.innerHTML = title.replace('#', gen_tests.length);
var log = function() {
var str = [];
for (var i = 0; i < arguments.length; i++) {
str.push(arguments[i]);
}
note.innerHTML = str.join(' ');
};
var results = {},
Assert,
YUITest;
var confirmTests = function() {
document.body.removeChild(frame);
document.title = h1.innerHTML = 'Prep Complete';
log('Starting YUI Tests');
var s = new YUITest.Suite("Dynamic Use");
s.add(new YUITest.Case(cases));
YUITest.Runner.subscribe(YUITest.Runner.COMPLETE_EVENT, function() {
document.title = h1.innerHTML = 'Tests Complete';
var endStamp = (new Date()).getTime();
var str = ((endStamp - startStamp) / 1000);
log('Tests Complete: ' + str + 'secs');
});
YUITest.Runner.add(s);
YUITest.Runner.run();
};
var runTest = function() {
var mod = gen_tests.pop();
if (mod) {
document.title = h1.innerHTML = title.replace('#', gen_tests.length);
log('Fetching: ', '/mod/' + mod);
if (!frame) {
frame = document.createElement('iframe');
frame.id = 'frame';
document.body.appendChild(frame);
}
frame.src = '/mod/' + mod;
} else {
confirmTests();
}
};
var _yui_result = function(d) {
log('Test Completed for', d.name);
results[d.name] = d;
//setTimeout(function() {
runTest();
//}, 200);
};
var startStamp = (new Date()).getTime();
YUI().use('test', function(Y) {
YUITest = Y.Test;
Assert = Y.Assert;
runTest();
});
</script>
</body>
</html>