| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <body> | |
| 4 <div id='sandbox'></div> | |
| 5 <div id="console"></div> | |
| 6 <script src="../resources/magnitude-perf.js"></script> | |
| 7 <script> | |
| 8 | |
| 9 if (window.testRunner) | |
| 10 testRunner.dumpAsText(); | |
| 11 | |
| 12 var table; | |
| 13 var sandbox = document.getElementById('sandbox'); | |
| 14 | |
| 15 // Check that table.rows.length is properly cached. | |
| 16 | |
| 17 function setupTableRows(magnitude) | |
| 18 { | |
| 19 if (sandbox.firstChild) | |
| 20 sandbox.removeChild(sandbox.firstChild); | |
| 21 table = document.createElement('table'); | |
| 22 | |
| 23 for (var i = 0; i < magnitude; ++i) { | |
| 24 var tr = document.createElement('tr'); | |
| 25 table.appendChild(tr); | |
| 26 } | |
| 27 sandbox.appendChild(table); | |
| 28 | |
| 29 // Make sure we have cached the length before testing! | |
| 30 table.rows.length; | |
| 31 } | |
| 32 | |
| 33 function testTableRows(magnitude) | |
| 34 { | |
| 35 table.rows.length; | |
| 36 } | |
| 37 | |
| 38 Magnitude.description('Tests that check that table.row.length is properly cached
'); | |
| 39 // Quite noisy | |
| 40 Magnitude.numTrials = 5; | |
| 41 Magnitude.successThreshold = 0.40; // 2 out of 5 | |
| 42 Magnitude.tolerance = 0.30; | |
| 43 Magnitude.trim = 2; | |
| 44 Magnitude.run(setupTableRows, testTableRows, Magnitude.CONSTANT); | |
| 45 sandbox.removeChild(sandbox.firstChild); | |
| 46 </script> | |
| 47 </body> | |
| 48 </html> | |
| OLD | NEW |