try banners instead of alerting

This commit is contained in:
Scott Miles
2013-04-09 19:23:18 -07:00
parent 686c50ed94
commit 0a536d9ddf
+9 -2
View File
@@ -6,11 +6,18 @@
// if standalone
if (window.top === window) {
// if standalone
window.done = function() {
alert('Test Passed');
var d = document.createElement('pre');
d.style.cssText = 'padding: 6px; background-color: lightgreen;';
d.textContent = 'Passed';
document.body.insertBefore(d, document.body.firstChild);
}
window.onerror = function(x) {
alert('Test FAILED: ' + x);
var d = document.createElement('pre');
d.style.cssText = 'padding: 6px; background-color: #FFE0E0;';
d.textContent = 'FAILED: ' + x + '\n\n' + lastError.stack;
document.body.insertBefore(d, document.body.firstChild);
};
} else
// if part of a test suite