Index: chrome/test/data/chrome_endure/endurance_control.html |
diff --git a/chrome/test/data/chrome_endure/endurance_control.html b/chrome/test/data/chrome_endure/endurance_control.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..72a024e75d00484b15f89cfb1b062f55b0d66031 |
--- /dev/null |
+++ b/chrome/test/data/chrome_endure/endurance_control.html |
@@ -0,0 +1,48 @@ |
+<!-- |
+ This file is used as a control test to compare with the other Chrome Endure |
+ tests in perf_endure.py. |
+ |
+ This file creates a large DOM tree in the live document that also contains |
+ event listeners. It then detaches the tree at the root. Since no JS |
+ reference is kept, the tree should be collected by v8 at some point in the |
+ future. As a result, if graphing DOM node and event listener count over time, |
+ we expect to see a "sawtooth" pattern that does not show any overall tendency |
+ to increase. |
+--> |
+ |
+<html> |
+ <head> |
+ <script type='text/javascript'> |
+ function start_tests() { |
+ run_detached_dom_test(); |
+ } |
+ |
+ function run_detached_dom_test() { |
+ var last_node = document.createElement('div'); |
+ var root_node = last_node; |
+ for (i=0; i<1000; i++) { |
+ var node = document.createElement('div'); |
+ node.innerHTML = 'Node ' + i; |
+ node.addEventListener('mousemove', mouse_move_callback, true); |
+ last_node.appendChild(node); |
+ last_node = node; |
+ } |
+ document.body.appendChild(root_node); |
+ setTimeout('run_detached_dom_test2()', 500); |
+ } |
+ |
+ function run_detached_dom_test2() { |
+ // Detach the dom tree that was just created. |
+ document.body.removeChild(document.body.firstChild); |
+ setTimeout('run_detached_dom_test()', 500) |
+ } |
+ |
+ function mouse_move_callback(event) { |
+ // Stub. |
+ } |
+ </script> |
+ <title>Chrome Endure Control Test</title> |
+ </head> |
+ <body onload='start_tests()'> |
+ </body> |
+</html> |