OLD | NEW |
1 <!-- | 1 <!-- |
2 This file is used as a control test to compare with the other Chrome Endure | 2 This file is used as a control test to compare with the other Chrome Endure |
3 tests in perf_endure.py. | 3 tests in perf_endure.py. |
4 | 4 |
5 This file creates a large DOM tree in the live document that also contains | 5 This file creates a large DOM tree in the live document that also contains |
6 event listeners. It then detaches the tree at the root. Since no JS | 6 event listeners. It then detaches the tree at the root. Since no JS |
7 reference is kept, the tree should be collected by v8 at some point in the | 7 reference is kept, the tree should be collected by v8 at some point in the |
8 future. As a result, if graphing DOM node and event listener count over time, | 8 future. As a result, if graphing DOM node and event listener count over time, |
9 we expect to see a "sawtooth" pattern that does not show any overall tendency | 9 we expect to see a "sawtooth" pattern that does not show any overall tendency |
10 to increase. | 10 to increase. |
(...skipping 14 matching lines...) Expand all Loading... |
25 node.innerHTML = 'Node ' + i; | 25 node.innerHTML = 'Node ' + i; |
26 node.addEventListener('mousemove', mouse_move_callback, true); | 26 node.addEventListener('mousemove', mouse_move_callback, true); |
27 last_node.appendChild(node); | 27 last_node.appendChild(node); |
28 last_node = node; | 28 last_node = node; |
29 } | 29 } |
30 document.body.appendChild(root_node); | 30 document.body.appendChild(root_node); |
31 setTimeout('run_detached_dom_test2()', 500); | 31 setTimeout('run_detached_dom_test2()', 500); |
32 } | 32 } |
33 | 33 |
34 function run_detached_dom_test2() { | 34 function run_detached_dom_test2() { |
35 // Detach the dom tree that was just created. | 35 // Detach the dom tree that was just created (at child index 1). |
36 document.body.removeChild(document.body.firstChild); | 36 document.body.removeChild(document.body.childNodes[1]); |
37 setTimeout('run_detached_dom_test()', 500) | 37 setTimeout('run_detached_dom_test()', 500) |
38 } | 38 } |
39 | 39 |
40 function mouse_move_callback(event) { | 40 function mouse_move_callback(event) { |
41 // Stub. | 41 // Stub. |
42 } | 42 } |
43 </script> | 43 </script> |
44 <title>Chrome Endure Control Test</title> | 44 <title>Chrome Endure Control Test</title> |
45 </head> | 45 </head> |
46 <body onload='start_tests()'> | 46 <body onload='start_tests()'> |
47 </body> | 47 </body> |
48 </html> | 48 </html> |
OLD | NEW |