Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4329)

Unified Diff: chrome/test/data/chrome_endure/endurance_control_webdriver.html

Issue 9687001: Adding another control test for Chrome Endure that uses WebDriver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698