blob: 58cf4d99c6f5dacf15a8489f5a1740c851a9f663 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<div id='sandbox'></div>
<div id="console"></div>
<script src="../resources/magnitude-perf.js"></script>
<script>
if (window.testRunner)
testRunner.dumpAsText();
var table;
var sandbox = document.getElementById('sandbox');
// Check that table.rows.length is properly cached.
function setupTableRows(magnitude)
{
if (sandbox.firstChild)
sandbox.removeChild(sandbox.firstChild);
table = document.createElement('table');
for (var i = 0; i < magnitude; ++i) {
var tr = document.createElement('tr');
table.appendChild(tr);
}
sandbox.appendChild(table);
// Make sure we have cached the length before testing!
table.rows.length;
}
function testTableRows(magnitude)
{
table.rows.length;
}
Magnitude.description('Tests that check that table.row.length is properly cached');
// Quite noisy
Magnitude.numTrials = 5;
Magnitude.successThreshold = 0.40; // 2 out of 5
Magnitude.tolerance = 0.30;
Magnitude.trim = 2;
Magnitude.run(setupTableRows, testTableRows, Magnitude.CONSTANT);
sandbox.removeChild(sandbox.firstChild);
</script>
</body>
</html>