Update tests to work around QUnit 1.9.0 bug in Narwhal/older-Firefox and add platform.js to test/index.html.

Former-commit-id: eed8246c795735558ba9f499b86f08ed3970ccaf
This commit is contained in:
John-David Dalton
2012-07-16 13:21:11 -04:00
parent a2fa52504c
commit 7e79903fe8
4 changed files with 1892 additions and 5 deletions

View File

@@ -7,7 +7,14 @@
</head>
<body>
<div id="qunit"></div>
<script src="../vendor/qunit/qunit/qunit.js"></script>
<script src="../vendor/platform.js/platform.js"></script>
<script>
// avoid syntax errors for `QUnit.throws` in older Firefoxes
document.write(platform.name == 'Firefox' && /^1\b/.test(platform.version)
? '<script src="../vendor/qunit/qunit/qunit-1.8.0.js"><\/script>'
: '<script src="../vendor/qunit/qunit/qunit.js"><\/script>'
);
</script>
<script src="test-ui.js"></script>
<script>
// set a bad shim
@@ -59,6 +66,17 @@
require(['test.js']);
});
// set a more readable browser name
window.onload = function() {
var timeoutId = setInterval(function() {
var ua = document.getElementById('qunit-userAgent');
if (ua) {
ua.innerHTML = platform;
clearInterval(timeoutId);
}
}, 15);
};
</script>
</body>
</html>