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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!--
2 This file is used as a control test to compare with the other Chrome Endure
3 tests in perf_endure.py.
4
5 This file provides the ability to attach/detach a large DOM tree (also
6 containing event listeners) in the live document. It is meant to be the same
7 as endurance_control.html, except it provides buttons that can be clicked to
8 cause the DOM tree to be attached/detached. This allows a control scenario
9 to be driven by WebDriver, rather than being driven by the Javascript itself.
10 -->
11
12 <html>
13 <head>
14 <script type='text/javascript'>
15
16 function attach_dom_tree() {
17 var last_node = document.createElement('div');
18 var root_node = last_node;
19 for (i = 0; i < 1000; ++i) {
20 var node = document.createElement('div');
21 node.innerHTML = 'Node ' + i;
22 node.addEventListener('mousemove', mouse_move_callback, true);
23 last_node.appendChild(node);
24 last_node = node;
25 }
26 document.body.appendChild(root_node);
27 }
28
29 function detach_dom_tree() {
30 // The attached DOM tree occurs at child index 5 of document.body.
31 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.
32 }
33
34 function mouse_move_callback(event) {
35 // Stub.
36 }
37 </script>
38 <title>Chrome Endure Control Test with WebDriver</title>
39 </head>
40 <body>
41 <input type="button" id="attach" value="attach"
42 onclick="attach_dom_tree();" />
43 <input type="button" id="detach" value="detach"
44 onclick="detach_dom_tree();" />
45 </body>
46 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698