Index: chrome/test/data/chrome_endure/endurance_control_webdriver.html |
diff --git a/chrome/test/data/chrome_endure/endurance_control_webdriver.html b/chrome/test/data/chrome_endure/endurance_control_webdriver.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8aa12e654f337abf868e0b0916190f6e426fa76b |
--- /dev/null |
+++ b/chrome/test/data/chrome_endure/endurance_control_webdriver.html |
@@ -0,0 +1,46 @@ |
+<!-- |
+ This file is used as a control test to compare with the other Chrome Endure |
+ tests in perf_endure.py. |
+ |
+ This file provides the ability to attach/detach a large DOM tree (also |
+ containing event listeners) in the live document. It is meant to be the same |
+ as endurance_control.html, except it provides buttons that can be clicked to |
+ cause the DOM tree to be attached/detached. This allows a control scenario |
+ to be driven by WebDriver, rather than being driven by the Javascript itself. |
+--> |
+ |
+<html> |
+ <head> |
+ <script type='text/javascript'> |
+ |
+ function attach_dom_tree() { |
+ 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); |
+ } |
+ |
+ function detach_dom_tree() { |
+ // The attached DOM tree occurs at child index 5 of document.body. |
+ document.body.removeChild(document.body.childNodes[5]); |
frankf1
2012/03/10 02:57:17
can you query the node by name instead of the posi
dennis_jeffrey
2012/03/12 18:48:07
Done - I gave the root node an ID.
|
+ } |
+ |
+ function mouse_move_callback(event) { |
+ // Stub. |
+ } |
+ </script> |
+ <title>Chrome Endure Control Test with WebDriver</title> |
+ </head> |
+ <body> |
+ <input type="button" id="attach" value="attach" |
+ onclick="attach_dom_tree();" /> |
+ <input type="button" id="detach" value="detach" |
+ onclick="detach_dom_tree();" /> |
+ </body> |
+</html> |