blob: c5849225b4c602ab5c8772a9b5bc12108a33f9e9 [file] [log] [blame]
jchaffraix@webkit.org7a78f9a2011-06-16 16:50:19 +00001<!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
rniwa@webkit.org5cf7fa82012-06-15 07:38:37 +00009if (window.testRunner)
10 testRunner.dumpAsText();
jchaffraix@webkit.org7a78f9a2011-06-16 16:50:19 +000011
12var table;
13var sandbox = document.getElementById('sandbox');
14
15// Check that table.rows.length is properly cached.
16
17function 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
33function testTableRows(magnitude)
34{
35 table.rows.length;
36}
37
38Magnitude.description('Tests that check that table.row.length is properly cached');
39Magnitude.run(setupTableRows, testTableRows, Magnitude.CONSTANT);
40sandbox.removeChild(sandbox.firstChild);
41</script>
42</body>
43</html>