jasmine-headless-webkit/skel/template.html.erb

87 lines
2.7 KiB
Plaintext

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type"/>
<title>Jasmine Test Runner - Generated by jasmine-headless-webkit</title>
<script type="text/javascript"><%= File.read('
if (window.JHW) {
window.console = { log: function(data) {
if (typeof(jQuery) !== 'undefined' && data instanceof jQuery) {
JHW.log(style_html($("<div />").append(data).html(), { indent_size: 2 }));
} else {
var usejsDump = true;
try {
if (typeof data.toJSON == 'function') {
JHW.log("JSON: " + JSON.stringify(data, null, 2));
usejsDump = false;
}
} catch (e) {}
if (usejsDump) {
var dump = jsDump.doParse(data);
if (dump.indexOf("\\n") == -1) {
JHW.log(dump);
} else {
JHW.log("jsDump: " + dump);
}
}
}
}, pp: function(data) {
JHW.log(jasmine ? jasmine.pp(data) : JSON.stringify(data));
}, peek: function(data) {
console.log(data);
return data;
} };
window.onbeforeunload = function(e) {
JHW.leavePageAttempt('The code tried to leave the test page. Check for unhandled form submits and link clicks.');
if (e = e || window.event) {
e.returnValue = "leaving";
}
return "leaving";
};
JHW.stdout = {
print: function(content) { JHW.print('stdout', content); },
puts: function(content) { JHW.print('stdout', content + "\n"); }
};
JHW.report = {
print: function(content) { JHW.print('report', content); },
puts: function(content) { JHW.print('report', content + "\n"); }
};
JHW.log = function(msg) {
JHW.usedConsole();
JHW.stdout.puts(msg);
}
}
</script>
<%= files.join("\n") %>
<script type="text/javascript">
if (window.JHW) { HeadlessReporterResult.specLineNumbers = <%= MultiJson.encode(spec_lines) %>; }
</script>
</head>
<body>
<script type="text/javascript">
window._onload = window.onload
window.onload = function() {
if (window._onload) { window._onload() }
if (window.JHW) {
jasmine.getEnv().addReporter(new jasmine.HeadlessReporter(function() {
window.onbeforeunload = null;
}));
} else {
jasmine.getEnv().addReporter(new jasmine.HtmlReporter());
}
jasmine.getEnv().execute();
}
</script>
</body>
</html>