Supervised user whitelists: Cleanup
[chromium-blink-merge.git] / chrome / test / data / chrome_endure / endurance_control.html
blobe06ddbe783d012c6eb58ba73b184425b596a9be5
1 <!--
2 This file is used as a control test to compare with the other Chrome Endure
3 tests in perf_endure.py.
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
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,
9 we expect to see a "sawtooth" pattern that does not show any overall tendency
10 to increase.
11 -->
13 <html>
14 <head>
15 <script type='text/javascript'>
16 function start_tests() {
17 run_detached_dom_test();
20 function run_detached_dom_test() {
21 var last_node = document.createElement('div');
22 var root_node = last_node;
23 for (i=0; i<1000; i++) {
24 var node = document.createElement('div');
25 node.innerHTML = 'Node ' + i;
26 node.addEventListener('mousemove', mouse_move_callback, true);
27 last_node.appendChild(node);
28 last_node = node;
30 document.body.appendChild(root_node);
31 setTimeout('run_detached_dom_test2()', 500);
34 function run_detached_dom_test2() {
35 // Detach the dom tree that was just created (at child index 1).
36 document.body.removeChild(document.body.childNodes[1]);
37 setTimeout('run_detached_dom_test()', 500)
40 function mouse_move_callback(event) {
41 // Stub.
43 </script>
44 <title>Chrome Endure Control Test</title>
45 </head>
46 <body onload='start_tests()'>
47 </body>
48 </html>